You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
staging: visorchipset driver to provide registration and other services
The visorchipset module receives device creation and destruction events from the Command service partition of s-Par, as well as controlling registration of shared device drivers with the s-Par driver core. The events received are used to populate other s-Par modules with their assigned shared devices. Visorchipset is required for shared device drivers to function properly. Visorchipset also stores information for handling dump disk device creation during kdump. In operation, the visorchipset module processes device creation and destruction messages sent by s-Par's Command service partition through a channel. These messages result in creation (or destruction) of each virtual bus and virtual device. Each bus and device is also associated with a communication channel, which is used to communicate with one or more IO service partitions to perform device IO on behalf of the guest. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e423812a9e
commit
12e364b9f0
@@ -11,5 +11,6 @@ if UNISYSSPAR
|
||||
|
||||
source "drivers/staging/unisys/visorutil/Kconfig"
|
||||
source "drivers/staging/unisys/visorchannel/Kconfig"
|
||||
source "drivers/staging/unisys/visorchipset/Kconfig"
|
||||
|
||||
endif # UNISYSSPAR
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
#
|
||||
obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/
|
||||
obj-$(CONFIG_UNISYS_VISORCHANNEL) += visorchannel/
|
||||
obj-$(CONFIG_UNISYS_VISORCHIPSET) += visorchipset/
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* CHANNEL Guids
|
||||
*/
|
||||
|
||||
/* Used in IOChannel
|
||||
* {414815ed-c58c-11da-95a9-00e08161165f}
|
||||
*/
|
||||
#define ULTRA_VHBA_CHANNEL_PROTOCOL_GUID \
|
||||
{ 0x414815ed, 0xc58c, 0x11da, \
|
||||
{ 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } }
|
||||
static const GUID UltraVhbaChannelProtocolGuid =
|
||||
ULTRA_VHBA_CHANNEL_PROTOCOL_GUID;
|
||||
|
||||
/* Used in IOChannel
|
||||
* {8cd5994d-c58e-11da-95a9-00e08161165f}
|
||||
*/
|
||||
#define ULTRA_VNIC_CHANNEL_PROTOCOL_GUID \
|
||||
{ 0x8cd5994d, 0xc58e, 0x11da, \
|
||||
{ 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } }
|
||||
static const GUID UltraVnicChannelProtocolGuid =
|
||||
ULTRA_VNIC_CHANNEL_PROTOCOL_GUID;
|
||||
|
||||
/* Used in IOChannel
|
||||
* {72120008-4AAB-11DC-8530-444553544200}
|
||||
*/
|
||||
#define ULTRA_SIOVM_GUID \
|
||||
{ 0x72120008, 0x4AAB, 0x11DC, \
|
||||
{ 0x85, 0x30, 0x44, 0x45, 0x53, 0x54, 0x42, 0x00 } }
|
||||
static const GUID UltraSIOVMGuid = ULTRA_SIOVM_GUID;
|
||||
|
||||
|
||||
/* Used in visornoop/visornoop_main.c
|
||||
* {5b52c5ac-e5f5-4d42-8dff-429eaecd221f}
|
||||
*/
|
||||
#define ULTRA_CONTROLDIRECTOR_CHANNEL_PROTOCOL_GUID \
|
||||
{ 0x5b52c5ac, 0xe5f5, 0x4d42, \
|
||||
{ 0x8d, 0xff, 0x42, 0x9e, 0xae, 0xcd, 0x22, 0x1f } }
|
||||
|
||||
static const GUID UltraControlDirectorChannelProtocolGuid =
|
||||
ULTRA_CONTROLDIRECTOR_CHANNEL_PROTOCOL_GUID;
|
||||
|
||||
/* Used in visorchipset/visorchipset_main.c
|
||||
* {B4E79625-AEDE-4EAA-9E11-D3EDDCD4504C}
|
||||
*/
|
||||
#define ULTRA_DIAG_POOL_CHANNEL_PROTOCOL_GUID \
|
||||
{0xb4e79625, 0xaede, 0x4eaa, \
|
||||
{ 0x9e, 0x11, 0xd3, 0xed, 0xdc, 0xd4, 0x50, 0x4c } }
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Module Name:
|
||||
* controlframework.h
|
||||
*
|
||||
* Abstract: This file defines common structures in the unmanaged
|
||||
* Ultravisor (mostly EFI) space.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CONTROL_FRAMEWORK_H_
|
||||
#define _CONTROL_FRAMEWORK_H_
|
||||
|
||||
#include "commontypes.h"
|
||||
#include "channel.h"
|
||||
|
||||
#define ULTRA_MEMORY_COUNT_Ki 1024
|
||||
|
||||
/* Scale order 0 is one 32-bit (4-byte) word (in 64 or 128-bit
|
||||
* architecture potentially 64 or 128-bit word) */
|
||||
#define ULTRA_MEMORY_PAGE_WORD 4
|
||||
|
||||
/* Define Ki scale page to be traditional 4KB page */
|
||||
#define ULTRA_MEMORY_PAGE_Ki (ULTRA_MEMORY_PAGE_WORD * ULTRA_MEMORY_COUNT_Ki)
|
||||
typedef struct _ULTRA_SEGMENT_STATE {
|
||||
U16 Enabled:1; /* Bit 0: May enter other states */
|
||||
U16 Active:1; /* Bit 1: Assigned to active partition */
|
||||
U16 Alive:1; /* Bit 2: Configure message sent to
|
||||
* service/server */
|
||||
U16 Revoked:1; /* Bit 3: similar to partition state
|
||||
* ShuttingDown */
|
||||
U16 Allocated:1; /* Bit 4: memory (device/port number)
|
||||
* has been selected by Command */
|
||||
U16 Known:1; /* Bit 5: has been introduced to the
|
||||
* service/guest partition */
|
||||
U16 Ready:1; /* Bit 6: service/Guest partition has
|
||||
* responded to introduction */
|
||||
U16 Operating:1; /* Bit 7: resource is configured and
|
||||
* operating */
|
||||
/* Note: don't use high bit unless we need to switch to ushort
|
||||
* which is non-compliant */
|
||||
} ULTRA_SEGMENT_STATE;
|
||||
static const ULTRA_SEGMENT_STATE SegmentStateRunning = {
|
||||
1, 1, 1, 0, 1, 1, 1, 1
|
||||
};
|
||||
static const ULTRA_SEGMENT_STATE SegmentStatePaused = {
|
||||
1, 1, 1, 0, 1, 1, 1, 0
|
||||
};
|
||||
static const ULTRA_SEGMENT_STATE SegmentStateStandby = {
|
||||
1, 1, 0, 0, 1, 1, 1, 0
|
||||
};
|
||||
typedef union {
|
||||
U64 Full;
|
||||
struct {
|
||||
U8 Major; /* will be 1 for the first release and
|
||||
* increment thereafter */
|
||||
U8 Minor;
|
||||
U16 Maintenance;
|
||||
U32 Revision; /* Subversion revision */
|
||||
} Part;
|
||||
} ULTRA_COMPONENT_VERSION;
|
||||
|
||||
#endif /* _CONTROL_FRAMEWORK_H_ not defined */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,427 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/*++
|
||||
*
|
||||
* Module Name:
|
||||
*
|
||||
* diagchannel.h
|
||||
*
|
||||
* Abstract:
|
||||
*
|
||||
* This file defines the DiagChannel protocol. This protocol is used to aid in
|
||||
* preserving event data sent by external applications. This protocol provides
|
||||
* a region for event data to reside in. This data will eventually be sent to
|
||||
* the Boot Partition where it will be committed to memory and/or disk. This
|
||||
* file contains platform-independent data that can be built using any
|
||||
* Supervisor build environment (Windows, Linux, EFI).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DIAG_CHANNEL_H_
|
||||
#define _DIAG_CHANNEL_H_
|
||||
|
||||
#include "commontypes.h"
|
||||
#include "channel.h"
|
||||
|
||||
/* {EEA7A573-DB82-447c-8716-EFBEAAAE4858} */
|
||||
#define ULTRA_DIAG_CHANNEL_PROTOCOL_GUID \
|
||||
{0xeea7a573, 0xdb82, 0x447c, \
|
||||
{0x87, 0x16, 0xef, 0xbe, 0xaa, 0xae, 0x48, 0x58} }
|
||||
|
||||
static const GUID UltraDiagChannelProtocolGuid =
|
||||
ULTRA_DIAG_CHANNEL_PROTOCOL_GUID;
|
||||
|
||||
/* {E850F968-3263-4484-8CA5-2A35D087A5A8} */
|
||||
#define ULTRA_DIAG_ROOT_CHANNEL_PROTOCOL_GUID \
|
||||
{0xe850f968, 0x3263, 0x4484, \
|
||||
{0x8c, 0xa5, 0x2a, 0x35, 0xd0, 0x87, 0xa5, 0xa8} }
|
||||
|
||||
#define ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
|
||||
|
||||
/* Must increment this whenever you insert or delete fields within this channel
|
||||
* struct. Also increment whenever you change the meaning of fields within this
|
||||
* channel struct so as to break pre-existing software. Note that you can
|
||||
* usually add fields to the END of the channel struct withOUT needing to
|
||||
* increment this. */
|
||||
#define ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID 2
|
||||
|
||||
#define ULTRA_DIAG_CHANNEL_OK_CLIENT(pChannel, logCtx) \
|
||||
(ULTRA_check_channel_client(pChannel, \
|
||||
UltraDiagChannelProtocolGuid, \
|
||||
"diag", \
|
||||
sizeof(ULTRA_DIAG_CHANNEL_PROTOCOL), \
|
||||
ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID, \
|
||||
ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE, \
|
||||
__FILE__, __LINE__, logCtx))
|
||||
#define ULTRA_DIAG_CHANNEL_OK_SERVER(actualBytes, logCtx) \
|
||||
(ULTRA_check_channel_server(UltraDiagChannelProtocolGuid, \
|
||||
"diag", \
|
||||
sizeof(ULTRA_DIAG_CHANNEL_PROTOCOL), \
|
||||
actualBytes, __FILE__, __LINE__, logCtx))
|
||||
#define MAX_MODULE_NAME_SIZE 128 /* Maximum length of module name... */
|
||||
#define MAX_ADDITIONAL_INFO_SIZE 256 /* Maximum length of any additional info
|
||||
* accompanying event... */
|
||||
#define MAX_SUBSYSTEMS 64 /* Maximum number of subsystems allowed in
|
||||
* DiagChannel... */
|
||||
#define LOW_SUBSYSTEMS 32 /* Half of MAX_SUBSYSTEMS to allow 64-bit
|
||||
* math */
|
||||
#define SUBSYSTEM_DEBUG 0 /* Standard subsystem for debug events */
|
||||
#define SUBSYSTEM_DEFAULT 1 /* Default subsystem for legacy calls to
|
||||
* ReportEvent */
|
||||
|
||||
/* few useful subsystem mask values */
|
||||
#define SUBSYSTEM_MASK_DEBUG 0x01 /* Standard subsystem for debug
|
||||
* events */
|
||||
#define SUBSYSTEM_MASK_DEFAULT 0x02 /* Default subsystem for legacy calls to
|
||||
* ReportEvents */
|
||||
|
||||
/* Event parameter "Severity" is overloaded with Cause in byte 2 and Severity in
|
||||
* byte 0, bytes 1 and 3 are reserved */
|
||||
#define SEVERITY_MASK 0x0FF /* mask out all but the Severity in byte 0 */
|
||||
#define CAUSE_MASK 0x0FF0000 /* mask out all but the cause in byte 2 */
|
||||
#define CAUSE_SHIFT_AMT 16 /* shift 2 bytes to place it in byte 2 */
|
||||
|
||||
/* SubsystemSeverityFilter */
|
||||
#define SEVERITY_FILTER_MASK 0x0F /* mask out the Cause half, SeverityFilter is
|
||||
* in the lower nibble */
|
||||
#define CAUSE_FILTER_MASK 0xF0 /* mask out the Severity half, CauseFilter is in
|
||||
* the upper nibble */
|
||||
#define CAUSE_FILTER_SHIFT_AMT 4 /* shift amount to place it in lower or upper
|
||||
* nibble */
|
||||
|
||||
/* Copied from EFI's EFI_TIME struct in efidef.h. EFI headers are not allowed
|
||||
* in some of the Supervisor areas, such as Monitor, so it has been "ported" here
|
||||
* for use in diagnostic event timestamps... */
|
||||
typedef struct _DIAG_EFI_TIME {
|
||||
U16 Year; /* 1998 - 20XX */
|
||||
U8 Month; /* 1 - 12 */
|
||||
U8 Day; /* 1 - 31 */
|
||||
U8 Hour; /* 0 - 23 */
|
||||
U8 Minute; /* 0 - 59 */
|
||||
U8 Second; /* 0 - 59 */
|
||||
U8 Pad1;
|
||||
U32 Nanosecond; /* 0 - 999, 999, 999 */
|
||||
S16 TimeZone; /* -1440 to 1440 or 2047 */
|
||||
U8 Daylight;
|
||||
U8 Pad2;
|
||||
} DIAG_EFI_TIME;
|
||||
|
||||
typedef enum {
|
||||
ULTRA_COMPONENT_GUEST = 0,
|
||||
ULTRA_COMPONENT_MONITOR = 0x01,
|
||||
ULTRA_COMPONENT_CCM = 0x02, /* Common Control module */
|
||||
/* RESERVED 0x03 - 0x7 */
|
||||
|
||||
/* Ultravisor Components */
|
||||
ULTRA_COMPONENT_BOOT = 0x08,
|
||||
ULTRA_COMPONENT_IDLE = 0x09,
|
||||
ULTRA_COMPONENT_CONTROL = 0x0A,
|
||||
ULTRA_COMPONENT_LOGGER = 0x0B,
|
||||
ULTRA_COMPONENT_ACPI = 0X0C,
|
||||
/* RESERVED 0x0D - 0x0F */
|
||||
|
||||
/* sPAR Components */
|
||||
ULTRA_COMPONENT_COMMAND = 0x10,
|
||||
ULTRA_COMPONENT_IODRIVER = 0x11,
|
||||
ULTRA_COMPONENT_CONSOLE = 0x12,
|
||||
ULTRA_COMPONENT_OPERATIONS = 0x13,
|
||||
ULTRA_COMPONENT_MANAGEMENT = 0x14,
|
||||
ULTRA_COMPONENT_DIAG = 0x15,
|
||||
ULTRA_COMPONENT_HWDIAG = 0x16,
|
||||
ULTRA_COMPONENT_PSERVICES = 0x17,
|
||||
ULTRA_COMPONENT_PDIAG = 0x18
|
||||
/* RESERVED 0x18 - 0x1F */
|
||||
} ULTRA_COMPONENT_TYPES;
|
||||
|
||||
/* Structure: DIAG_CHANNEL_EVENT Purpose: Contains attributes that make up an
|
||||
* event to be written to the DIAG_CHANNEL memory. Attributes: EventId: Id of
|
||||
* the diagnostic event to write to memory. Severity: Severity of the event
|
||||
* (Error, Info, etc). ModuleName: Module/file name where event originated.
|
||||
* LineNumber: Line number in module name where event originated. Timestamp:
|
||||
* Date/time when event was received by ReportEvent, and written to DiagChannel.
|
||||
* Reserved: Padding to align structure on a 64-byte cache line boundary.
|
||||
* AdditionalInfo: Array of characters for additional event info (may be
|
||||
* empty). */
|
||||
typedef struct _DIAG_CHANNEL_EVENT {
|
||||
U32 EventId;
|
||||
U32 Severity;
|
||||
U8 ModuleName[MAX_MODULE_NAME_SIZE];
|
||||
U32 LineNumber;
|
||||
DIAG_EFI_TIME Timestamp; /* Size = 16 bytes */
|
||||
U32 PartitionNumber; /* Filled in by Diag Switch as pool blocks are
|
||||
* filled */
|
||||
U16 VirtualProcessorNumber;
|
||||
U16 LogicalProcessorNumber;
|
||||
U8 ComponentType; /* ULTRA_COMPONENT_TYPES */
|
||||
U8 Subsystem;
|
||||
U16 Reserved0; /* pad to U64 alignment */
|
||||
U32 BlockNumber; /* filled in by DiagSwitch as pool blocks are
|
||||
* filled */
|
||||
U32 BlockNumberHigh;
|
||||
U32 EventNumber; /* filled in by DiagSwitch as pool blocks are
|
||||
* filled */
|
||||
U32 EventNumberHigh;
|
||||
|
||||
/* The BlockNumber and EventNumber fields are set only by DiagSwitch
|
||||
* and referenced only by WinDiagDisplay formatting tool as
|
||||
* additional diagnostic information. Other tools including
|
||||
* WinDiagDisplay currently ignore these 'Reserved' bytes. */
|
||||
U8 Reserved[8];
|
||||
U8 AdditionalInfo[MAX_ADDITIONAL_INFO_SIZE];
|
||||
|
||||
/* NOTE: Changesto DIAG_CHANNEL_EVENT generally need to be reflected in
|
||||
* existing copies *
|
||||
* - for AppOS at
|
||||
* GuestLinux/visordiag_early/supervisor_diagchannel.h *
|
||||
* - for WinDiagDisplay at
|
||||
* EFI/Ultra/Tools/WinDiagDisplay/WinDiagDisplay/diagstruct.h */
|
||||
} DIAG_CHANNEL_EVENT;
|
||||
|
||||
/* Levels of severity for diagnostic events, in order from lowest severity to
|
||||
* highest (i.e. fatal errors are the most severe, and should always be logged,
|
||||
* but info events rarely need to be logged except during debugging). The values
|
||||
* DIAG_SEVERITY_ENUM_BEGIN and DIAG_SEVERITY_ENUM_END are not valid severity
|
||||
* values. They exist merely to dilineate the list, so that future additions
|
||||
* won't require changes to the driver (i.e. when checking for out-of-range
|
||||
* severities in SetSeverity). The values DIAG_SEVERITY_OVERRIDE and
|
||||
* DIAG_SEVERITY_SHUTOFF are not valid severity values for logging events but
|
||||
* they are valid for controlling the amount of event data. This enum is also
|
||||
* defined in DotNet\sParFramework\ControlFramework\ControlFramework.cs. If a
|
||||
* change is made to this enum, they should also be reflected in that file. */
|
||||
typedef enum { DIAG_SEVERITY_ENUM_BEGIN = 0,
|
||||
DIAG_SEVERITY_OVERRIDE = DIAG_SEVERITY_ENUM_BEGIN,
|
||||
DIAG_SEVERITY_VERBOSE = DIAG_SEVERITY_OVERRIDE, /* 0 */
|
||||
DIAG_SEVERITY_INFO = DIAG_SEVERITY_VERBOSE + 1, /* 1 */
|
||||
DIAG_SEVERITY_WARNING = DIAG_SEVERITY_INFO + 1, /* 2 */
|
||||
DIAG_SEVERITY_ERR = DIAG_SEVERITY_WARNING + 1, /* 3 */
|
||||
DIAG_SEVERITY_PRINT = DIAG_SEVERITY_ERR + 1, /* 4 */
|
||||
DIAG_SEVERITY_SHUTOFF = DIAG_SEVERITY_PRINT + 1, /* 5 */
|
||||
DIAG_SEVERITY_ENUM_END = DIAG_SEVERITY_SHUTOFF, /* 5 */
|
||||
DIAG_SEVERITY_NONFATAL_ERR = DIAG_SEVERITY_ERR,
|
||||
DIAG_SEVERITY_FATAL_ERR = DIAG_SEVERITY_PRINT
|
||||
} DIAG_SEVERITY;
|
||||
|
||||
/* Event Cause enums
|
||||
*
|
||||
* Levels of cause for diagnostic events, in order from least to greatest cause
|
||||
* Internal errors are most urgent since ideally they should never exist
|
||||
* Invalid requests are preventable by avoiding invalid inputs
|
||||
* Operations errors depend on environmental factors which may impact which
|
||||
* requests are possible
|
||||
* Manifest provides intermediate value to capture firmware and configuration
|
||||
* version information
|
||||
* Trace provides suplimental debug information in release firmware
|
||||
* Unknown Log captures unclasified LogEvent calls.
|
||||
* Debug is the least urgent since it provides suplimental debug information only
|
||||
* in debug firmware
|
||||
* Unknown Debug captures unclassified DebugEvent calls.
|
||||
* This enum is also defined in
|
||||
* DotNet\sParFramework\ControlFramework\ControlFramework.cs.
|
||||
* If a change is made to this enum, they should also be reflected in that
|
||||
* file. */
|
||||
|
||||
|
||||
|
||||
/* A cause value "DIAG_CAUSE_FILE_XFER" together with a severity value of
|
||||
* "DIAG_SEVERITY_PRINT" (=4), is used for transferring text or binary file to
|
||||
* the Diag partition. This cause-severity combination will be used by Logger
|
||||
* DiagSwitch to segregate events into block types. The files are transferred in
|
||||
* 256 byte chunks maximum, in the AdditionalInfo field of the DIAG_CHANNEL_EVENT
|
||||
* structure. In the file transfer mode, some event fields will have different
|
||||
* meaning: EventId specifies the file offset, severity specifies the block type,
|
||||
* ModuleName specifies the filename, LineNumber specifies the number of valid
|
||||
* data bytes in an event and AdditionalInfo contains up to 256 bytes of data. */
|
||||
|
||||
/* The Diag DiagWriter appends event blocks to events.raw as today, and for data
|
||||
* blocks uses DIAG_CHANNEL_EVENT
|
||||
* PartitionNumber to extract and append 'AdditionalInfo' to filename (specified
|
||||
* by ModuleName). */
|
||||
|
||||
/* The Dell PDiag uses this new mechanism to stash DSET .zip onto the
|
||||
* 'diagnostic' virtual disk. */
|
||||
typedef enum {
|
||||
DIAG_CAUSE_UNKNOWN = 0,
|
||||
DIAG_CAUSE_UNKNOWN_DEBUG = DIAG_CAUSE_UNKNOWN + 1, /* 1 */
|
||||
DIAG_CAUSE_DEBUG = DIAG_CAUSE_UNKNOWN_DEBUG + 1, /* 2 */
|
||||
DIAG_CAUSE_UNKNOWN_LOG = DIAG_CAUSE_DEBUG + 1, /* 3 */
|
||||
DIAG_CAUSE_TRACE = DIAG_CAUSE_UNKNOWN_LOG + 1, /* 4 */
|
||||
DIAG_CAUSE_MANIFEST = DIAG_CAUSE_TRACE + 1, /* 5 */
|
||||
DIAG_CAUSE_OPERATIONS_ERROR = DIAG_CAUSE_MANIFEST + 1, /* 6 */
|
||||
DIAG_CAUSE_INVALID_REQUEST = DIAG_CAUSE_OPERATIONS_ERROR + 1, /* 7 */
|
||||
DIAG_CAUSE_INTERNAL_ERROR = DIAG_CAUSE_INVALID_REQUEST + 1, /* 8 */
|
||||
DIAG_CAUSE_FILE_XFER = DIAG_CAUSE_INTERNAL_ERROR + 1, /* 9 */
|
||||
DIAG_CAUSE_ENUM_END = DIAG_CAUSE_FILE_XFER /* 9 */
|
||||
} DIAG_CAUSE;
|
||||
|
||||
/* Event Cause category defined into the byte 2 of Severity */
|
||||
#define CAUSE_DEBUG (DIAG_CAUSE_DEBUG << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_TRACE (DIAG_CAUSE_TRACE << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_MANIFEST (DIAG_CAUSE_MANIFEST << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_OPERATIONS_ERROR (DIAG_CAUSE_OPERATIONS_ERROR << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_INVALID_REQUEST (DIAG_CAUSE_INVALID_REQUEST << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_INTERNAL_ERROR (DIAG_CAUSE_INTERNAL_ERROR << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_FILE_XFER (DIAG_CAUSE_FILE_XFER << CAUSE_SHIFT_AMT)
|
||||
#define CAUSE_ENUM_END CAUSE_FILE_XFER
|
||||
|
||||
/* Combine Cause and Severity categories into one */
|
||||
#define CAUSE_DEBUG_SEVERITY_VERBOSE \
|
||||
(CAUSE_DEBUG | DIAG_SEVERITY_VERBOSE)
|
||||
#define CAUSE_TRACE_SEVERITY_VERBOSE \
|
||||
(CAUSE_TRACE | DIAG_SEVERITY_VERBOSE)
|
||||
#define CAUSE_MANIFEST_SEVERITY_VERBOSE\
|
||||
(CAUSE_MANIFEST | DIAG_SEVERITY_VERBOSE)
|
||||
#define CAUSE_OPERATIONS_SEVERITY_VERBOSE \
|
||||
(CAUSE_OPERATIONS_ERROR | DIAG_SEVERITY_VERBOSE)
|
||||
#define CAUSE_INVALID_SEVERITY_VERBOSE \
|
||||
(CAUSE_INVALID_REQUEST | DIAG_SEVERITY_VERBOSE)
|
||||
#define CAUSE_INTERNAL_SEVERITY_VERBOSE \
|
||||
(CAUSE_INTERNAL_ERROR | DIAG_SEVERITY_VERBOSE)
|
||||
|
||||
#define CAUSE_DEBUG_SEVERITY_INFO \
|
||||
(CAUSE_DEBUG | DIAG_SEVERITY_INFO)
|
||||
#define CAUSE_TRACE_SEVERITY_INFO \
|
||||
(CAUSE_TRACE | DIAG_SEVERITY_INFO)
|
||||
#define CAUSE_MANIFEST_SEVERITY_INFO \
|
||||
(CAUSE_MANIFEST | DIAG_SEVERITY_INFO)
|
||||
#define CAUSE_OPERATIONS_SEVERITY_INFO \
|
||||
(CAUSE_OPERATIONS_ERROR | DIAG_SEVERITY_INFO)
|
||||
#define CAUSE_INVALID_SEVERITY_INFO \
|
||||
(CAUSE_INVALID_REQUEST | DIAG_SEVERITY_INFO)
|
||||
#define CAUSE_INTERNAL_SEVERITY_INFO \
|
||||
(CAUSE_INTERNAL_ERROR | DIAG_SEVERITY_INFO)
|
||||
|
||||
#define CAUSE_DEBUG_SEVERITY_WARN \
|
||||
(CAUSE_DEBUG | DIAG_SEVERITY_WARNING)
|
||||
#define CAUSE_TRACE_SEVERITY_WARN \
|
||||
(CAUSE_TRACE | DIAG_SEVERITY_WARNING)
|
||||
#define CAUSE_MANIFEST_SEVERITY_WARN \
|
||||
(CAUSE_MANIFEST | DIAG_SEVERITY_WARNING)
|
||||
#define CAUSE_OPERATIONS_SEVERITY_WARN \
|
||||
(CAUSE_OPERATIONS_ERROR | DIAG_SEVERITY_WARNING)
|
||||
#define CAUSE_INVALID_SEVERITY_WARN \
|
||||
(CAUSE_INVALID_REQUEST | DIAG_SEVERITY_WARNING)
|
||||
#define CAUSE_INTERNAL_SEVERITY_WARN \
|
||||
(CAUSE_INTERNAL_ERROR | DIAG_SEVERITY_WARNING)
|
||||
|
||||
#define CAUSE_DEBUG_SEVERITY_ERR \
|
||||
(CAUSE_DEBUG | DIAG_SEVERITY_ERR)
|
||||
#define CAUSE_TRACE_SEVERITY_ERR \
|
||||
(CAUSE_TRACE | DIAG_SEVERITY_ERR)
|
||||
#define CAUSE_MANIFEST_SEVERITY_ERR \
|
||||
(CAUSE_MANIFEST | DIAG_SEVERITY_ERR)
|
||||
#define CAUSE_OPERATIONS_SEVERITY_ERR \
|
||||
(CAUSE_OPERATIONS_ERROR | DIAG_SEVERITY_ERR)
|
||||
#define CAUSE_INVALID_SEVERITY_ERR \
|
||||
(CAUSE_INVALID_REQUEST | DIAG_SEVERITY_ERR)
|
||||
#define CAUSE_INTERNAL_SEVERITY_ERR \
|
||||
(CAUSE_INTERNAL_ERROR | DIAG_SEVERITY_ERR)
|
||||
|
||||
#define CAUSE_DEBUG_SEVERITY_PRINT \
|
||||
(CAUSE_DEBUG | DIAG_SEVERITY_PRINT)
|
||||
#define CAUSE_TRACE_SEVERITY_PRINT \
|
||||
(CAUSE_TRACE | DIAG_SEVERITY_PRINT)
|
||||
#define CAUSE_MANIFEST_SEVERITY_PRINT \
|
||||
(CAUSE_MANIFEST | DIAG_SEVERITY_PRINT)
|
||||
#define CAUSE_OPERATIONS_SEVERITY_PRINT \
|
||||
(CAUSE_OPERATIONS_ERROR | DIAG_SEVERITY_PRINT)
|
||||
#define CAUSE_INVALID_SEVERITY_PRINT \
|
||||
(CAUSE_INVALID_REQUEST | DIAG_SEVERITY_PRINT)
|
||||
#define CAUSE_INTERNAL_SEVERITY_PRINT \
|
||||
(CAUSE_INTERNAL_ERROR | DIAG_SEVERITY_PRINT)
|
||||
#define CAUSE_FILE_XFER_SEVERITY_PRINT \
|
||||
(CAUSE_FILE_XFER | DIAG_SEVERITY_PRINT)
|
||||
|
||||
/* Structure: DIAG_CHANNEL_PROTOCOL_HEADER
|
||||
*
|
||||
* Purpose: Contains attributes that make up the header specific to the
|
||||
* DIAG_CHANNEL area.
|
||||
*
|
||||
* Attributes:
|
||||
*
|
||||
* DiagLock: Diag Channel spinlock.
|
||||
*
|
||||
*IsChannelInitialized: 1 iff SignalInit was called for this channel; otherwise
|
||||
* 0, and assume the channel is not ready for use yet.
|
||||
*
|
||||
* Reserved: Padding to allign the fields in this structure.
|
||||
*
|
||||
*SubsystemSeverityFilter: Level of severity on a subsystem basis that controls
|
||||
* whether events are logged. Any event's severity for a
|
||||
* particular subsystem below this level will be discarded.
|
||||
*/
|
||||
typedef struct _DIAG_CHANNEL_PROTOCOL_HEADER {
|
||||
volatile U32 DiagLock;
|
||||
U8 IsChannelInitialized;
|
||||
U8 Reserved[3];
|
||||
U8 SubsystemSeverityFilter[64];
|
||||
} DIAG_CHANNEL_PROTOCOL_HEADER;
|
||||
|
||||
/* The Diagram for the Diagnostic Channel: */
|
||||
/* ----------------------- */
|
||||
/* | Channel Header | Defined by ULTRA_CHANNEL_PROTOCOL */
|
||||
/* ----------------------- */
|
||||
/* | Signal Queue Header | Defined by SIGNAL_QUEUE_HEADER */
|
||||
/* ----------------------- */
|
||||
/* | DiagChannel Header | Defined by DIAG_CHANNEL_PROTOCOL_HEADER */
|
||||
/* ----------------------- */
|
||||
/* | Channel Event Info | Defined by (DIAG_CHANNEL_EVENT * MAX_EVENTS) */
|
||||
/* ----------------------- */
|
||||
/* | Reserved | Reserved (pad out to 4MB) */
|
||||
/* ----------------------- */
|
||||
|
||||
/* Offsets/sizes for diagnostic channel attributes... */
|
||||
#define DIAG_CH_QUEUE_HEADER_OFFSET (sizeof(ULTRA_CHANNEL_PROTOCOL))
|
||||
#define DIAG_CH_QUEUE_HEADER_SIZE (sizeof(SIGNAL_QUEUE_HEADER))
|
||||
#define DIAG_CH_PROTOCOL_HEADER_OFFSET \
|
||||
(DIAG_CH_QUEUE_HEADER_OFFSET + DIAG_CH_QUEUE_HEADER_SIZE)
|
||||
#define DIAG_CH_PROTOCOL_HEADER_SIZE (sizeof(DIAG_CHANNEL_PROTOCOL_HEADER))
|
||||
#define DIAG_CH_EVENT_OFFSET \
|
||||
(DIAG_CH_PROTOCOL_HEADER_OFFSET + DIAG_CH_PROTOCOL_HEADER_SIZE)
|
||||
#define DIAG_CH_SIZE (4096 * 1024)
|
||||
|
||||
/* For Control and Idle Partitions with larger (8 MB) diagnostic(root)
|
||||
* channels */
|
||||
#define DIAG_CH_LRG_SIZE (2 * DIAG_CH_SIZE) /* 8 MB */
|
||||
|
||||
/*
|
||||
* Structure: ULTRA_DIAG_CHANNEL_PROTOCOL
|
||||
*
|
||||
* Purpose: Contains attributes that make up the DIAG_CHANNEL memory.
|
||||
*
|
||||
* Attributes:
|
||||
*
|
||||
* CommonChannelHeader: Header info common to all channels.
|
||||
*
|
||||
* QueueHeader: Queue header common to all channels - used to determine where to
|
||||
* store event.
|
||||
*
|
||||
* DiagChannelHeader: Diagnostic channel header info (see
|
||||
* DIAG_CHANNEL_PROTOCOL_HEADER comments).
|
||||
*
|
||||
* Events: Area where diagnostic events (up to MAX_EVENTS) are written.
|
||||
*
|
||||
*Reserved: Reserved area to allow for correct channel size padding.
|
||||
*/
|
||||
typedef struct _ULTRA_DIAG_CHANNEL_PROTOCOL {
|
||||
ULTRA_CHANNEL_PROTOCOL CommonChannelHeader;
|
||||
SIGNAL_QUEUE_HEADER QueueHeader;
|
||||
DIAG_CHANNEL_PROTOCOL_HEADER DiagChannelHeader;
|
||||
DIAG_CHANNEL_EVENT Events[(DIAG_CH_SIZE - DIAG_CH_EVENT_OFFSET) /
|
||||
sizeof(DIAG_CHANNEL_EVENT)];
|
||||
}
|
||||
ULTRA_DIAG_CHANNEL_PROTOCOL;
|
||||
|
||||
#endif
|
||||
938
drivers/staging/unisys/common-spar/include/channels/iochannel.h
Normal file
938
drivers/staging/unisys/common-spar/include/channels/iochannel.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,127 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#ifndef __VBUSCHANNEL_H__
|
||||
#define __VBUSCHANNEL_H__
|
||||
|
||||
/* The vbus channel is the channel area provided via the BUS_CREATE controlvm
|
||||
* message for each virtual bus. This channel area is provided to both server
|
||||
* and client ends of the bus. The channel header area is initialized by
|
||||
* the server, and the remaining information is filled in by the client.
|
||||
* We currently use this for the client to provide various information about
|
||||
* the client devices and client drivers for the server end to see.
|
||||
*/
|
||||
#include "commontypes.h"
|
||||
#include "vbusdeviceinfo.h"
|
||||
#include "channel.h"
|
||||
|
||||
/* {193b331b-c58f-11da-95a9-00e08161165f} */
|
||||
#define ULTRA_VBUS_CHANNEL_PROTOCOL_GUID \
|
||||
{0x193b331b, 0xc58f, 0x11da, \
|
||||
{0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f} }
|
||||
static const GUID UltraVbusChannelProtocolGuid =
|
||||
ULTRA_VBUS_CHANNEL_PROTOCOL_GUID;
|
||||
|
||||
#define ULTRA_VBUS_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
|
||||
|
||||
/* Must increment this whenever you insert or delete fields within this channel
|
||||
* struct. Also increment whenever you change the meaning of fields within this
|
||||
* channel struct so as to break pre-existing software. Note that you can
|
||||
* usually add fields to the END of the channel struct withOUT needing to
|
||||
* increment this. */
|
||||
#define ULTRA_VBUS_CHANNEL_PROTOCOL_VERSIONID 1
|
||||
|
||||
#define ULTRA_VBUS_CHANNEL_OK_CLIENT(pChannel, logCtx) \
|
||||
(ULTRA_check_channel_client(pChannel, \
|
||||
UltraVbusChannelProtocolGuid, \
|
||||
"vbus", \
|
||||
sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL), \
|
||||
ULTRA_VBUS_CHANNEL_PROTOCOL_VERSIONID, \
|
||||
ULTRA_VBUS_CHANNEL_PROTOCOL_SIGNATURE, \
|
||||
__FILE__, __LINE__, logCtx))
|
||||
|
||||
#define ULTRA_VBUS_CHANNEL_OK_SERVER(actualBytes, logCtx) \
|
||||
(ULTRA_check_channel_server(UltraVbusChannelProtocolGuid, \
|
||||
"vbus", \
|
||||
sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL), \
|
||||
actualBytes, \
|
||||
__FILE__, __LINE__, logCtx))
|
||||
|
||||
|
||||
#pragma pack(push, 1) /* both GCC and VC now allow this pragma */
|
||||
typedef struct _ULTRA_VBUS_HEADERINFO {
|
||||
U32 structBytes; /* size of this struct in bytes */
|
||||
U32 deviceInfoStructBytes; /* sizeof(ULTRA_VBUS_DEVICEINFO) */
|
||||
U32 devInfoCount; /* num of items in DevInfo member */
|
||||
/* (this is the allocated size) */
|
||||
U32 chpInfoByteOffset; /* byte offset from beginning of this struct */
|
||||
/* to the the ChpInfo struct (below) */
|
||||
U32 busInfoByteOffset; /* byte offset from beginning of this struct */
|
||||
/* to the the BusInfo struct (below) */
|
||||
U32 devInfoByteOffset; /* byte offset from beginning of this struct */
|
||||
/* to the the DevInfo array (below) */
|
||||
U8 reserved[104];
|
||||
} ULTRA_VBUS_HEADERINFO;
|
||||
|
||||
typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
|
||||
ULTRA_CHANNEL_PROTOCOL ChannelHeader; /* initialized by server */
|
||||
ULTRA_VBUS_HEADERINFO HdrInfo; /* initialized by server */
|
||||
/* the remainder of this channel is filled in by the client */
|
||||
ULTRA_VBUS_DEVICEINFO ChpInfo; /* describes client chipset device and
|
||||
* driver */
|
||||
ULTRA_VBUS_DEVICEINFO BusInfo; /* describes client bus device and
|
||||
* driver */
|
||||
ULTRA_VBUS_DEVICEINFO DevInfo[0]; /* describes client device and
|
||||
* driver for */
|
||||
/* each device on the bus */
|
||||
} ULTRA_VBUS_CHANNEL_PROTOCOL;
|
||||
|
||||
#define VBUS_CH_SIZE_EXACT(MAXDEVICES) \
|
||||
(sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL) + ((MAXDEVICES) * \
|
||||
sizeof(ULTRA_VBUS_DEVICEINFO)))
|
||||
#define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
|
||||
|
||||
static INLINE void
|
||||
ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x, int bytesAllocated)
|
||||
{
|
||||
/* Please note that the memory at <x> does NOT necessarily have space
|
||||
* for DevInfo structs allocated at the end, which is why we do NOT use
|
||||
* <bytesAllocated> to clear. */
|
||||
MEMSET(x, 0, sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL));
|
||||
if (bytesAllocated < (int) sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL))
|
||||
return;
|
||||
x->ChannelHeader.VersionId = ULTRA_VBUS_CHANNEL_PROTOCOL_VERSIONID;
|
||||
x->ChannelHeader.Signature = ULTRA_VBUS_CHANNEL_PROTOCOL_SIGNATURE;
|
||||
x->ChannelHeader.SrvState = CHANNELSRV_READY;
|
||||
x->ChannelHeader.HeaderSize = sizeof(x->ChannelHeader);
|
||||
x->ChannelHeader.Size = bytesAllocated;
|
||||
x->ChannelHeader.Type = UltraVbusChannelProtocolGuid;
|
||||
x->ChannelHeader.ZoneGuid = Guid0;
|
||||
x->HdrInfo.structBytes = sizeof(ULTRA_VBUS_HEADERINFO);
|
||||
x->HdrInfo.chpInfoByteOffset = sizeof(ULTRA_VBUS_HEADERINFO);
|
||||
x->HdrInfo.busInfoByteOffset = x->HdrInfo.chpInfoByteOffset
|
||||
+ sizeof(ULTRA_VBUS_DEVICEINFO);
|
||||
x->HdrInfo.devInfoByteOffset = x->HdrInfo.busInfoByteOffset
|
||||
+ sizeof(ULTRA_VBUS_DEVICEINFO);
|
||||
x->HdrInfo.deviceInfoStructBytes = sizeof(ULTRA_VBUS_DEVICEINFO);
|
||||
bytesAllocated -= (sizeof(ULTRA_CHANNEL_PROTOCOL)
|
||||
+ x->HdrInfo.devInfoByteOffset);
|
||||
x->HdrInfo.devInfoCount =
|
||||
bytesAllocated / x->HdrInfo.deviceInfoStructBytes;
|
||||
}
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,92 @@
|
||||
/* controlvmcompletionstatus.c
|
||||
*
|
||||
* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/* Defines for all valid values returned in the response message header
|
||||
* completionStatus field. See controlvmchannel.h for description of
|
||||
* the header: _CONTROLVM_MESSAGE_HEADER.
|
||||
*/
|
||||
|
||||
#ifndef __CONTROLVMCOMPLETIONSTATUS_H__
|
||||
#define __CONTROLVMCOMPLETIONSTATUS_H__
|
||||
|
||||
/* General Errors------------------------------------------------------[0-99] */
|
||||
#define CONTROLVM_RESP_SUCCESS 0
|
||||
#define CONTROLVM_RESP_ERROR_ALREADY_DONE 1
|
||||
#define CONTROLVM_RESP_ERROR_IOREMAP_FAILED 2
|
||||
#define CONTROLVM_RESP_ERROR_KMALLOC_FAILED 3
|
||||
#define CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN 4
|
||||
#define CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT 5
|
||||
|
||||
/* CONTROLVM_INIT_CHIPSET-------------------------------------------[100-199] */
|
||||
#define CONTROLVM_RESP_ERROR_CLIENT_SWITCHCOUNT_NONZERO 100
|
||||
#define CONTROLVM_RESP_ERROR_EXPECTED_CHIPSET_INIT 101
|
||||
|
||||
/* Maximum Limit----------------------------------------------------[200-299] */
|
||||
#define CONTROLVM_RESP_ERROR_MAX_BUSES 201 /* BUS_CREATE */
|
||||
#define CONTROLVM_RESP_ERROR_MAX_DEVICES 202 /* DEVICE_CREATE */
|
||||
/* Payload and Parameter Related------------------------------------[400-499] */
|
||||
#define CONTROLVM_RESP_ERROR_PAYLOAD_INVALID 400 /* SWITCH_ATTACHEXTPORT,
|
||||
* DEVICE_CONFIGURE */
|
||||
#define CONTROLVM_RESP_ERROR_INITIATOR_PARAMETER_INVALID 401 /* Multiple */
|
||||
#define CONTROLVM_RESP_ERROR_TARGET_PARAMETER_INVALID 402 /* DEVICE_CONFIGURE */
|
||||
#define CONTROLVM_RESP_ERROR_CLIENT_PARAMETER_INVALID 403 /* DEVICE_CONFIGURE */
|
||||
/* Specified[Packet Structure] Value-------------------------------[500-599] */
|
||||
#define CONTROLVM_RESP_ERROR_BUS_INVALID 500 /* SWITCH_ATTACHINTPORT,
|
||||
* BUS_CONFIGURE,
|
||||
* DEVICE_CREATE,
|
||||
* DEVICE_CONFIG
|
||||
* DEVICE_DESTROY */
|
||||
#define CONTROLVM_RESP_ERROR_DEVICE_INVALID 501 /* SWITCH_ATTACHINTPORT */
|
||||
/* DEVICE_CREATE,
|
||||
* DEVICE_CONFIGURE,
|
||||
* DEVICE_DESTROY */
|
||||
#define CONTROLVM_RESP_ERROR_CHANNEL_INVALID 502 /* DEVICE_CREATE,
|
||||
* DEVICE_CONFIGURE */
|
||||
/* Partition Driver Callback Interface----------------------[600-699] */
|
||||
#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE 604 /* BUS_CREATE,
|
||||
* BUS_DESTROY,
|
||||
* DEVICE_CREATE,
|
||||
* DEVICE_DESTROY */
|
||||
/* Unable to invoke VIRTPCI callback */
|
||||
#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR 605 /* BUS_CREATE,
|
||||
* BUS_DESTROY,
|
||||
* DEVICE_CREATE,
|
||||
* DEVICE_DESTROY */
|
||||
/* VIRTPCI Callback returned error */
|
||||
#define CONTROLVM_RESP_ERROR_GENERIC_DRIVER_CALLBACK_ERROR 606 /* SWITCH_ATTACHEXTPORT,
|
||||
* SWITCH_DETACHEXTPORT
|
||||
* DEVICE_CONFIGURE */
|
||||
|
||||
/* generic device callback returned error */
|
||||
/* Bus Related------------------------------------------------------[700-799] */
|
||||
#define CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED 700 /* BUS_DESTROY */
|
||||
/* Channel Related--------------------------------------------------[800-899] */
|
||||
#define CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN 800 /* GET_CHANNELINFO,
|
||||
* DEVICE_DESTROY */
|
||||
#define CONTROLVM_RESP_ERROR_CHANNEL_SIZE_TOO_SMALL 801 /* DEVICE_CREATE */
|
||||
/* Chipset Shutdown Related---------------------------------------[1000-1099] */
|
||||
#define CONTROLVM_RESP_ERROR_CHIPSET_SHUTDOWN_FAILED 1000
|
||||
#define CONTROLVM_RESP_ERROR_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001
|
||||
|
||||
/* Chipset Stop Related-------------------------------------------[1100-1199] */
|
||||
#define CONTROLVM_RESP_ERROR_CHIPSET_STOP_FAILED_BUS 1100
|
||||
#define CONTROLVM_RESP_ERROR_CHIPSET_STOP_FAILED_SWITCH 1101
|
||||
|
||||
/* Device Related-------------------------------------------------[1400-1499] */
|
||||
#define CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT 1400
|
||||
|
||||
#endif /* __CONTROLVMCOMPLETIONSTATUS_H__ not defined */
|
||||
@@ -0,0 +1,310 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/* Please note that this file is to be used ONLY for defining diagnostic
|
||||
* subsystem values for the appos (sPAR Linux service partitions) component.
|
||||
*/
|
||||
#ifndef __APPOS_SUBSYSTEMS_H__
|
||||
#define __APPOS_SUBSYSTEMS_H__
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
static inline char *
|
||||
subsys_unknown_to_s(int subsys, char *s, int n)
|
||||
{
|
||||
snprintf(s, n, "SUBSYS-%-2.2d", subsys);
|
||||
s[n - 1] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
#define SUBSYS_TO_MASK(subsys) (1ULL << (subsys))
|
||||
|
||||
/* The first SUBSYS_APPOS_MAX subsystems are the same for each AppOS type
|
||||
* (IOVM, SMS, etc.) The rest have unique values for each AppOS type.
|
||||
*/
|
||||
#define SUBSYS_APPOS_MAX 16
|
||||
|
||||
#define SUBSYS_APPOS_DEFAULT 1 /* or "other" */
|
||||
#define SUBSYS_APPOS_CHIPSET 2 /* controlvm and other */
|
||||
/* low-level sPAR activity */
|
||||
#define SUBSYS_APPOS_BUS 3 /* sPAR bus */
|
||||
/* DAK #define SUBSYS_APPOS_DIAG 4 // diagnostics and dump */
|
||||
#define SUBSYS_APPOS_CHANNELACCESS 5 /* generic channel access */
|
||||
#define SUBSYS_APPOS_NICCLIENT 6 /* virtual NIC client */
|
||||
#define SUBSYS_APPOS_HBACLIENT 7 /* virtual HBA client */
|
||||
#define SUBSYS_APPOS_CONSOLESERIAL 8 /* sPAR virtual serial console */
|
||||
#define SUBSYS_APPOS_UISLIB 9 /* */
|
||||
#define SUBSYS_APPOS_VRTCUPDD 10 /* */
|
||||
#define SUBSYS_APPOS_WATCHDOG 11 /* watchdog timer and healthcheck */
|
||||
#define SUBSYS_APPOS_13 13 /* available */
|
||||
#define SUBSYS_APPOS_14 14 /* available */
|
||||
#define SUBSYS_APPOS_15 15 /* available */
|
||||
#define SUBSYS_APPOS_16 16 /* available */
|
||||
static inline char *
|
||||
subsys_generic_to_s(int subsys, char *s, int n)
|
||||
{
|
||||
switch (subsys) {
|
||||
case SUBSYS_APPOS_DEFAULT:
|
||||
strncpy(s, "APPOS_DEFAULT", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_CHIPSET:
|
||||
strncpy(s, "APPOS_CHIPSET", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_BUS:
|
||||
strncpy(s, "APPOS_BUS", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_CHANNELACCESS:
|
||||
strncpy(s, "APPOS_CHANNELACCESS", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_NICCLIENT:
|
||||
strncpy(s, "APPOS_NICCLIENT", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_HBACLIENT:
|
||||
strncpy(s, "APPOS_HBACLIENT", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_CONSOLESERIAL:
|
||||
strncpy(s, "APPOS_CONSOLESERIAL", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_UISLIB:
|
||||
strncpy(s, "APPOS_UISLIB", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_VRTCUPDD:
|
||||
strncpy(s, "APPOS_VRTCUPDD", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_WATCHDOG:
|
||||
strncpy(s, "APPOS_WATCHDOG", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_13:
|
||||
strncpy(s, "APPOS_13", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_14:
|
||||
strncpy(s, "APPOS_14", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_15:
|
||||
strncpy(s, "APPOS_15", n);
|
||||
break;
|
||||
case SUBSYS_APPOS_16:
|
||||
strncpy(s, "APPOS_16", n);
|
||||
break;
|
||||
default:
|
||||
subsys_unknown_to_s(subsys, s, n);
|
||||
break;
|
||||
}
|
||||
s[n - 1] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
/* CONSOLE */
|
||||
|
||||
#define SUBSYS_CONSOLE_VIDEO (SUBSYS_APPOS_MAX + 1) /* 17 */
|
||||
#define SUBSYS_CONSOLE_KBDMOU (SUBSYS_APPOS_MAX + 2) /* 18 */
|
||||
#define SUBSYS_CONSOLE_04 (SUBSYS_APPOS_MAX + 4)
|
||||
#define SUBSYS_CONSOLE_05 (SUBSYS_APPOS_MAX + 5)
|
||||
#define SUBSYS_CONSOLE_06 (SUBSYS_APPOS_MAX + 6)
|
||||
#define SUBSYS_CONSOLE_07 (SUBSYS_APPOS_MAX + 7)
|
||||
#define SUBSYS_CONSOLE_08 (SUBSYS_APPOS_MAX + 8)
|
||||
#define SUBSYS_CONSOLE_09 (SUBSYS_APPOS_MAX + 9)
|
||||
#define SUBSYS_CONSOLE_10 (SUBSYS_APPOS_MAX + 10)
|
||||
#define SUBSYS_CONSOLE_11 (SUBSYS_APPOS_MAX + 11)
|
||||
#define SUBSYS_CONSOLE_12 (SUBSYS_APPOS_MAX + 12)
|
||||
#define SUBSYS_CONSOLE_13 (SUBSYS_APPOS_MAX + 13)
|
||||
#define SUBSYS_CONSOLE_14 (SUBSYS_APPOS_MAX + 14)
|
||||
#define SUBSYS_CONSOLE_15 (SUBSYS_APPOS_MAX + 15)
|
||||
#define SUBSYS_CONSOLE_16 (SUBSYS_APPOS_MAX + 16)
|
||||
#define SUBSYS_CONSOLE_17 (SUBSYS_APPOS_MAX + 17)
|
||||
#define SUBSYS_CONSOLE_18 (SUBSYS_APPOS_MAX + 18)
|
||||
#define SUBSYS_CONSOLE_19 (SUBSYS_APPOS_MAX + 19)
|
||||
#define SUBSYS_CONSOLE_20 (SUBSYS_APPOS_MAX + 20)
|
||||
#define SUBSYS_CONSOLE_21 (SUBSYS_APPOS_MAX + 21)
|
||||
#define SUBSYS_CONSOLE_22 (SUBSYS_APPOS_MAX + 22)
|
||||
#define SUBSYS_CONSOLE_23 (SUBSYS_APPOS_MAX + 23)
|
||||
#define SUBSYS_CONSOLE_24 (SUBSYS_APPOS_MAX + 24)
|
||||
#define SUBSYS_CONSOLE_25 (SUBSYS_APPOS_MAX + 25)
|
||||
#define SUBSYS_CONSOLE_26 (SUBSYS_APPOS_MAX + 26)
|
||||
#define SUBSYS_CONSOLE_27 (SUBSYS_APPOS_MAX + 27)
|
||||
#define SUBSYS_CONSOLE_28 (SUBSYS_APPOS_MAX + 28)
|
||||
#define SUBSYS_CONSOLE_29 (SUBSYS_APPOS_MAX + 29)
|
||||
#define SUBSYS_CONSOLE_30 (SUBSYS_APPOS_MAX + 30)
|
||||
#define SUBSYS_CONSOLE_31 (SUBSYS_APPOS_MAX + 31)
|
||||
#define SUBSYS_CONSOLE_32 (SUBSYS_APPOS_MAX + 32)
|
||||
#define SUBSYS_CONSOLE_33 (SUBSYS_APPOS_MAX + 33)
|
||||
#define SUBSYS_CONSOLE_34 (SUBSYS_APPOS_MAX + 34)
|
||||
#define SUBSYS_CONSOLE_35 (SUBSYS_APPOS_MAX + 35)
|
||||
#define SUBSYS_CONSOLE_36 (SUBSYS_APPOS_MAX + 36)
|
||||
#define SUBSYS_CONSOLE_37 (SUBSYS_APPOS_MAX + 37)
|
||||
#define SUBSYS_CONSOLE_38 (SUBSYS_APPOS_MAX + 38)
|
||||
#define SUBSYS_CONSOLE_39 (SUBSYS_APPOS_MAX + 39)
|
||||
#define SUBSYS_CONSOLE_40 (SUBSYS_APPOS_MAX + 40)
|
||||
#define SUBSYS_CONSOLE_41 (SUBSYS_APPOS_MAX + 41)
|
||||
#define SUBSYS_CONSOLE_42 (SUBSYS_APPOS_MAX + 42)
|
||||
#define SUBSYS_CONSOLE_43 (SUBSYS_APPOS_MAX + 43)
|
||||
#define SUBSYS_CONSOLE_44 (SUBSYS_APPOS_MAX + 44)
|
||||
#define SUBSYS_CONSOLE_45 (SUBSYS_APPOS_MAX + 45)
|
||||
#define SUBSYS_CONSOLE_46 (SUBSYS_APPOS_MAX + 46)
|
||||
|
||||
static inline char *
|
||||
subsys_console_to_s(int subsys, char *s, int n)
|
||||
{
|
||||
switch (subsys) {
|
||||
case SUBSYS_CONSOLE_VIDEO:
|
||||
strncpy(s, "CONSOLE_VIDEO", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_KBDMOU:
|
||||
strncpy(s, "CONSOLE_KBDMOU", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_04:
|
||||
strncpy(s, "CONSOLE_04", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_05:
|
||||
strncpy(s, "CONSOLE_05", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_06:
|
||||
strncpy(s, "CONSOLE_06", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_07:
|
||||
strncpy(s, "CONSOLE_07", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_08:
|
||||
strncpy(s, "CONSOLE_08", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_09:
|
||||
strncpy(s, "CONSOLE_09", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_10:
|
||||
strncpy(s, "CONSOLE_10", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_11:
|
||||
strncpy(s, "CONSOLE_11", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_12:
|
||||
strncpy(s, "CONSOLE_12", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_13:
|
||||
strncpy(s, "CONSOLE_13", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_14:
|
||||
strncpy(s, "CONSOLE_14", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_15:
|
||||
strncpy(s, "CONSOLE_15", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_16:
|
||||
strncpy(s, "CONSOLE_16", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_17:
|
||||
strncpy(s, "CONSOLE_17", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_18:
|
||||
strncpy(s, "CONSOLE_18", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_19:
|
||||
strncpy(s, "CONSOLE_19", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_20:
|
||||
strncpy(s, "CONSOLE_20", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_21:
|
||||
strncpy(s, "CONSOLE_21", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_22:
|
||||
strncpy(s, "CONSOLE_22", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_23:
|
||||
strncpy(s, "CONSOLE_23", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_24:
|
||||
strncpy(s, "CONSOLE_24", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_25:
|
||||
strncpy(s, "CONSOLE_25", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_26:
|
||||
strncpy(s, "CONSOLE_26", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_27:
|
||||
strncpy(s, "CONSOLE_27", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_28:
|
||||
strncpy(s, "CONSOLE_28", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_29:
|
||||
strncpy(s, "CONSOLE_29", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_30:
|
||||
strncpy(s, "CONSOLE_30", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_31:
|
||||
strncpy(s, "CONSOLE_31", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_32:
|
||||
strncpy(s, "CONSOLE_32", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_33:
|
||||
strncpy(s, "CONSOLE_33", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_34:
|
||||
strncpy(s, "CONSOLE_34", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_35:
|
||||
strncpy(s, "CONSOLE_35", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_36:
|
||||
strncpy(s, "CONSOLE_36", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_37:
|
||||
strncpy(s, "CONSOLE_37", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_38:
|
||||
strncpy(s, "CONSOLE_38", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_39:
|
||||
strncpy(s, "CONSOLE_39", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_40:
|
||||
strncpy(s, "CONSOLE_40", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_41:
|
||||
strncpy(s, "CONSOLE_41", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_42:
|
||||
strncpy(s, "CONSOLE_42", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_43:
|
||||
strncpy(s, "CONSOLE_43", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_44:
|
||||
strncpy(s, "CONSOLE_44", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_45:
|
||||
strncpy(s, "CONSOLE_45", n);
|
||||
break;
|
||||
case SUBSYS_CONSOLE_46:
|
||||
strncpy(s, "CONSOLE_46", n);
|
||||
break;
|
||||
default:
|
||||
subsys_unknown_to_s(subsys, s, n);
|
||||
break;
|
||||
}
|
||||
s[n - 1] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
#endif
|
||||
53
drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
Normal file
53
drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/* Linux GCC Version (32-bit and 64-bit) */
|
||||
static inline unsigned long
|
||||
__unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
|
||||
unsigned long reg_ecx)
|
||||
{
|
||||
unsigned long result = 0;
|
||||
|
||||
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
|
||||
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
|
||||
if (cpuid_ecx & 0x80000000) {
|
||||
__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
|
||||
"a"(tuple), "b"(reg_ebx), "c"(reg_ecx)
|
||||
);
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__unisys_extended_vmcall_gnuc(unsigned long long tuple,
|
||||
unsigned long long reg_ebx,
|
||||
unsigned long long reg_ecx,
|
||||
unsigned long long reg_edx)
|
||||
{
|
||||
unsigned long result = 0;
|
||||
|
||||
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
|
||||
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
|
||||
if (cpuid_ecx & 0x80000000) {
|
||||
__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
|
||||
"a"(tuple), "b"(reg_ebx), "c"(reg_ecx),
|
||||
"d"(reg_edx));
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
209
drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
Normal file
209
drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
Normal file
@@ -0,0 +1,209 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#ifndef __VBUSDEVICEINFO_H__
|
||||
#define __VBUSDEVICEINFO_H__
|
||||
|
||||
#include "commontypes.h"
|
||||
|
||||
#pragma pack(push, 1) /* both GCC and VC now allow this pragma */
|
||||
|
||||
/* An array of this struct is present in the channel area for each vbus.
|
||||
* (See vbuschannel.h.)
|
||||
* It is filled in by the client side to provide info about the device
|
||||
* and driver from the client's perspective.
|
||||
*/
|
||||
typedef struct _ULTRA_VBUS_DEVICEINFO {
|
||||
U8 devType[16]; /* short string identifying the device type */
|
||||
U8 drvName[16]; /* driver .sys file name */
|
||||
U8 infoStrings[96]; /* sequence of tab-delimited id strings: */
|
||||
/* <DRIVER_REV> <DRIVER_VERTAG> <DRIVER_COMPILETIME> */
|
||||
U8 reserved[128]; /* pad size to 256 bytes */
|
||||
} ULTRA_VBUS_DEVICEINFO;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
/* Reads chars from the buffer at <src> for <srcmax> bytes, and writes to
|
||||
* the buffer at <p>, which is <remain> bytes long, ensuring never to
|
||||
* overflow the buffer at <p>, using the following rules:
|
||||
* - printable characters are simply copied from the buffer at <src> to the
|
||||
* buffer at <p>
|
||||
* - intervening streaks of non-printable characters in the buffer at <src>
|
||||
* are replaced with a single space in the buffer at <p>
|
||||
* Note that we pay no attention to '\0'-termination.
|
||||
* Returns the number of bytes written to <p>.
|
||||
*
|
||||
* Pass <p> == NULL and <remain> == 0 for this special behavior. In this
|
||||
* case, we simply return the number of bytes that WOULD HAVE been written
|
||||
* to a buffer at <p>, had it been infinitely big.
|
||||
*/
|
||||
static inline int
|
||||
VBUSCHANNEL_sanitize_buffer(char *p, int remain, char *src, int srcmax)
|
||||
{
|
||||
int chars = 0;
|
||||
int nonprintable_streak = 0;
|
||||
while (srcmax > 0) {
|
||||
if ((*src >= ' ') && (*src < 0x7f)) {
|
||||
if (nonprintable_streak) {
|
||||
if (remain > 0) {
|
||||
*p = ' ';
|
||||
p++;
|
||||
remain--;
|
||||
chars++;
|
||||
} else if (p == NULL)
|
||||
chars++;
|
||||
nonprintable_streak = 0;
|
||||
}
|
||||
if (remain > 0) {
|
||||
*p = *src;
|
||||
p++;
|
||||
remain--;
|
||||
chars++;
|
||||
} else if (p == NULL)
|
||||
chars++;
|
||||
} else
|
||||
nonprintable_streak = 1;
|
||||
src++;
|
||||
srcmax--;
|
||||
}
|
||||
return chars;
|
||||
}
|
||||
|
||||
#define VBUSCHANNEL_ADDACHAR(ch, p, remain, chars) \
|
||||
do { \
|
||||
if (remain <= 0) \
|
||||
break; \
|
||||
*p = ch; \
|
||||
p++; chars++; remain--; \
|
||||
} while (0)
|
||||
|
||||
/* Converts the non-negative value at <num> to an ascii decimal string
|
||||
* at <p>, writing at most <remain> bytes. Note there is NO '\0' termination
|
||||
* written to <p>.
|
||||
*
|
||||
* Returns the number of bytes written to <p>.
|
||||
*
|
||||
* Note that we create this function because we need to do this operation in
|
||||
* an environment-independent way (since we are in a common header file).
|
||||
*/
|
||||
static inline int
|
||||
VBUSCHANNEL_itoa(char *p, int remain, int num)
|
||||
{
|
||||
int digits = 0;
|
||||
char s[32];
|
||||
int i;
|
||||
|
||||
if (num == 0) {
|
||||
/* '0' is a special case */
|
||||
if (remain <= 0)
|
||||
return 0;
|
||||
*p = '0';
|
||||
return 1;
|
||||
}
|
||||
/* form a backwards decimal ascii string in <s> */
|
||||
while (num > 0) {
|
||||
if (digits >= (int) sizeof(s))
|
||||
return 0;
|
||||
s[digits++] = (num % 10) + '0';
|
||||
num = num / 10;
|
||||
}
|
||||
if (remain < digits) {
|
||||
/* not enough room left at <p> to hold number, so fill with
|
||||
* '?' */
|
||||
for (i = 0; i < remain; i++, p++)
|
||||
*p = '?';
|
||||
return remain;
|
||||
}
|
||||
/* plug in the decimal ascii string representing the number, by */
|
||||
/* reversing the string we just built in <s> */
|
||||
i = digits;
|
||||
while (i > 0) {
|
||||
i--;
|
||||
*p = s[i];
|
||||
p++;
|
||||
}
|
||||
return digits;
|
||||
}
|
||||
|
||||
/* Reads <devInfo>, and converts its contents to a printable string at <p>,
|
||||
* writing at most <remain> bytes. Note there is NO '\0' termination
|
||||
* written to <p>.
|
||||
*
|
||||
* Pass <devix> >= 0 if you want a device index presented.
|
||||
*
|
||||
* Returns the number of bytes written to <p>.
|
||||
*/
|
||||
static inline int
|
||||
VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO devInfo,
|
||||
char *p, int remain, int devix)
|
||||
{
|
||||
char *psrc;
|
||||
int nsrc, x, i, pad;
|
||||
int chars = 0;
|
||||
|
||||
psrc = &(devInfo.devType[0]);
|
||||
nsrc = sizeof(devInfo.devType);
|
||||
if (VBUSCHANNEL_sanitize_buffer(NULL, 0, psrc, nsrc) <= 0)
|
||||
return 0;
|
||||
|
||||
/* emit device index */
|
||||
if (devix >= 0) {
|
||||
VBUSCHANNEL_ADDACHAR('[', p, remain, chars);
|
||||
x = VBUSCHANNEL_itoa(p, remain, devix);
|
||||
p += x;
|
||||
remain -= x;
|
||||
chars += x;
|
||||
VBUSCHANNEL_ADDACHAR(']', p, remain, chars);
|
||||
} else {
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
}
|
||||
|
||||
/* emit device type */
|
||||
x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
|
||||
p += x;
|
||||
remain -= x;
|
||||
chars += x;
|
||||
pad = 15 - x; /* pad device type to be exactly 15 chars */
|
||||
for (i = 0; i < pad; i++)
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
|
||||
/* emit driver name */
|
||||
psrc = &(devInfo.drvName[0]);
|
||||
nsrc = sizeof(devInfo.drvName);
|
||||
x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
|
||||
p += x;
|
||||
remain -= x;
|
||||
chars += x;
|
||||
pad = 15 - x; /* pad driver name to be exactly 15 chars */
|
||||
for (i = 0; i < pad; i++)
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
|
||||
|
||||
/* emit strings */
|
||||
psrc = &(devInfo.infoStrings[0]);
|
||||
nsrc = sizeof(devInfo.infoStrings);
|
||||
x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
|
||||
p += x;
|
||||
remain -= x;
|
||||
chars += x;
|
||||
VBUSCHANNEL_ADDACHAR('\n', p, remain, chars);
|
||||
|
||||
return chars;
|
||||
}
|
||||
|
||||
#endif
|
||||
167
drivers/staging/unisys/common-spar/include/vmcallinterface.h
Normal file
167
drivers/staging/unisys/common-spar/include/vmcallinterface.h
Normal file
@@ -0,0 +1,167 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#ifndef __IOMONINTF_H__
|
||||
#define __IOMONINTF_H__
|
||||
|
||||
/*
|
||||
* This file contains all structures needed to support the VMCALLs for IO
|
||||
* Virtualization. The VMCALLs are provided by Monitor and used by IO code
|
||||
* running on IO Partitions.
|
||||
*/
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include "iovmcall_gnuc.h"
|
||||
#endif /* */
|
||||
#include "diagchannel.h"
|
||||
|
||||
#ifdef VMCALL_IO_CONTROLVM_ADDR
|
||||
#undef VMCALL_IO_CONTROLVM_ADDR
|
||||
#endif /* */
|
||||
|
||||
/* define subsystem number for AppOS, used in uislib driver */
|
||||
#define MDS_APPOS 0x4000000000000000 /* subsystem = 62 - AppOS */
|
||||
typedef enum { /* VMCALL identification tuples */
|
||||
/* Note: when a new VMCALL is added:
|
||||
* - the 1st 2 hex digits correspond to one of the
|
||||
* VMCALL_MONITOR_INTERFACE types and
|
||||
* - the next 2 hex digits are the nth relative instance of within a
|
||||
* type
|
||||
* E.G. for VMCALL_VIRTPART_RECYCLE_PART,
|
||||
* - the 0x02 identifies it as a VMCALL_VIRTPART type and
|
||||
* - the 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART
|
||||
* type of VMCALL
|
||||
*/
|
||||
|
||||
VMCALL_IO_CONTROLVM_ADDR = 0x0501, /* used by all Guests, not just
|
||||
* IO */
|
||||
VMCALL_IO_DIAG_ADDR = 0x0508,
|
||||
VMCALL_IO_VISORSERIAL_ADDR = 0x0509,
|
||||
VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET = 0x0708, /* Allow caller to
|
||||
* query virtual time
|
||||
* offset */
|
||||
VMCALL_CHANNEL_VERSION_MISMATCH = 0x0709,
|
||||
VMCALL_POST_CODE_LOGEVENT = 0x070B, /* LOGEVENT Post Code (RDX) with
|
||||
* specified subsystem mask (RCX
|
||||
* - monitor_subsystems.h) and
|
||||
* severity (RDX) */
|
||||
VMCALL_GENERIC_SURRENDER_QUANTUM_FOREVER = 0x0802, /* Yield the
|
||||
* remainder & all
|
||||
* future quantums of
|
||||
* the caller */
|
||||
VMCALL_MEASUREMENT_DO_NOTHING = 0x0901,
|
||||
VMCALL_UPDATE_PHYSICAL_TIME = 0x0a02 /* Allow
|
||||
* ULTRA_SERVICE_CAPABILITY_TIME
|
||||
* capable guest to make
|
||||
* VMCALL */
|
||||
} VMCALL_MONITOR_INTERFACE_METHOD_TUPLE;
|
||||
|
||||
#define VMCALL_SUCCESS 0
|
||||
#define VMCALL_SUCCESSFUL(result) (result == 0)
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define unisys_vmcall(tuple, reg_ebx, reg_ecx) \
|
||||
__unisys_vmcall_gnuc(tuple, reg_ebx, reg_ecx)
|
||||
#define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \
|
||||
__unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx)
|
||||
#define ISSUE_IO_VMCALL(InterfaceMethod, param, result) \
|
||||
(result = unisys_vmcall(InterfaceMethod, (param) & 0xFFFFFFFF, \
|
||||
(param) >> 32))
|
||||
#define ISSUE_IO_EXTENDED_VMCALL(InterfaceMethod, param1, param2, \
|
||||
param3, result) \
|
||||
(result = unisys_extended_vmcall(InterfaceMethod, param1, \
|
||||
param2, param3))
|
||||
|
||||
/* The following uses VMCALL_POST_CODE_LOGEVENT interface but is currently
|
||||
* not used much */
|
||||
#define ISSUE_IO_VMCALL_POSTCODE_SEVERITY(postcode, severity) \
|
||||
do { \
|
||||
U32 _tempresult = VMCALL_SUCCESS; \
|
||||
ISSUE_IO_EXTENDED_VMCALL(VMCALL_POST_CODE_LOGEVENT, severity, \
|
||||
MDS_APPOS, postcode, _tempresult); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* Structures for IO VMCALLs */
|
||||
|
||||
/* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
|
||||
/* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
|
||||
#pragma pack(push, 1)
|
||||
struct phys_info {
|
||||
U64 pi_pfn;
|
||||
U16 pi_off;
|
||||
U16 pi_len;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
/* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
|
||||
typedef struct phys_info IO_DATA_STRUCTURE;
|
||||
|
||||
/* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
|
||||
/* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
|
||||
#pragma pack(push, 1)
|
||||
/* Parameters to VMCALL_IO_CONTROLVM_ADDR interface */
|
||||
typedef struct _VMCALL_IO_CONTROLVM_ADDR_PARAMS {
|
||||
/* The Guest-relative physical address of the ControlVm channel.
|
||||
* This VMCall fills this in with the appropriate address. */
|
||||
U64 ChannelAddress; /* contents provided by this VMCALL (OUT) */
|
||||
/* the size of the ControlVm channel in bytes This VMCall fills this
|
||||
* in with the appropriate address. */
|
||||
U32 ChannelBytes; /* contents provided by this VMCALL (OUT) */
|
||||
U8 Unused[4]; /* Unused Bytes in the 64-Bit Aligned Struct */
|
||||
} VMCALL_IO_CONTROLVM_ADDR_PARAMS;
|
||||
|
||||
#pragma pack(pop)
|
||||
/* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
|
||||
|
||||
/* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
|
||||
/* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
|
||||
#pragma pack(push, 1)
|
||||
/* Parameters to VMCALL_IO_DIAG_ADDR interface */
|
||||
typedef struct _VMCALL_IO_DIAG_ADDR_PARAMS {
|
||||
/* The Guest-relative physical address of the diagnostic channel.
|
||||
* This VMCall fills this in with the appropriate address. */
|
||||
U64 ChannelAddress; /* contents provided by this VMCALL (OUT) */
|
||||
} VMCALL_IO_DIAG_ADDR_PARAMS;
|
||||
|
||||
#pragma pack(pop)
|
||||
/* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
|
||||
|
||||
/* ///////////// BEGIN PRAGMA PACK PUSH 1 ///////////////////////// */
|
||||
/* ///////////// ONLY STRUCT TYPE SHOULD BE BELOW */
|
||||
#pragma pack(push, 1)
|
||||
/* Parameters to VMCALL_IO_VISORSERIAL_ADDR interface */
|
||||
typedef struct _VMCALL_IO_VISORSERIAL_ADDR_PARAMS {
|
||||
/* The Guest-relative physical address of the serial console
|
||||
* channel. This VMCall fills this in with the appropriate
|
||||
* address. */
|
||||
U64 ChannelAddress; /* contents provided by this VMCALL (OUT) */
|
||||
} VMCALL_IO_VISORSERIAL_ADDR_PARAMS;
|
||||
|
||||
#pragma pack(pop)
|
||||
/* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
|
||||
|
||||
/* Parameters to VMCALL_CHANNEL_MISMATCH interface */
|
||||
typedef struct _VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS {
|
||||
U8 ChannelName[32]; /* Null terminated string giving name of channel
|
||||
* (IN) */
|
||||
U8 ItemName[32]; /* Null terminated string giving name of
|
||||
* mismatched item (IN) */
|
||||
U32 SourceLineNumber; /* line# where invoked. (IN) */
|
||||
U8 SourceFileName[36]; /* source code where invoked - Null terminated
|
||||
* string (IN) */
|
||||
} VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS;
|
||||
|
||||
#endif /* __IOMONINTF_H__ */
|
||||
182
drivers/staging/unisys/include/guestlinuxdebug.h
Normal file
182
drivers/staging/unisys/include/guestlinuxdebug.h
Normal file
@@ -0,0 +1,182 @@
|
||||
/* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#ifndef __GUESTLINUXDEBUG_H__
|
||||
#define __GUESTLINUXDEBUG_H__
|
||||
|
||||
/*
|
||||
* This file contains supporting interface for "vmcallinterface.h", particuarly
|
||||
* regarding adding additional structure and functionality to linux
|
||||
* ISSUE_IO_VMCALL_POSTCODE_SEVERITY */
|
||||
|
||||
|
||||
/******* INFO ON ISSUE_POSTCODE_LINUX() BELOW *******/
|
||||
#include "vmcallinterface.h"
|
||||
typedef enum { /* POSTCODE driver identifier tuples */
|
||||
/* visorchipset driver files */
|
||||
VISOR_CHIPSET_PC = 0xA0,
|
||||
VISOR_CHIPSET_PC_controlvm_c = 0xA1,
|
||||
VISOR_CHIPSET_PC_controlvm_cm2 = 0xA2,
|
||||
VISOR_CHIPSET_PC_controlvm_direct_c = 0xA3,
|
||||
VISOR_CHIPSET_PC_file_c = 0xA4,
|
||||
VISOR_CHIPSET_PC_parser_c = 0xA5,
|
||||
VISOR_CHIPSET_PC_testing_c = 0xA6,
|
||||
VISOR_CHIPSET_PC_visorchipset_main_c = 0xA7,
|
||||
VISOR_CHIPSET_PC_visorswitchbus_c = 0xA8,
|
||||
/* visorbus driver files */
|
||||
VISOR_BUS_PC = 0xB0,
|
||||
VISOR_BUS_PC_businst_attr_c = 0xB1,
|
||||
VISOR_BUS_PC_channel_attr_c = 0xB2,
|
||||
VISOR_BUS_PC_devmajorminor_attr_c = 0xB3,
|
||||
VISOR_BUS_PC_visorbus_main_c = 0xB4,
|
||||
/* visorclientbus driver files */
|
||||
VISOR_CLIENT_BUS_PC = 0xC0,
|
||||
VISOR_CLIENT_BUS_PC_visorclientbus_main_c = 0xC1,
|
||||
/* virt hba driver files */
|
||||
VIRT_HBA_PC = 0xC2,
|
||||
VIRT_HBA_PC_virthba_c = 0xC3,
|
||||
/* virtpci driver files */
|
||||
VIRT_PCI_PC = 0xC4,
|
||||
VIRT_PCI_PC_virtpci_c = 0xC5,
|
||||
/* virtnic driver files */
|
||||
VIRT_NIC_PC = 0xC6,
|
||||
VIRT_NIC_P_virtnic_c = 0xC7,
|
||||
/* uislib driver files */
|
||||
UISLIB_PC = 0xD0,
|
||||
UISLIB_PC_uislib_c = 0xD1,
|
||||
UISLIB_PC_uisqueue_c = 0xD2,
|
||||
UISLIB_PC_uisthread_c = 0xD3,
|
||||
UISLIB_PC_uisutils_c = 0xD4,
|
||||
} DRIVER_PC;
|
||||
|
||||
typedef enum { /* POSTCODE event identifier tuples */
|
||||
ATTACH_PORT_ENTRY_PC = 0x001,
|
||||
ATTACH_PORT_FAILURE_PC = 0x002,
|
||||
ATTACH_PORT_SUCCESS_PC = 0x003,
|
||||
BUS_FAILURE_PC = 0x004,
|
||||
BUS_CREATE_ENTRY_PC = 0x005,
|
||||
BUS_CREATE_FAILURE_PC = 0x006,
|
||||
BUS_CREATE_EXIT_PC = 0x007,
|
||||
BUS_CONFIGURE_ENTRY_PC = 0x008,
|
||||
BUS_CONFIGURE_FAILURE_PC = 0x009,
|
||||
BUS_CONFIGURE_EXIT_PC = 0x00A,
|
||||
CHIPSET_INIT_ENTRY_PC = 0x00B,
|
||||
CHIPSET_INIT_SUCCESS_PC = 0x00C,
|
||||
CHIPSET_INIT_FAILURE_PC = 0x00D,
|
||||
CHIPSET_INIT_EXIT_PC = 0x00E,
|
||||
CREATE_WORKQUEUE_PC = 0x00F,
|
||||
CREATE_WORKQUEUE_FAILED_PC = 0x0A0,
|
||||
CONTROLVM_INIT_FAILURE_PC = 0x0A1,
|
||||
DEVICE_CREATE_ENTRY_PC = 0x0A2,
|
||||
DEVICE_CREATE_FAILURE_PC = 0x0A3,
|
||||
DEVICE_CREATE_SUCCESS_PC = 0x0A4,
|
||||
DEVICE_CREATE_EXIT_PC = 0x0A5,
|
||||
DEVICE_ADD_PC = 0x0A6,
|
||||
DEVICE_REGISTER_FAILURE_PC = 0x0A7,
|
||||
DEVICE_CHANGESTATE_ENTRY_PC = 0x0A8,
|
||||
DEVICE_CHANGESTATE_FAILURE_PC = 0x0A9,
|
||||
DEVICE_CHANGESTATE_EXIT_PC = 0x0AA,
|
||||
DRIVER_ENTRY_PC = 0x0AB,
|
||||
DRIVER_EXIT_PC = 0x0AC,
|
||||
MALLOC_FAILURE_PC = 0x0AD,
|
||||
QUEUE_DELAYED_WORK_PC = 0x0AE,
|
||||
UISLIB_THREAD_FAILURE_PC = 0x0B7,
|
||||
VBUS_CHANNEL_ENTRY_PC = 0x0B8,
|
||||
VBUS_CHANNEL_FAILURE_PC = 0x0B9,
|
||||
VBUS_CHANNEL_EXIT_PC = 0x0BA,
|
||||
VHBA_CREATE_ENTRY_PC = 0x0BB,
|
||||
VHBA_CREATE_FAILURE_PC = 0x0BC,
|
||||
VHBA_CREATE_EXIT_PC = 0x0BD,
|
||||
VHBA_CREATE_SUCCESS_PC = 0x0BE,
|
||||
VHBA_COMMAND_HANDLER_PC = 0x0BF,
|
||||
VHBA_PROBE_ENTRY_PC = 0x0C0,
|
||||
VHBA_PROBE_FAILURE_PC = 0x0C1,
|
||||
VHBA_PROBE_EXIT_PC = 0x0C2,
|
||||
VNIC_CREATE_ENTRY_PC = 0x0C3,
|
||||
VNIC_CREATE_FAILURE_PC = 0x0C4,
|
||||
VNIC_CREATE_SUCCESS_PC = 0x0C5,
|
||||
VNIC_PROBE_ENTRY_PC = 0x0C6,
|
||||
VNIC_PROBE_FAILURE_PC = 0x0C7,
|
||||
VNIC_PROBE_EXIT_PC = 0x0C8,
|
||||
VPCI_CREATE_ENTRY_PC = 0x0C9,
|
||||
VPCI_CREATE_FAILURE_PC = 0x0CA,
|
||||
VPCI_CREATE_EXIT_PC = 0x0CB,
|
||||
VPCI_PROBE_ENTRY_PC = 0x0CC,
|
||||
VPCI_PROBE_FAILURE_PC = 0x0CD,
|
||||
VPCI_PROBE_EXIT_PC = 0x0CE,
|
||||
CRASH_DEV_ENTRY_PC = 0x0CF,
|
||||
CRASH_DEV_EXIT_PC = 0x0D0,
|
||||
CRASH_DEV_HADDR_NULL = 0x0D1,
|
||||
CRASH_DEV_CONTROLVM_NULL = 0x0D2,
|
||||
CRASH_DEV_RD_BUS_FAIULRE_PC = 0x0D3,
|
||||
CRASH_DEV_RD_DEV_FAIULRE_PC = 0x0D4,
|
||||
CRASH_DEV_BUS_NULL_FAILURE_PC = 0x0D5,
|
||||
CRASH_DEV_DEV_NULL_FAILURE_PC = 0x0D6,
|
||||
CRASH_DEV_CTRL_RD_FAILURE_PC = 0x0D7,
|
||||
CRASH_DEV_COUNT_FAILURE_PC = 0x0D8,
|
||||
SAVE_MSG_BUS_FAILURE_PC = 0x0D9,
|
||||
SAVE_MSG_DEV_FAILURE_PC = 0x0DA,
|
||||
CALLHOME_INIT_FAILURE_PC = 0x0DB
|
||||
} EVENT_PC;
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define POSTCODE_SEVERITY_ERR DIAG_SEVERITY_ERR
|
||||
#define POSTCODE_SEVERITY_WARNING DIAG_SEVERITY_WARNING
|
||||
#define POSTCODE_SEVERITY_INFO DIAG_SEVERITY_PRINT /* TODO-> Info currently
|
||||
* doesnt show, so we
|
||||
* set info=warning */
|
||||
/* example call of POSTCODE_LINUX_2(VISOR_CHIPSET_PC, POSTCODE_SEVERITY_ERR);
|
||||
* Please also note that the resulting postcode is in hex, so if you are
|
||||
* searching for the __LINE__ number, convert it first to decimal. The line
|
||||
* number combined with driver and type of call, will allow you to track down
|
||||
* exactly what line an error occured on, or where the last driver
|
||||
* entered/exited from.
|
||||
*/
|
||||
|
||||
/* BASE FUNCTIONS */
|
||||
#define POSTCODE_LINUX_A(DRIVER_PC, EVENT_PC, pc32bit, severity) \
|
||||
do { \
|
||||
unsigned long long post_code_temp; \
|
||||
post_code_temp = (((U64)DRIVER_PC) << 56) | (((U64)EVENT_PC) << 44) | \
|
||||
((((U64)__LINE__) & 0xFFF) << 32) | \
|
||||
(((U64)pc32bit) & 0xFFFFFFFF); \
|
||||
ISSUE_IO_VMCALL_POSTCODE_SEVERITY(post_code_temp, severity); \
|
||||
} while (0)
|
||||
|
||||
#define POSTCODE_LINUX_B(DRIVER_PC, EVENT_PC, pc16bit1, pc16bit2, severity) \
|
||||
do { \
|
||||
unsigned long long post_code_temp; \
|
||||
post_code_temp = (((U64)DRIVER_PC) << 56) | (((U64)EVENT_PC) << 44) | \
|
||||
((((U64)__LINE__) & 0xFFF) << 32) | \
|
||||
((((U64)pc16bit1) & 0xFFFF) << 16) | \
|
||||
(((U64)pc16bit2) & 0xFFFF); \
|
||||
ISSUE_IO_VMCALL_POSTCODE_SEVERITY(post_code_temp, severity); \
|
||||
} while (0)
|
||||
|
||||
/* MOST COMMON */
|
||||
#define POSTCODE_LINUX_2(EVENT_PC, severity) \
|
||||
POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, 0x0000, severity);
|
||||
|
||||
#define POSTCODE_LINUX_3(EVENT_PC, pc32bit, severity) \
|
||||
POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, pc32bit, severity);
|
||||
|
||||
|
||||
#define POSTCODE_LINUX_4(EVENT_PC, pc16bit1, pc16bit2, severity) \
|
||||
POSTCODE_LINUX_B(CURRENT_FILE_PC, EVENT_PC, pc16bit1, \
|
||||
pc16bit2, severity);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
472
drivers/staging/unisys/include/uisqueue.h
Normal file
472
drivers/staging/unisys/include/uisqueue.h
Normal file
@@ -0,0 +1,472 @@
|
||||
/* uisqueue.h
|
||||
*
|
||||
* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unisys IO Virtualization header NOTE: This file contains only Linux
|
||||
* specific structs. All OS-independent structs are in iochannel.h.xx
|
||||
*/
|
||||
|
||||
#ifndef __UISQUEUE_H__
|
||||
#define __UISQUEUE_H__
|
||||
|
||||
#include "linux/version.h"
|
||||
#include "iochannel.h"
|
||||
#include "uniklog.h"
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/semaphore.h>
|
||||
|
||||
#include "controlvmchannel.h"
|
||||
#include "controlvmcompletionstatus.h"
|
||||
|
||||
struct uisqueue_info {
|
||||
|
||||
pCHANNEL_HEADER chan;
|
||||
/* channel containing queues in which scsi commands &
|
||||
* responses are queued
|
||||
*/
|
||||
U64 packets_sent;
|
||||
U64 packets_received;
|
||||
U64 interrupts_sent;
|
||||
U64 interrupts_received;
|
||||
U64 max_not_empty_cnt;
|
||||
U64 total_wakeup_cnt;
|
||||
U64 non_empty_wakeup_cnt;
|
||||
|
||||
struct {
|
||||
SIGNAL_QUEUE_HEADER Reserved1; /* */
|
||||
SIGNAL_QUEUE_HEADER Reserved2; /* */
|
||||
} safe_uis_queue;
|
||||
unsigned int (*send_int_if_needed)(struct uisqueue_info *info,
|
||||
unsigned int whichcqueue,
|
||||
unsigned char issueInterruptIfEmpty,
|
||||
U64 interruptHandle,
|
||||
unsigned char io_termination);
|
||||
};
|
||||
|
||||
/* uisqueue_put_cmdrsp_with_lock_client queues a commmand or response
|
||||
* to the specified queue, at the tail if the queue is full but
|
||||
* oktowait == 0, then it return 0 indicating failure. otherwise it
|
||||
* wait for the queue to become non-full. If command is queued, return
|
||||
* 1 for success.
|
||||
*/
|
||||
#define DONT_ISSUE_INTERRUPT 0
|
||||
#define ISSUE_INTERRUPT 1
|
||||
|
||||
#define DONT_WAIT 0
|
||||
#define OK_TO_WAIT 1
|
||||
#define UISLIB_LOCK_PREFIX \
|
||||
".section .smp_locks,\"a\"\n" \
|
||||
_ASM_ALIGN "\n" \
|
||||
_ASM_PTR "661f\n" /* address */ \
|
||||
".previous\n" \
|
||||
"661:\n\tlock; "
|
||||
|
||||
unsigned long long uisqueue_InterlockedOr(volatile unsigned long long *Target,
|
||||
unsigned long long Set);
|
||||
unsigned long long uisqueue_InterlockedAnd(volatile unsigned long long *Target,
|
||||
unsigned long long Set);
|
||||
|
||||
unsigned int uisqueue_send_int_if_needed(struct uisqueue_info *pqueueinfo,
|
||||
unsigned int whichqueue,
|
||||
unsigned char issueInterruptIfEmpty,
|
||||
U64 interruptHandle,
|
||||
unsigned char io_termination);
|
||||
|
||||
int uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo,
|
||||
struct uiscmdrsp *cmdrsp,
|
||||
unsigned int queue,
|
||||
void *insertlock,
|
||||
unsigned char issueInterruptIfEmpty,
|
||||
U64 interruptHandle,
|
||||
char oktowait,
|
||||
U8 *channelId);
|
||||
|
||||
/* uisqueue_get_cmdrsp gets the cmdrsp entry at the head of the queue
|
||||
* and copies it to the area pointed by cmdrsp param.
|
||||
* returns 0 if queue is empty, 1 otherwise
|
||||
*/
|
||||
int
|
||||
|
||||
uisqueue_get_cmdrsp(struct uisqueue_info *queueinfo, void *cmdrsp,
|
||||
unsigned int queue);
|
||||
|
||||
#define MAX_NAME_SIZE_UISQUEUE 64
|
||||
|
||||
struct extport_info {
|
||||
U8 valid:1;
|
||||
/* if 1, indicates this extport slot is occupied
|
||||
* if 0, indicates that extport slot is unoccupied */
|
||||
|
||||
U32 num_devs_using;
|
||||
/* When extport is added, this is set to 0. For exports
|
||||
* located in NETWORK switches:
|
||||
* Each time a VNIC, i.e., intport, is added to the switch this
|
||||
* is used to assign a pref_pnic for the VNIC and when assigned
|
||||
* to a VNIC this counter is incremented. When a VNIC is
|
||||
* deleted, the extport corresponding to the VNIC's pref_pnic
|
||||
* is located and its num_devs_using is decremented. For VNICs,
|
||||
* num_devs_using is basically used to load-balance transmit
|
||||
* traffic from VNICs.
|
||||
*/
|
||||
|
||||
struct switch_info *swtch;
|
||||
struct PciId pci_id;
|
||||
char name[MAX_NAME_SIZE_UISQUEUE];
|
||||
union {
|
||||
struct vhba_wwnn wwnn;
|
||||
unsigned char macaddr[MAX_MACADDR_LEN];
|
||||
};
|
||||
};
|
||||
|
||||
struct device_info {
|
||||
void *chanptr;
|
||||
U64 channelAddr;
|
||||
U64 channelBytes;
|
||||
GUID channelTypeGuid;
|
||||
GUID devInstGuid;
|
||||
struct InterruptInfo intr;
|
||||
struct switch_info *swtch;
|
||||
char devid[30]; /* "vbus<busno>:dev<devno>" */
|
||||
U16 polling;
|
||||
struct semaphore interrupt_callback_lock;
|
||||
U32 busNo;
|
||||
U32 devNo;
|
||||
int (*interrupt)(void *);
|
||||
void *interrupt_context;
|
||||
void *private_data;
|
||||
struct list_head list_polling_device_channels;
|
||||
unsigned long long moved_to_tail_cnt;
|
||||
unsigned long long first_busy_cnt;
|
||||
unsigned long long last_on_list_cnt;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
RECOVERY_LAN = 1,
|
||||
IB_LAN = 2
|
||||
} SWITCH_TYPE;
|
||||
|
||||
struct bus_info {
|
||||
U32 busNo, deviceCount;
|
||||
struct device_info **device;
|
||||
U64 guestHandle, recvBusInterruptHandle;
|
||||
GUID busInstGuid;
|
||||
ULTRA_VBUS_CHANNEL_PROTOCOL *pBusChannel;
|
||||
int busChannelBytes;
|
||||
struct proc_dir_entry *proc_dir; /* proc/uislib/vbus/<x> */
|
||||
struct proc_dir_entry *proc_info; /* proc/uislib/vbus/<x>/info */
|
||||
char name[25];
|
||||
char partitionName[99];
|
||||
struct bus_info *next;
|
||||
U8 localVnic; /* 1 if local vnic created internally
|
||||
* by IOVM; 0 otherwise... */
|
||||
};
|
||||
|
||||
#define DEDICATED_SWITCH(pSwitch) ((pSwitch->extPortCount == 1) && \
|
||||
(pSwitch->intPortCount == 1))
|
||||
|
||||
struct sn_list_entry {
|
||||
struct uisscsi_dest pdest; /* scsi bus, target, lun for
|
||||
* phys disk */
|
||||
U8 sernum[MAX_SERIAL_NUM]; /* serial num of physical
|
||||
* disk.. The length is always
|
||||
* MAX_SERIAL_NUM, padded with
|
||||
* spaces */
|
||||
struct sn_list_entry *next;
|
||||
};
|
||||
|
||||
struct networkPolicy {
|
||||
U32 promiscuous:1;
|
||||
U32 macassign:1;
|
||||
U32 peerforwarding:1;
|
||||
U32 nonotify:1;
|
||||
U32 standby:1;
|
||||
U32 callhome:2;
|
||||
char ip_addr[30];
|
||||
};
|
||||
|
||||
/*
|
||||
* IO messages sent to UisnicControlChanFunc & UissdControlChanFunc by
|
||||
* code that processes the ControlVm channel messages.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
IOPART_ADD_VNIC,
|
||||
IOPART_DEL_VNIC,
|
||||
IOPART_DEL_ALL_VNICS,
|
||||
IOPART_ADD_VHBA,
|
||||
IOPART_ADD_VDISK,
|
||||
IOPART_DEL_VHBA,
|
||||
IOPART_DEL_VDISK,
|
||||
IOPART_DEL_ALL_VDISKS_FOR_VHBA,
|
||||
IOPART_DEL_ALL_VHBAS,
|
||||
IOPART_ATTACH_PHBA,
|
||||
IOPART_DETACH_PHBA, /* 10 */
|
||||
IOPART_ATTACH_PNIC,
|
||||
IOPART_DETACH_PNIC,
|
||||
IOPART_DETACH_VHBA,
|
||||
IOPART_DETACH_VNIC,
|
||||
IOPART_PAUSE_VDISK,
|
||||
IOPART_RESUME_VDISK,
|
||||
IOPART_ADD_DEVICE, /* add generic device */
|
||||
IOPART_DEL_DEVICE, /* del generic device */
|
||||
} IOPART_MSG_TYPE;
|
||||
|
||||
struct add_virt_iopart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
U64 guestHandle; /* used to convert guest physical
|
||||
* address to real physical address
|
||||
* for DMA, for ex. */
|
||||
U64 recvBusInterruptHandle; /* used to register to receive
|
||||
* bus level interrupts. */
|
||||
struct InterruptInfo intr; /* contains recv & send
|
||||
* interrupt info */
|
||||
/* recvInterruptHandle is used to register to receive
|
||||
* interrupts on the data channel. Used by GuestLinux/Windows
|
||||
* IO drivers to connect to interrupt. sendInterruptHandle is
|
||||
* used by IOPart drivers as parameter to
|
||||
* Issue_VMCALL_IO_QUEUE_TRANSITION to interrupt thread in
|
||||
* guest linux/windows IO drivers when data channel queue for
|
||||
* vhba/vnic goes from EMPTY to NON-EMPTY. */
|
||||
struct switch_info *swtch; /* pointer to the virtual
|
||||
* switch to which the vnic is
|
||||
* connected */
|
||||
|
||||
U8 useG2GCopy; /* Used to determine if a virtual HBA
|
||||
* needs to use G2G copy. */
|
||||
U8 Filler[7];
|
||||
|
||||
U32 busNo;
|
||||
U32 devNo;
|
||||
char *params;
|
||||
ulong params_bytes;
|
||||
|
||||
};
|
||||
|
||||
struct add_vdisk_iopart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
int implicit;
|
||||
struct uisscsi_dest vdest; /* scsi bus, target, lun for virt disk */
|
||||
struct uisscsi_dest pdest; /* scsi bus, target, lun for phys disk */
|
||||
U8 sernum[MAX_SERIAL_NUM]; /* serial num of physical disk */
|
||||
U32 serlen; /* length of serial num */
|
||||
U32 busNo;
|
||||
U32 devNo;
|
||||
};
|
||||
|
||||
struct del_vdisk_iopart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
struct uisscsi_dest vdest; /* scsi bus, target, lun for virt disk */
|
||||
U32 busNo;
|
||||
U32 devNo;
|
||||
};
|
||||
|
||||
struct del_virt_iopart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
U32 busNo;
|
||||
U32 devNo;
|
||||
};
|
||||
|
||||
struct det_virt_iopart { /* detach internal port */
|
||||
void *chanptr; /* pointer to data channel */
|
||||
struct switch_info *swtch;
|
||||
};
|
||||
|
||||
struct paures_vdisk_iopart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
struct uisscsi_dest vdest; /* scsi bus, target, lun for virt disk */
|
||||
};
|
||||
|
||||
struct add_switch_iopart { /* add switch */
|
||||
struct switch_info *swtch;
|
||||
char *params;
|
||||
ulong params_bytes;
|
||||
};
|
||||
|
||||
struct del_switch_iopart { /* destroy switch */
|
||||
struct switch_info *swtch;
|
||||
};
|
||||
|
||||
struct io_msgs {
|
||||
|
||||
IOPART_MSG_TYPE msgtype;
|
||||
|
||||
/* additional params needed by some messages */
|
||||
union {
|
||||
struct add_virt_iopart add_vhba;
|
||||
struct add_virt_iopart add_vnic;
|
||||
struct add_vdisk_iopart add_vdisk;
|
||||
struct del_virt_iopart del_vhba;
|
||||
struct del_virt_iopart del_vnic;
|
||||
struct det_virt_iopart det_vhba;
|
||||
struct det_virt_iopart det_vnic;
|
||||
struct del_vdisk_iopart del_vdisk;
|
||||
struct del_virt_iopart del_all_vdisks_for_vhba;
|
||||
struct add_virt_iopart add_device;
|
||||
struct del_virt_iopart del_device;
|
||||
struct det_virt_iopart det_intport;
|
||||
struct add_switch_iopart add_switch;
|
||||
struct del_switch_iopart del_switch;
|
||||
struct extport_info *extPort; /* for attach or detach
|
||||
* pnic/generic delete all
|
||||
* vhbas/allvnics need no
|
||||
* parameters */
|
||||
struct paures_vdisk_iopart paures_vdisk;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* Guest messages sent to VirtControlChanFunc by code that processes
|
||||
* the ControlVm channel messages.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
GUEST_ADD_VBUS,
|
||||
GUEST_ADD_VHBA,
|
||||
GUEST_ADD_VNIC,
|
||||
GUEST_DEL_VBUS,
|
||||
GUEST_DEL_VHBA,
|
||||
GUEST_DEL_VNIC,
|
||||
GUEST_DEL_ALL_VHBAS,
|
||||
GUEST_DEL_ALL_VNICS,
|
||||
GUEST_DEL_ALL_VBUSES, /* deletes all vhbas & vnics on all
|
||||
* buses and deletes all buses */
|
||||
GUEST_PAUSE_VHBA,
|
||||
GUEST_PAUSE_VNIC,
|
||||
GUEST_RESUME_VHBA,
|
||||
GUEST_RESUME_VNIC
|
||||
} GUESTPART_MSG_TYPE;
|
||||
|
||||
struct add_vbus_guestpart {
|
||||
void *chanptr; /* pointer to data channel for bus -
|
||||
* NOT YET USED */
|
||||
U32 busNo; /* bus number to be created/deleted */
|
||||
U32 deviceCount; /* max num of devices on bus */
|
||||
GUID busTypeGuid; /* indicates type of bus */
|
||||
GUID busInstGuid; /* instance guid for device */
|
||||
};
|
||||
|
||||
struct del_vbus_guestpart {
|
||||
U32 busNo; /* bus number to be deleted */
|
||||
/* once we start using the bus's channel, add can dump busNo
|
||||
* into the channel header and then delete will need only one
|
||||
* parameter, chanptr. */
|
||||
};
|
||||
|
||||
struct add_virt_guestpart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
U32 busNo; /* bus number for the operation */
|
||||
U32 deviceNo; /* number of device on the bus */
|
||||
GUID devInstGuid; /* instance guid for device */
|
||||
struct InterruptInfo intr; /* recv/send interrupt info */
|
||||
/* recvInterruptHandle contains info needed in order to
|
||||
* register to receive interrupts on the data channel.
|
||||
* sendInterruptHandle contains handle which is provided to
|
||||
* monitor VMCALL that will cause an interrupt to be generated
|
||||
* for the other end.
|
||||
*/
|
||||
};
|
||||
|
||||
struct pause_virt_guestpart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
};
|
||||
|
||||
struct resume_virt_guestpart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
};
|
||||
|
||||
struct del_virt_guestpart {
|
||||
void *chanptr; /* pointer to data channel */
|
||||
};
|
||||
|
||||
struct init_chipset_guestpart {
|
||||
U32 busCount; /* indicates the max number of busses */
|
||||
U32 switchCount; /* indicates the max number of switches */
|
||||
};
|
||||
|
||||
struct guest_msgs {
|
||||
|
||||
GUESTPART_MSG_TYPE msgtype;
|
||||
|
||||
/* additional params needed by messages */
|
||||
union {
|
||||
struct add_vbus_guestpart add_vbus;
|
||||
struct add_virt_guestpart add_vhba;
|
||||
struct add_virt_guestpart add_vnic;
|
||||
struct pause_virt_guestpart pause_vhba;
|
||||
struct pause_virt_guestpart pause_vnic;
|
||||
struct resume_virt_guestpart resume_vhba;
|
||||
struct resume_virt_guestpart resume_vnic;
|
||||
struct del_vbus_guestpart del_vbus;
|
||||
struct del_virt_guestpart del_vhba;
|
||||
struct del_virt_guestpart del_vnic;
|
||||
struct del_vbus_guestpart del_all_vhbas;
|
||||
struct del_vbus_guestpart del_all_vnics;
|
||||
/* del_all_vbuses needs no parameters */
|
||||
};
|
||||
struct init_chipset_guestpart init_chipset;
|
||||
|
||||
};
|
||||
|
||||
#ifndef __xg
|
||||
#define __xg(x) ((volatile long *)(x))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Below code is a copy of Linux kernel's cmpxchg function located at
|
||||
* this place
|
||||
* http://tcsxeon:8080/source/xref/00trunk-AppOS-linux/include/asm-x86/cmpxchg_64.h#84
|
||||
* Reason for creating our own version of cmpxchg along with
|
||||
* UISLIB_LOCK_PREFIX is to make the operation atomic even for non SMP
|
||||
* guests.
|
||||
*/
|
||||
|
||||
static inline unsigned long
|
||||
uislibcmpxchg64(volatile void *ptr, unsigned long old, unsigned long new,
|
||||
int size)
|
||||
{
|
||||
unsigned long prev;
|
||||
switch (size) {
|
||||
case 1:
|
||||
__asm__ __volatile__(UISLIB_LOCK_PREFIX "cmpxchgb %b1,%2":"=a"(prev)
|
||||
: "q"(new), "m"(*__xg(ptr)),
|
||||
"0"(old)
|
||||
: "memory");
|
||||
return prev;
|
||||
case 2:
|
||||
__asm__ __volatile__(UISLIB_LOCK_PREFIX "cmpxchgw %w1,%2":"=a"(prev)
|
||||
: "r"(new), "m"(*__xg(ptr)),
|
||||
"0"(old)
|
||||
: "memory");
|
||||
return prev;
|
||||
case 4:
|
||||
__asm__ __volatile__(UISLIB_LOCK_PREFIX "cmpxchgl %k1,%2":"=a"(prev)
|
||||
: "r"(new), "m"(*__xg(ptr)),
|
||||
"0"(old)
|
||||
: "memory");
|
||||
return prev;
|
||||
case 8:
|
||||
__asm__ __volatile__(UISLIB_LOCK_PREFIX "cmpxchgq %1,%2":"=a"(prev)
|
||||
: "r"(new), "m"(*__xg(ptr)),
|
||||
"0"(old)
|
||||
: "memory");
|
||||
return prev;
|
||||
}
|
||||
return old;
|
||||
}
|
||||
|
||||
#endif /* __UISQUEUE_H__ */
|
||||
46
drivers/staging/unisys/include/uisthread.h
Normal file
46
drivers/staging/unisys/include/uisthread.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* uisthread.h
|
||||
*
|
||||
* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Unisys thread utilities header */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
#ifndef __UISTHREAD_H__
|
||||
#define __UISTHREAD_H__
|
||||
|
||||
|
||||
#include "linux/completion.h"
|
||||
|
||||
struct uisthread_info {
|
||||
struct task_struct *task;
|
||||
int id;
|
||||
int should_stop;
|
||||
struct completion has_stopped;
|
||||
};
|
||||
|
||||
|
||||
/* returns 0 for failure, 1 for success */
|
||||
int uisthread_start(
|
||||
struct uisthread_info *thrinfo,
|
||||
int (*threadfn)(void *),
|
||||
void *thrcontext,
|
||||
char *name);
|
||||
|
||||
void uisthread_stop(struct uisthread_info *thrinfo);
|
||||
|
||||
#endif /* __UISTHREAD_H__ */
|
||||
359
drivers/staging/unisys/include/uisutils.h
Normal file
359
drivers/staging/unisys/include/uisutils.h
Normal file
@@ -0,0 +1,359 @@
|
||||
/* uisutils.h
|
||||
*
|
||||
* Copyright © 2010 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unisys Virtual HBA utilities header
|
||||
*/
|
||||
|
||||
#ifndef __UISUTILS__H__
|
||||
#define __UISUTILS__H__
|
||||
#include <linux/string.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/gfp.h>
|
||||
|
||||
#include "vmcallinterface.h"
|
||||
#include "channel.h"
|
||||
#include "uisthread.h"
|
||||
#include "uisqueue.h"
|
||||
#include "diagnostics/appos_subsystems.h"
|
||||
#include "vbusdeviceinfo.h"
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/* This is the MAGIC number stuffed by virthba in host->this_id. Used to
|
||||
* identify virtual hbas.
|
||||
*/
|
||||
#define UIS_MAGIC_VHBA 707
|
||||
|
||||
/* global function pointers that act as callback functions into
|
||||
* uisnicmod, uissdmod, and virtpcimod
|
||||
*/
|
||||
extern int (*UisnicControlChanFunc)(struct io_msgs *);
|
||||
extern int (*UissdControlChanFunc)(struct io_msgs *);
|
||||
extern int (*VirtControlChanFunc)(struct guest_msgs *);
|
||||
|
||||
/* Return values of above callback functions: */
|
||||
#define CCF_ERROR 0 /* completed and failed */
|
||||
#define CCF_OK 1 /* completed successfully */
|
||||
#define CCF_PENDING 2 /* operation still pending */
|
||||
extern atomic_t UisUtils_Registered_Services;
|
||||
|
||||
typedef unsigned int MACARRAY[MAX_MACADDR_LEN];
|
||||
typedef struct ReqHandlerInfo_struct {
|
||||
GUID switchTypeGuid;
|
||||
int (*controlfunc)(struct io_msgs *);
|
||||
unsigned long min_channel_bytes;
|
||||
int (*Server_Channel_Ok)(unsigned long channelBytes);
|
||||
int (*Server_Channel_Init)
|
||||
(void *x, unsigned char *clientStr, U32 clientStrLen, U64 bytes);
|
||||
char switch_type_name[99];
|
||||
struct list_head list_link; /* links into ReqHandlerInfo_list */
|
||||
} ReqHandlerInfo_t;
|
||||
|
||||
ReqHandlerInfo_t *ReqHandlerAdd(GUID switchTypeGuid,
|
||||
const char *switch_type_name,
|
||||
int (*controlfunc)(struct io_msgs *),
|
||||
unsigned long min_channel_bytes,
|
||||
int (*Server_Channel_Ok)(unsigned long
|
||||
channelBytes),
|
||||
int (*Server_Channel_Init)
|
||||
(void *x, unsigned char *clientStr,
|
||||
U32 clientStrLen, U64 bytes));
|
||||
ReqHandlerInfo_t *ReqHandlerFind(GUID switchTypeGuid);
|
||||
int ReqHandlerDel(GUID switchTypeGuid);
|
||||
|
||||
#define uislib_ioremap_cache(addr, size) \
|
||||
dbg_ioremap_cache(addr, size, __FILE__, __LINE__)
|
||||
|
||||
static inline void *
|
||||
dbg_ioremap_cache(U64 addr, unsigned long size, char *file, int line)
|
||||
{
|
||||
void *new;
|
||||
new = ioremap_cache(addr, size);
|
||||
return new;
|
||||
}
|
||||
|
||||
#define uislib_ioremap(addr, size) dbg_ioremap(addr, size, __FILE__, __LINE__)
|
||||
|
||||
static inline void *
|
||||
dbg_ioremap(U64 addr, unsigned long size, char *file, int line)
|
||||
{
|
||||
void *new;
|
||||
new = ioremap(addr, size);
|
||||
return new;
|
||||
}
|
||||
|
||||
#define uislib_iounmap(addr) dbg_iounmap(addr, __FILE__, __LINE__)
|
||||
|
||||
static inline void
|
||||
dbg_iounmap(void *addr, char *file, int line)
|
||||
{
|
||||
iounmap(addr);
|
||||
}
|
||||
|
||||
#define PROC_READ_BUFFER_SIZE 131072 /* size of the buffer to allocate to
|
||||
* hold all of /proc/XXX/info */
|
||||
int util_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining,
|
||||
char *format, ...);
|
||||
|
||||
int uisctrl_register_req_handler(int type, void *fptr,
|
||||
ULTRA_VBUS_DEVICEINFO *chipset_DriverInfo);
|
||||
int uisctrl_register_req_handler_ex(GUID switchTypeGuid,
|
||||
const char *switch_type_name,
|
||||
int (*fptr)(struct io_msgs *),
|
||||
unsigned long min_channel_bytes,
|
||||
int (*Server_Channel_Ok)(unsigned long
|
||||
channelBytes),
|
||||
int (*Server_Channel_Init)
|
||||
(void *x, unsigned char *clientStr,
|
||||
U32 clientStrLen, U64 bytes),
|
||||
ULTRA_VBUS_DEVICEINFO *chipset_DriverInfo);
|
||||
|
||||
int uisctrl_unregister_req_handler_ex(GUID switchTypeGuid);
|
||||
unsigned char *util_map_virt(struct phys_info *sg);
|
||||
void util_unmap_virt(struct phys_info *sg);
|
||||
unsigned char *util_map_virt_atomic(struct phys_info *sg);
|
||||
void util_unmap_virt_atomic(void *buf);
|
||||
int uislib_server_inject_add_vnic(U32 switchNo, U32 BusNo, U32 numIntPorts,
|
||||
U32 numExtPorts, MACARRAY pmac[],
|
||||
pCHANNEL_HEADER **chan);
|
||||
void uislib_server_inject_del_vnic(U32 switchNo, U32 busNo, U32 numIntPorts,
|
||||
U32 numExtPorts);
|
||||
int uislib_client_inject_add_bus(U32 busNo, GUID instGuid,
|
||||
U64 channelAddr, ulong nChannelBytes);
|
||||
int uislib_client_inject_del_bus(U32 busNo);
|
||||
|
||||
int uislib_client_inject_add_vhba(U32 busNo, U32 devNo,
|
||||
U64 phys_chan_addr, U32 chan_bytes,
|
||||
int is_test_addr, GUID instGuid,
|
||||
struct InterruptInfo *intr);
|
||||
int uislib_client_inject_pause_vhba(U32 busNo, U32 devNo);
|
||||
int uislib_client_inject_resume_vhba(U32 busNo, U32 devNo);
|
||||
int uislib_client_inject_del_vhba(U32 busNo, U32 devNo);
|
||||
int uislib_client_inject_add_vnic(U32 busNo, U32 devNo,
|
||||
U64 phys_chan_addr, U32 chan_bytes,
|
||||
int is_test_addr, GUID instGuid,
|
||||
struct InterruptInfo *intr);
|
||||
int uislib_client_inject_pause_vnic(U32 busNo, U32 devNo);
|
||||
int uislib_client_inject_resume_vnic(U32 busNo, U32 devNo);
|
||||
int uislib_client_inject_del_vnic(U32 busNo, U32 devNo);
|
||||
#ifdef STORAGE_CHANNEL
|
||||
U64 uislib_storage_channel(int client_id);
|
||||
#endif
|
||||
int uislib_get_owned_pdest(struct uisscsi_dest *pdest);
|
||||
|
||||
int uislib_send_event(CONTROLVM_ID id, CONTROLVM_MESSAGE_PACKET *event);
|
||||
|
||||
/* structure used by vhba & vnic to keep track of queue & thread info */
|
||||
struct chaninfo {
|
||||
struct uisqueue_info *queueinfo;
|
||||
/* this specifies the queue structures for a channel */
|
||||
/* ALLOCATED BY THE OTHER END - WE JUST GET A POINTER TO THE MEMORY */
|
||||
spinlock_t insertlock;
|
||||
/* currently used only in virtnic when sending data to uisnic */
|
||||
/* to synchronize the inserts into the signal queue */
|
||||
struct uisthread_info threadinfo;
|
||||
/* this specifies the thread structures used by the thread that */
|
||||
/* handles this channel */
|
||||
};
|
||||
|
||||
/* this is the wait code for all the threads - it is used to get
|
||||
* something from a queue choices: wait_for_completion_interruptible,
|
||||
* _timeout, interruptible_timeout
|
||||
*/
|
||||
#define UIS_THREAD_WAIT_MSEC(x) { \
|
||||
set_current_state(TASK_INTERRUPTIBLE); \
|
||||
schedule_timeout(msecs_to_jiffies(x)); \
|
||||
}
|
||||
#define UIS_THREAD_WAIT_USEC(x) { \
|
||||
set_current_state(TASK_INTERRUPTIBLE); \
|
||||
schedule_timeout(usecs_to_jiffies(x)); \
|
||||
}
|
||||
#define UIS_THREAD_WAIT UIS_THREAD_WAIT_MSEC(5)
|
||||
#define UIS_THREAD_WAIT_SEC(x) { \
|
||||
set_current_state(TASK_INTERRUPTIBLE); \
|
||||
schedule_timeout((x)*HZ); \
|
||||
}
|
||||
|
||||
#define ALLOC_CMDRSP(cmdrsp) { \
|
||||
cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); \
|
||||
if (cmdrsp != NULL) { \
|
||||
memset(cmdrsp, 0, SIZEOF_CMDRSP); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* This is a hack until we fix IOVM to initialize the channel header
|
||||
* correctly at DEVICE_CREATE time, INSTEAD OF waiting until
|
||||
* DEVICE_CONFIGURE time.
|
||||
*/
|
||||
#define WAIT_FOR_VALID_GUID(guid) \
|
||||
do { \
|
||||
while (memcmp(&guid, &Guid0, sizeof(Guid0)) == 0) { \
|
||||
LOGERR("Waiting for non-0 GUID (why???)...\n"); \
|
||||
UIS_THREAD_WAIT_SEC(5); \
|
||||
} \
|
||||
LOGERR("OK... GUID is non-0 now\n"); \
|
||||
} while (0)
|
||||
|
||||
/* CopyFragsInfoFromSkb returns the number of entries added to frags array
|
||||
* Returns -1 on failure.
|
||||
*/
|
||||
unsigned int util_copy_fragsinfo_from_skb(unsigned char *calling_ctx,
|
||||
void *skb_in, unsigned int firstfraglen,
|
||||
unsigned int frags_max, struct phys_info frags[]);
|
||||
|
||||
static inline unsigned int
|
||||
Issue_VMCALL_IO_CONTROLVM_ADDR(U64 *ControlAddress, U32 *ControlBytes)
|
||||
{
|
||||
VMCALL_IO_CONTROLVM_ADDR_PARAMS params;
|
||||
int result = VMCALL_SUCCESS;
|
||||
U64 physaddr;
|
||||
|
||||
physaddr = virt_to_phys(¶ms);
|
||||
ISSUE_IO_VMCALL(VMCALL_IO_CONTROLVM_ADDR, physaddr, result);
|
||||
if (VMCALL_SUCCESSFUL(result)) {
|
||||
*ControlAddress = params.ChannelAddress;
|
||||
*ControlBytes = params.ChannelBytes;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned int Issue_VMCALL_IO_DIAG_ADDR(U64 *DiagChannelAddress)
|
||||
{
|
||||
VMCALL_IO_DIAG_ADDR_PARAMS params;
|
||||
int result = VMCALL_SUCCESS;
|
||||
U64 physaddr;
|
||||
|
||||
physaddr = virt_to_phys(¶ms);
|
||||
ISSUE_IO_VMCALL(VMCALL_IO_DIAG_ADDR, physaddr, result);
|
||||
if (VMCALL_SUCCESSFUL(result))
|
||||
*DiagChannelAddress = params.ChannelAddress;
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
Issue_VMCALL_IO_VISORSERIAL_ADDR(U64 *DiagChannelAddress)
|
||||
{
|
||||
VMCALL_IO_VISORSERIAL_ADDR_PARAMS params;
|
||||
int result = VMCALL_SUCCESS;
|
||||
U64 physaddr;
|
||||
|
||||
physaddr = virt_to_phys(¶ms);
|
||||
ISSUE_IO_VMCALL(VMCALL_IO_VISORSERIAL_ADDR, physaddr, result);
|
||||
if (VMCALL_SUCCESSFUL(result))
|
||||
*DiagChannelAddress = params.ChannelAddress;
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline S64 Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET(void)
|
||||
{
|
||||
U64 result = VMCALL_SUCCESS;
|
||||
U64 physaddr = 0;
|
||||
|
||||
ISSUE_IO_VMCALL(VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET, physaddr,
|
||||
result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline S64 Issue_VMCALL_MEASUREMENT_DO_NOTHING(void)
|
||||
{
|
||||
U64 result = VMCALL_SUCCESS;
|
||||
U64 physaddr = 0;
|
||||
|
||||
ISSUE_IO_VMCALL(VMCALL_MEASUREMENT_DO_NOTHING, physaddr, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
struct log_info_t {
|
||||
volatile unsigned long long last_cycles;
|
||||
unsigned long long delta_sum[64];
|
||||
unsigned long long delta_cnt[64];
|
||||
unsigned long long max_delta[64];
|
||||
unsigned long long min_delta[64];
|
||||
};
|
||||
|
||||
static inline int Issue_VMCALL_UPDATE_PHYSICAL_TIME(U64 adjustment)
|
||||
{
|
||||
int result = VMCALL_SUCCESS;
|
||||
|
||||
ISSUE_IO_VMCALL(VMCALL_UPDATE_PHYSICAL_TIME, adjustment, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
Issue_VMCALL_CHANNEL_MISMATCH(const char *ChannelName,
|
||||
const char *ItemName,
|
||||
U32 SourceLineNumber, const char *path_n_fn)
|
||||
{
|
||||
VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS params;
|
||||
int result = VMCALL_SUCCESS;
|
||||
U64 physaddr;
|
||||
char *last_slash = NULL;
|
||||
|
||||
strncpy(params.ChannelName, ChannelName,
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ChannelName));
|
||||
strncpy(params.ItemName, ItemName,
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ItemName));
|
||||
params.SourceLineNumber = SourceLineNumber;
|
||||
|
||||
last_slash = strrchr(path_n_fn, '/');
|
||||
if (last_slash != NULL) {
|
||||
last_slash++;
|
||||
strncpy(params.SourceFileName, last_slash,
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
|
||||
SourceFileName));
|
||||
} else
|
||||
strncpy(params.SourceFileName,
|
||||
"Cannot determine source filename",
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
|
||||
SourceFileName));
|
||||
|
||||
physaddr = virt_to_phys(¶ms);
|
||||
ISSUE_IO_VMCALL(VMCALL_CHANNEL_VERSION_MISMATCH, physaddr, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline unsigned int Issue_VMCALL_FATAL_BYE_BYE(void)
|
||||
{
|
||||
int result = VMCALL_SUCCESS;
|
||||
U64 physaddr = 0;
|
||||
|
||||
ISSUE_IO_VMCALL(VMCALL_GENERIC_SURRENDER_QUANTUM_FOREVER, physaddr,
|
||||
result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define UIS_DAEMONIZE(nam)
|
||||
void *uislib_malloc(size_t siz, gfp_t gfp, U8 contiguous, char *fn, int ln);
|
||||
#define UISMALLOC(siz, gfp) uislib_malloc(siz, gfp, 1, __FILE__, __LINE__)
|
||||
#define UISVMALLOC(siz) uislib_malloc(siz, 0, 0, __FILE__, __LINE__)
|
||||
void uislib_free(void *p, size_t siz, U8 contiguous, char *fn, int ln);
|
||||
#define UISFREE(p, siz) uislib_free(p, siz, 1, __FILE__, __LINE__)
|
||||
#define UISVFREE(p, siz) uislib_free(p, siz, 0, __FILE__, __LINE__)
|
||||
void *uislib_cache_alloc(struct kmem_cache *cur_pool, char *fn, int ln);
|
||||
#define UISCACHEALLOC(cur_pool) uislib_cache_alloc(cur_pool, __FILE__, __LINE__)
|
||||
void uislib_cache_free(struct kmem_cache *cur_pool, void *p, char *fn, int ln);
|
||||
#define UISCACHEFREE(cur_pool, p) \
|
||||
uislib_cache_free(cur_pool, p, __FILE__, __LINE__)
|
||||
|
||||
void uislib_enable_channel_interrupts(U32 busNo, U32 devNo,
|
||||
int (*interrupt)(void *),
|
||||
void *interrupt_context);
|
||||
void uislib_disable_channel_interrupts(U32 busNo, U32 devNo);
|
||||
void uislib_force_channel_interrupt(U32 busNo, U32 devNo);
|
||||
|
||||
#endif /* __UISUTILS__H__ */
|
||||
47
drivers/staging/unisys/include/vbushelper.h
Normal file
47
drivers/staging/unisys/include/vbushelper.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* vbushelper.h
|
||||
*
|
||||
* Copyright © 2011 - 2013 UNISYS CORPORATION
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
||||
* NON INFRINGEMENT. See the GNU General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#ifndef __VBUSHELPER_H__
|
||||
#define __VBUSHELPER_H__
|
||||
|
||||
#include "vbusdeviceinfo.h"
|
||||
|
||||
/* TARGET_HOSTNAME specified as -DTARGET_HOSTNAME=\"thename\" on the
|
||||
* command line */
|
||||
|
||||
#define TARGET_HOSTNAME "linuxguest"
|
||||
|
||||
static inline void
|
||||
BusDeviceInfo_Init(ULTRA_VBUS_DEVICEINFO *pBusDeviceInfo,
|
||||
const char *deviceType, const char *driverName,
|
||||
const char *ver, const char *verTag,
|
||||
const char *buildDate, const char *buildTime)
|
||||
{
|
||||
memset(pBusDeviceInfo, 0, sizeof(ULTRA_VBUS_DEVICEINFO));
|
||||
snprintf(pBusDeviceInfo->devType, sizeof(pBusDeviceInfo->devType),
|
||||
"%s", (deviceType) ? deviceType : "unknownType");
|
||||
snprintf(pBusDeviceInfo->drvName, sizeof(pBusDeviceInfo->drvName),
|
||||
"%s", (driverName) ? driverName : "unknownDriver");
|
||||
snprintf(pBusDeviceInfo->infoStrings,
|
||||
sizeof(pBusDeviceInfo->infoStrings), "%s\t%s\t%s %s\t%s",
|
||||
(ver) ? ver : "unknownVer",
|
||||
(verTag) ? verTag : "unknownVerTag",
|
||||
(buildDate) ? buildDate : "noBuildDate",
|
||||
(buildTime) ? buildTime : "nobuildTime", TARGET_HOSTNAME);
|
||||
}
|
||||
|
||||
#endif
|
||||
10
drivers/staging/unisys/visorchipset/Kconfig
Normal file
10
drivers/staging/unisys/visorchipset/Kconfig
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Unisys visorchipset configuration
|
||||
#
|
||||
|
||||
config UNISYS_VISORCHIPSET
|
||||
tristate "Unisys visorchipset driver"
|
||||
depends on UNISYSSPAR && UNISYS_VISORUTIL && UNISYS_VISORCHANNEL
|
||||
---help---
|
||||
If you say Y here, you will enable the Unisys visorchipset driver.
|
||||
|
||||
18
drivers/staging/unisys/visorchipset/Makefile
Normal file
18
drivers/staging/unisys/visorchipset/Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Makefile for Unisys visorchipset
|
||||
#
|
||||
|
||||
obj-$(CONFIG_UNISYS_VISORCHIPSET) += visorchipset.o
|
||||
|
||||
visorchipset-y := visorchipset_main.o controlvm_direct.o file.o filexfer.o \
|
||||
parser.o
|
||||
|
||||
ccflags-y += -Idrivers/staging/unisys/include
|
||||
ccflags-y += -Idrivers/staging/unisys/uislib
|
||||
ccflags-y += -Idrivers/staging/unisys/visorchannel
|
||||
ccflags-y += -Idrivers/staging/unisys/common-spar/include
|
||||
ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
|
||||
ccflags-y += -Idrivers/staging/unisys/visorutil
|
||||
ccflags-y += -Iinclude/generated
|
||||
ccflags-y += -DCONFIG_SPAR_GUEST -DGUESTDRIVERBUILD -DNOAUTOVERSION
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user