staging: unisys: fix CamelCase names in struct channel_header

Fix CamelCase names:
Signature => signature
LegacySignature => legacy_signature
HeaderSize => header_size
Size => size
Features => features
Type => chtype
PartitionHandle => partition_handle
Handle => handle
oChannelSpace => ch_space_offset
VersionId => version_id
PartitionIndex => partition_index
ZoneGuid => zone_uuid
oClientString => cli_str_offset
CliStateBoot => cli_state_boot
CmdStateCli => cmd_state_cli
CliStateOs => cli_state_os
ChannelCharacteristics => ch_characteristic
CmdStateSrv => cmd_state_srv
srvState => srv_state
CliErrorBoot => cli_error_boot
CliErrorOs => cli_error_os
Filler => filler
RecoverChannel => recover_channel

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Benjamin Romer 2014-10-23 14:29:56 -04:00 committed by Greg Kroah-Hartman
parent 9fd1b95aab
commit a8a31f6177
6 changed files with 126 additions and 127 deletions

View File

@ -52,7 +52,7 @@ visor_signal_insert(struct channel_header __iomem *pChannel, u32 Queue,
SIGNAL_QUEUE_HEADER __iomem *pqhdr = SIGNAL_QUEUE_HEADER __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) (SIGNAL_QUEUE_HEADER __iomem *)
((char __iomem *) pChannel + readq(&pChannel->oChannelSpace)) ((char __iomem *) pChannel + readq(&pChannel->ch_space_offset))
+ Queue; + Queue;
/* capture current head and tail */ /* capture current head and tail */
@ -110,7 +110,7 @@ visor_signal_remove(struct channel_header __iomem *pChannel, u32 Queue,
unsigned int head, tail; unsigned int head, tail;
SIGNAL_QUEUE_HEADER __iomem *pqhdr = SIGNAL_QUEUE_HEADER __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel + (SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel +
readq(&pChannel->oChannelSpace)) + Queue; readq(&pChannel->ch_space_offset)) + Queue;
/* capture current head and tail */ /* capture current head and tail */
head = readl(&pqhdr->Head); head = readl(&pqhdr->Head);
@ -165,7 +165,7 @@ SignalRemoveAll(struct channel_header *pChannel, u32 Queue, void *pSignal)
unsigned int head, tail, signalCount = 0; unsigned int head, tail, signalCount = 0;
pSIGNAL_QUEUE_HEADER pqhdr = pSIGNAL_QUEUE_HEADER pqhdr =
(pSIGNAL_QUEUE_HEADER) ((char *) pChannel + (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
pChannel->oChannelSpace) + Queue; pChannel->ch_space_offset) + Queue;
/* capture current head and tail */ /* capture current head and tail */
head = pqhdr->Head; head = pqhdr->Head;
@ -214,7 +214,7 @@ visor_signalqueue_empty(struct channel_header __iomem *pChannel, u32 Queue)
{ {
SIGNAL_QUEUE_HEADER __iomem *pqhdr = SIGNAL_QUEUE_HEADER __iomem *pqhdr =
(SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel + (SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel +
readq(&pChannel->oChannelSpace)) + Queue; readq(&pChannel->ch_space_offset)) + Queue;
return readl(&pqhdr->Head) == readl(&pqhdr->Tail); return readl(&pqhdr->Head) == readl(&pqhdr->Tail);
} }
EXPORT_SYMBOL_GPL(visor_signalqueue_empty); EXPORT_SYMBOL_GPL(visor_signalqueue_empty);

View File

@ -95,7 +95,7 @@ ULTRA_CHANNELCLI_STRING(u32 v)
#define ULTRA_CHANNELSRV_IS_READY(x) ((x) == CHANNELSRV_READY) #define ULTRA_CHANNELSRV_IS_READY(x) ((x) == CHANNELSRV_READY)
#define ULTRA_CHANNEL_SERVER_READY(pChannel) \ #define ULTRA_CHANNEL_SERVER_READY(pChannel) \
(ULTRA_CHANNELSRV_IS_READY(readl(&(pChannel)->SrvState))) (ULTRA_CHANNELSRV_IS_READY(readl(&(pChannel)->srv_state)))
#define ULTRA_VALID_CHANNELCLI_TRANSITION(o, n) \ #define ULTRA_VALID_CHANNELCLI_TRANSITION(o, n) \
(((((o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_DISABLED)) || \ (((((o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_DISABLED)) || \
@ -134,21 +134,21 @@ ULTRA_CHANNELCLI_STRING(u32 v)
do { \ do { \
ULTRA_CHANNEL_CLIENT_CHK_TRANSITION( \ ULTRA_CHANNEL_CLIENT_CHK_TRANSITION( \
readl(&(((struct channel_header __iomem *) \ readl(&(((struct channel_header __iomem *) \
(pChan))->CliStateOS)), \ (pChan))->cli_state_os)), \
newstate, \ newstate, \
chanId, logCtx, __FILE__, __LINE__); \ chanId, logCtx, __FILE__, __LINE__); \
pr_info("%s Channel StateTransition (%s) %s(%d)-->%s(%d) @%s:%d\n", \ pr_info("%s Channel StateTransition (%s) %s(%d)-->%s(%d) @%s:%d\n", \
chanId, "CliStateOS", \ chanId, "CliStateOS", \
ULTRA_CHANNELCLI_STRING( \ ULTRA_CHANNELCLI_STRING( \
readl(&((struct channel_header __iomem *)\ readl(&((struct channel_header __iomem *)\
(pChan))->CliStateOS)), \ (pChan))->cli_state_os)), \
readl(&((struct channel_header __iomem *) \ readl(&((struct channel_header __iomem *) \
(pChan))->CliStateOS), \ (pChan))->cli_state_os), \
ULTRA_CHANNELCLI_STRING(newstate), \ ULTRA_CHANNELCLI_STRING(newstate), \
newstate, \ newstate, \
PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \ PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \
writel(newstate, &((struct channel_header __iomem *) \ writel(newstate, &((struct channel_header __iomem *) \
(pChan))->CliStateOS); \ (pChan))->cli_state_os); \
mb(); /* required for channel synch */ \ mb(); /* required for channel synch */ \
} while (0) } while (0)
@ -201,43 +201,43 @@ ULTRA_CHANNELCLI_STRING(u32 v)
#pragma pack(push, 1) /* both GCC and VC now allow this pragma */ #pragma pack(push, 1) /* both GCC and VC now allow this pragma */
/* Common Channel Header */ /* Common Channel Header */
struct channel_header { struct channel_header {
u64 Signature; /* Signature */ u64 signature; /* Signature */
u32 LegacyState; /* DEPRECATED - being replaced by */ u32 legacy_state; /* DEPRECATED - being replaced by */
/* / SrvState, CliStateBoot, and CliStateOS below */ /* / SrvState, CliStateBoot, and CliStateOS below */
u32 HeaderSize; /* sizeof(struct channel_header) */ u32 header_size; /* sizeof(struct channel_header) */
u64 Size; /* Total size of this channel in bytes */ u64 size; /* Total size of this channel in bytes */
u64 Features; /* Flags to modify behavior */ u64 features; /* Flags to modify behavior */
uuid_le Type; /* Channel type: data, bus, control, etc. */ uuid_le chtype; /* Channel type: data, bus, control, etc. */
u64 PartitionHandle; /* ID of guest partition */ u64 partition_handle; /* ID of guest partition */
u64 Handle; /* Device number of this channel in client */ u64 handle; /* Device number of this channel in client */
u64 oChannelSpace; /* Offset in bytes to channel specific area */ u64 ch_space_offset; /* Offset in bytes to channel specific area */
u32 VersionId; /* struct channel_header Version ID */ u32 version_id; /* struct channel_header Version ID */
u32 PartitionIndex; /* Index of guest partition */ u32 partition_index; /* Index of guest partition */
uuid_le ZoneGuid; /* Guid of Channel's zone */ uuid_le zone_uuid; /* Guid of Channel's zone */
u32 oClientString; /* offset from channel header to u32 cli_str_offset; /* offset from channel header to
* nul-terminated ClientString (0 if * nul-terminated ClientString (0 if
* ClientString not present) */ * ClientString not present) */
u32 CliStateBoot; /* CHANNEL_CLIENTSTATE of pre-boot u32 cli_state_boot; /* CHANNEL_CLIENTSTATE of pre-boot
* EFI client of this channel */ * EFI client of this channel */
u32 CmdStateCli; /* CHANNEL_COMMANDSTATE (overloaded in u32 cmd_state_cli; /* CHANNEL_COMMANDSTATE (overloaded in
* Windows drivers, see ServerStateUp, * Windows drivers, see ServerStateUp,
* ServerStateDown, etc) */ * ServerStateDown, etc) */
u32 CliStateOS; /* CHANNEL_CLIENTSTATE of Guest OS u32 cli_state_os; /* CHANNEL_CLIENTSTATE of Guest OS
* client of this channel */ * client of this channel */
u32 ChannelCharacteristics; /* CHANNEL_CHARACTERISTIC_<xxx> */ u32 ch_characteristic; /* CHANNEL_CHARACTERISTIC_<xxx> */
u32 CmdStateSrv; /* CHANNEL_COMMANDSTATE (overloaded in u32 cmd_state_srv; /* CHANNEL_COMMANDSTATE (overloaded in
* Windows drivers, see ServerStateUp, * Windows drivers, see ServerStateUp,
* ServerStateDown, etc) */ * ServerStateDown, etc) */
u32 SrvState; /* CHANNEL_SERVERSTATE */ u32 srv_state; /* CHANNEL_SERVERSTATE */
u8 CliErrorBoot; /* bits to indicate err states for u8 cli_error_boot; /* bits to indicate err states for
* boot clients, so err messages can * boot clients, so err messages can
* be throttled */ * be throttled */
u8 CliErrorOS; /* bits to indicate err states for OS u8 cli_error_os; /* bits to indicate err states for OS
* clients, so err messages can be * clients, so err messages can be
* throttled */ * throttled */
u8 Filler[1]; /* Pad out to 128 byte cacheline */ u8 filler[1]; /* Pad out to 128 byte cacheline */
/* Please add all new single-byte values below here */ /* Please add all new single-byte values below here */
u8 RecoverChannel; u8 recover_channel;
}; };
#define ULTRA_CHANNEL_ENABLE_INTS (0x1ULL << 0) #define ULTRA_CHANNEL_ENABLE_INTS (0x1ULL << 0)
@ -312,8 +312,7 @@ ULTRA_check_channel_client(void __iomem *pChannel,
uuid_le guid; uuid_le guid;
memcpy_fromio(&guid, memcpy_fromio(&guid,
&((struct channel_header __iomem *) &((struct channel_header __iomem *)(pChannel))->chtype,
(pChannel))->Type,
sizeof(guid)); sizeof(guid));
/* caller wants us to verify type GUID */ /* caller wants us to verify type GUID */
if (uuid_le_cmp(guid, expectedTypeGuid) != 0) { if (uuid_le_cmp(guid, expectedTypeGuid) != 0) {
@ -327,7 +326,7 @@ ULTRA_check_channel_client(void __iomem *pChannel,
* channel size */ * channel size */
unsigned long long bytes = unsigned long long bytes =
readq(&((struct channel_header __iomem *) readq(&((struct channel_header __iomem *)
(pChannel))->Size); (pChannel))->size);
if (bytes < expectedMinBytes) { if (bytes < expectedMinBytes) {
pr_err("Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8Lx actual=0x%-8.8Lx\n", pr_err("Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8Lx actual=0x%-8.8Lx\n",
channelName, &expectedTypeGuid, channelName, &expectedTypeGuid,
@ -338,7 +337,7 @@ ULTRA_check_channel_client(void __iomem *pChannel,
if (expectedVersionId > 0) { /* caller wants us to verify if (expectedVersionId > 0) { /* caller wants us to verify
* channel version */ * channel version */
unsigned long ver = readl(&((struct channel_header __iomem *) unsigned long ver = readl(&((struct channel_header __iomem *)
(pChannel))->VersionId); (pChannel))->version_id);
if (ver != expectedVersionId) { if (ver != expectedVersionId) {
pr_err("Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8lx\n", pr_err("Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8lx\n",
channelName, &expectedTypeGuid, channelName, &expectedTypeGuid,
@ -350,7 +349,7 @@ ULTRA_check_channel_client(void __iomem *pChannel,
* channel signature */ * channel signature */
unsigned long long sig = unsigned long long sig =
readq(&((struct channel_header __iomem *) readq(&((struct channel_header __iomem *)
(pChannel))->Signature); (pChannel))->signature);
if (sig != expectedSignature) { if (sig != expectedSignature) {
pr_err("Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8llx actual=0x%-8.8llx\n", pr_err("Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8llx actual=0x%-8.8llx\n",
channelName, &expectedTypeGuid, channelName, &expectedTypeGuid,
@ -421,13 +420,13 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
{ {
struct channel_header __iomem *pChan = pChannel; struct channel_header __iomem *pChan = pChannel;
if (readl(&pChan->CliStateOS) == CHANNELCLI_DISABLED) { if (readl(&pChan->cli_state_os) == CHANNELCLI_DISABLED) {
if ((readb(&pChan->CliErrorOS) if ((readb(&pChan->cli_error_os)
& ULTRA_CLIERROROS_THROTTLEMSG_DISABLED) == 0) { & ULTRA_CLIERROROS_THROTTLEMSG_DISABLED) == 0) {
/* we are NOT throttling this message */ /* we are NOT throttling this message */
writeb(readb(&pChan->CliErrorOS) | writeb(readb(&pChan->cli_error_os) |
ULTRA_CLIERROROS_THROTTLEMSG_DISABLED, ULTRA_CLIERROROS_THROTTLEMSG_DISABLED,
&pChan->CliErrorOS); &pChan->cli_error_os);
/* throttle until acquire successful */ /* throttle until acquire successful */
pr_info("%s Channel StateTransition INVALID! - acquire failed because OS client DISABLED @%s:%d\n", pr_info("%s Channel StateTransition INVALID! - acquire failed because OS client DISABLED @%s:%d\n",
@ -436,27 +435,27 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
} }
return 0; return 0;
} }
if ((readl(&pChan->CliStateOS) != CHANNELCLI_OWNED) if ((readl(&pChan->cli_state_os) != CHANNELCLI_OWNED)
&& (readl(&pChan->CliStateBoot) == CHANNELCLI_DISABLED)) { && (readl(&pChan->cli_state_boot) == CHANNELCLI_DISABLED)) {
/* Our competitor is DISABLED, so we can transition to OWNED */ /* Our competitor is DISABLED, so we can transition to OWNED */
pr_info("%s Channel StateTransition (%s) %s(%d)-->%s(%d) @%s:%d\n", pr_info("%s Channel StateTransition (%s) %s(%d)-->%s(%d) @%s:%d\n",
chanId, "CliStateOS", chanId, "cli_state_os",
ULTRA_CHANNELCLI_STRING(readl(&pChan->CliStateOS)), ULTRA_CHANNELCLI_STRING(readl(&pChan->cli_state_os)),
readl(&pChan->CliStateOS), readl(&pChan->cli_state_os),
ULTRA_CHANNELCLI_STRING(CHANNELCLI_OWNED), ULTRA_CHANNELCLI_STRING(CHANNELCLI_OWNED),
CHANNELCLI_OWNED, CHANNELCLI_OWNED,
PathName_Last_N_Nodes((u8 *) file, 4), line); PathName_Last_N_Nodes((u8 *) file, 4), line);
writel(CHANNELCLI_OWNED, &pChan->CliStateOS); writel(CHANNELCLI_OWNED, &pChan->cli_state_os);
mb(); /* required for channel synch */ mb(); /* required for channel synch */
} }
if (readl(&pChan->CliStateOS) == CHANNELCLI_OWNED) { if (readl(&pChan->cli_state_os) == CHANNELCLI_OWNED) {
if (readb(&pChan->CliErrorOS) != 0) { if (readb(&pChan->cli_error_os) != 0) {
/* we are in an error msg throttling state; /* we are in an error msg throttling state;
* come out of it */ * come out of it */
pr_info("%s Channel OS client acquire now successful @%s:%d\n", pr_info("%s Channel OS client acquire now successful @%s:%d\n",
chanId, PathName_Last_N_Nodes((u8 *) file, 4), chanId, PathName_Last_N_Nodes((u8 *) file, 4),
line); line);
writeb(0, &pChan->CliErrorOS); writeb(0, &pChan->cli_error_os);
} }
return 1; return 1;
} }
@ -464,48 +463,48 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
/* We have to do it the "hard way". We transition to BUSY, /* We have to do it the "hard way". We transition to BUSY,
* and can use the channel iff our competitor has not also * and can use the channel iff our competitor has not also
* transitioned to BUSY. */ * transitioned to BUSY. */
if (readl(&pChan->CliStateOS) != CHANNELCLI_ATTACHED) { if (readl(&pChan->cli_state_os) != CHANNELCLI_ATTACHED) {
if ((readb(&pChan->CliErrorOS) if ((readb(&pChan->cli_error_os)
& ULTRA_CLIERROROS_THROTTLEMSG_NOTATTACHED) == 0) { & ULTRA_CLIERROROS_THROTTLEMSG_NOTATTACHED) == 0) {
/* we are NOT throttling this message */ /* we are NOT throttling this message */
writeb(readb(&pChan->CliErrorOS) | writeb(readb(&pChan->cli_error_os) |
ULTRA_CLIERROROS_THROTTLEMSG_NOTATTACHED, ULTRA_CLIERROROS_THROTTLEMSG_NOTATTACHED,
&pChan->CliErrorOS); &pChan->cli_error_os);
/* throttle until acquire successful */ /* throttle until acquire successful */
pr_info("%s Channel StateTransition INVALID! - acquire failed because OS client NOT ATTACHED (state=%s(%d)) @%s:%d\n", pr_info("%s Channel StateTransition INVALID! - acquire failed because OS client NOT ATTACHED (state=%s(%d)) @%s:%d\n",
chanId, ULTRA_CHANNELCLI_STRING( chanId, ULTRA_CHANNELCLI_STRING(
readl(&pChan->CliStateOS)), readl(&pChan->cli_state_os)),
readl(&pChan->CliStateOS), readl(&pChan->cli_state_os),
PathName_Last_N_Nodes((u8 *) file, 4), PathName_Last_N_Nodes((u8 *) file, 4),
line); line);
} }
return 0; return 0;
} }
writel(CHANNELCLI_BUSY, &pChan->CliStateOS); writel(CHANNELCLI_BUSY, &pChan->cli_state_os);
mb(); /* required for channel synch */ mb(); /* required for channel synch */
if (readl(&pChan->CliStateBoot) == CHANNELCLI_BUSY) { if (readl(&pChan->cli_state_boot) == CHANNELCLI_BUSY) {
if ((readb(&pChan->CliErrorOS) if ((readb(&pChan->cli_error_os)
& ULTRA_CLIERROROS_THROTTLEMSG_BUSY) == 0) { & ULTRA_CLIERROROS_THROTTLEMSG_BUSY) == 0) {
/* we are NOT throttling this message */ /* we are NOT throttling this message */
writeb(readb(&pChan->CliErrorOS) | writeb(readb(&pChan->cli_error_os) |
ULTRA_CLIERROROS_THROTTLEMSG_BUSY, ULTRA_CLIERROROS_THROTTLEMSG_BUSY,
&pChan->CliErrorOS); &pChan->cli_error_os);
/* throttle until acquire successful */ /* throttle until acquire successful */
pr_info("%s Channel StateTransition failed - host OS acquire failed because boot BUSY @%s:%d\n", pr_info("%s Channel StateTransition failed - host OS acquire failed because boot BUSY @%s:%d\n",
chanId, PathName_Last_N_Nodes((u8 *) file, 4), chanId, PathName_Last_N_Nodes((u8 *) file, 4),
line); line);
} }
/* reset busy */ /* reset busy */
writel(CHANNELCLI_ATTACHED, &pChan->CliStateOS); writel(CHANNELCLI_ATTACHED, &pChan->cli_state_os);
mb(); /* required for channel synch */ mb(); /* required for channel synch */
return 0; return 0;
} }
if (readb(&pChan->CliErrorOS) != 0) { if (readb(&pChan->cli_error_os) != 0) {
/* we are in an error msg throttling state; come out of it */ /* we are in an error msg throttling state; come out of it */
pr_info("%s Channel OS client acquire now successful @%s:%d\n", pr_info("%s Channel OS client acquire now successful @%s:%d\n",
chanId, PathName_Last_N_Nodes((u8 *) file, 4), chanId, PathName_Last_N_Nodes((u8 *) file, 4),
line); line);
writeb(0, &pChan->CliErrorOS); writeb(0, &pChan->cli_error_os);
} }
return 1; return 1;
} }
@ -516,24 +515,24 @@ ULTRA_channel_client_release_os(void __iomem *pChannel, u8 *chanId,
{ {
struct channel_header __iomem *pChan = pChannel; struct channel_header __iomem *pChan = pChannel;
if (readb(&pChan->CliErrorOS) != 0) { if (readb(&pChan->cli_error_os) != 0) {
/* we are in an error msg throttling state; come out of it */ /* we are in an error msg throttling state; come out of it */
pr_info("%s Channel OS client error state cleared @%s:%d\n", pr_info("%s Channel OS client error state cleared @%s:%d\n",
chanId, PathName_Last_N_Nodes((u8 *) file, 4), chanId, PathName_Last_N_Nodes((u8 *) file, 4),
line); line);
writeb(0, &pChan->CliErrorOS); writeb(0, &pChan->cli_error_os);
} }
if (readl(&pChan->CliStateOS) == CHANNELCLI_OWNED) if (readl(&pChan->cli_state_os) == CHANNELCLI_OWNED)
return; return;
if (readl(&pChan->CliStateOS) != CHANNELCLI_BUSY) { if (readl(&pChan->cli_state_os) != CHANNELCLI_BUSY) {
pr_info("%s Channel StateTransition INVALID! - release failed because OS client NOT BUSY (state=%s(%d)) @%s:%d\n", pr_info("%s Channel StateTransition INVALID! - release failed because OS client NOT BUSY (state=%s(%d)) @%s:%d\n",
chanId, ULTRA_CHANNELCLI_STRING( chanId, ULTRA_CHANNELCLI_STRING(
readl(&pChan->CliStateOS)), readl(&pChan->cli_state_os)),
readl(&pChan->CliStateOS), readl(&pChan->cli_state_os),
PathName_Last_N_Nodes((u8 *) file, 4), line); PathName_Last_N_Nodes((u8 *) file, 4), line);
/* return; */ /* return; */
} }
writel(CHANNELCLI_ATTACHED, &pChan->CliStateOS); /* release busy */ writel(CHANNELCLI_ATTACHED, &pChan->cli_state_os); /* release busy */
} }
/* /*

View File

@ -750,29 +750,29 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
#define QSIZEFROMBYTES(bytes) (QSLOTSFROMBYTES(bytes)*SIZEOF_CMDRSP) #define QSIZEFROMBYTES(bytes) (QSLOTSFROMBYTES(bytes)*SIZEOF_CMDRSP)
#define SignalQInit(x) \ #define SignalQInit(x) \
do { \ do { \
x->cmdQ.Size = QSIZEFROMBYTES(x->ChannelHeader.Size); \ x->cmdQ.Size = QSIZEFROMBYTES(x->ChannelHeader.size); \
x->cmdQ.oSignalBase = SIZEOF_PROTOCOL - \ x->cmdQ.oSignalBase = SIZEOF_PROTOCOL - \
offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \ offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \
x->cmdQ.SignalSize = SIZEOF_CMDRSP; \ x->cmdQ.SignalSize = SIZEOF_CMDRSP; \
x->cmdQ.MaxSignalSlots = \ x->cmdQ.MaxSignalSlots = \
QSLOTSFROMBYTES(x->ChannelHeader.Size); \ QSLOTSFROMBYTES(x->ChannelHeader.size); \
x->cmdQ.MaxSignals = x->cmdQ.MaxSignalSlots - 1; \ x->cmdQ.MaxSignals = x->cmdQ.MaxSignalSlots - 1; \
x->rspQ.Size = QSIZEFROMBYTES(x->ChannelHeader.Size); \ x->rspQ.Size = QSIZEFROMBYTES(x->ChannelHeader.size); \
x->rspQ.oSignalBase = \ x->rspQ.oSignalBase = \
(SIZEOF_PROTOCOL + x->cmdQ.Size) - \ (SIZEOF_PROTOCOL + x->cmdQ.Size) - \
offsetof(ULTRA_IO_CHANNEL_PROTOCOL, rspQ); \ offsetof(ULTRA_IO_CHANNEL_PROTOCOL, rspQ); \
x->rspQ.SignalSize = SIZEOF_CMDRSP; \ x->rspQ.SignalSize = SIZEOF_CMDRSP; \
x->rspQ.MaxSignalSlots = \ x->rspQ.MaxSignalSlots = \
QSLOTSFROMBYTES(x->ChannelHeader.Size); \ QSLOTSFROMBYTES(x->ChannelHeader.size); \
x->rspQ.MaxSignals = x->rspQ.MaxSignalSlots - 1; \ x->rspQ.MaxSignals = x->rspQ.MaxSignalSlots - 1; \
x->ChannelHeader.oChannelSpace = \ x->ChannelHeader.ch_space_offset = \
offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \ offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ); \
} while (0) } while (0)
#define INIT_CLIENTSTRING(chan, type, clientStr, clientStrLen) \ #define INIT_CLIENTSTRING(chan, type, clientStr, clientStrLen) \
do { \ do { \
if (clientStr) { \ if (clientStr) { \
chan->ChannelHeader.oClientString = \ chan->ChannelHeader.cli_str_offset = \
offsetof(type, clientString); \ offsetof(type, clientString); \
memcpy(chan->clientString, clientStr, \ memcpy(chan->clientString, clientStr, \
MINNUM(clientStrLen, \ MINNUM(clientStrLen, \
@ -802,13 +802,13 @@ static inline int ULTRA_VHBA_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
unsigned char *clientStr, unsigned char *clientStr,
u32 clientStrLen, u64 bytes) { u32 clientStrLen, u64 bytes) {
memset(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL)); memset(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL));
x->ChannelHeader.VersionId = ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID; x->ChannelHeader.version_id = ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID;
x->ChannelHeader.Signature = ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE; x->ChannelHeader.signature = ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE;
x->ChannelHeader.SrvState = CHANNELSRV_UNINITIALIZED; x->ChannelHeader.srv_state = CHANNELSRV_UNINITIALIZED;
x->ChannelHeader.HeaderSize = sizeof(x->ChannelHeader); x->ChannelHeader.header_size = sizeof(x->ChannelHeader);
x->ChannelHeader.Size = COVER(bytes, 4096); x->ChannelHeader.size = COVER(bytes, 4096);
x->ChannelHeader.Type = spar_vhba_channel_protocol_uuid; x->ChannelHeader.chtype = spar_vhba_channel_protocol_uuid;
x->ChannelHeader.ZoneGuid = NULL_UUID_LE; x->ChannelHeader.zone_uuid = NULL_UUID_LE;
x->vhba.wwnn = *wwnn; x->vhba.wwnn = *wwnn;
x->vhba.max = *max; x->vhba.max = *max;
INIT_CLIENTSTRING(x, ULTRA_IO_CHANNEL_PROTOCOL, clientStr, INIT_CLIENTSTRING(x, ULTRA_IO_CHANNEL_PROTOCOL, clientStr,
@ -838,13 +838,13 @@ static inline int ULTRA_VNIC_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
u32 clientStrLen, u32 clientStrLen,
u64 bytes) { u64 bytes) {
memset(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL)); memset(x, 0, sizeof(ULTRA_IO_CHANNEL_PROTOCOL));
x->ChannelHeader.VersionId = ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID; x->ChannelHeader.version_id = ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID;
x->ChannelHeader.Signature = ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE; x->ChannelHeader.signature = ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE;
x->ChannelHeader.SrvState = CHANNELSRV_UNINITIALIZED; x->ChannelHeader.srv_state = CHANNELSRV_UNINITIALIZED;
x->ChannelHeader.HeaderSize = sizeof(x->ChannelHeader); x->ChannelHeader.header_size = sizeof(x->ChannelHeader);
x->ChannelHeader.Size = COVER(bytes, 4096); x->ChannelHeader.size = COVER(bytes, 4096);
x->ChannelHeader.Type = spar_vnic_channel_protocol_uuid; x->ChannelHeader.chtype = spar_vnic_channel_protocol_uuid;
x->ChannelHeader.ZoneGuid = NULL_UUID_LE; x->ChannelHeader.zone_uuid = NULL_UUID_LE;
memcpy(x->vnic.macaddr, macaddr, MAX_MACADDR_LEN); memcpy(x->vnic.macaddr, macaddr, MAX_MACADDR_LEN);
x->vnic.num_rcv_bufs = num_rcv_bufs; x->vnic.num_rcv_bufs = num_rcv_bufs;
x->vnic.mtu = mtu; x->vnic.mtu = mtu;

View File

@ -448,7 +448,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
struct channel_header struct channel_header
__iomem *) (dev-> __iomem *) (dev->
chanptr))-> chanptr))->
Type); chtype);
if (!ULTRA_VHBA_CHANNEL_OK_CLIENT if (!ULTRA_VHBA_CHANNEL_OK_CLIENT
(dev->chanptr, NULL)) { (dev->chanptr, NULL)) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed:[CLIENT]VHBA dev %d chan invalid.", LOGERR("CONTROLVM_DEVICE_CREATE Failed:[CLIENT]VHBA dev %d chan invalid.",
@ -474,7 +474,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
struct channel_header struct channel_header
__iomem *) (dev-> __iomem *) (dev->
chanptr))-> chanptr))->
Type); chtype);
if (!ULTRA_VNIC_CHANNEL_OK_CLIENT if (!ULTRA_VNIC_CHANNEL_OK_CLIENT
(dev->chanptr, NULL)) { (dev->chanptr, NULL)) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed: VNIC[CLIENT] dev %d chan invalid.", LOGERR("CONTROLVM_DEVICE_CREATE Failed: VNIC[CLIENT] dev %d chan invalid.",

View File

@ -429,9 +429,9 @@ virthba_ISR(int irq, void *dev_id)
return IRQ_NONE; return IRQ_NONE;
virthbainfo->interrupts_rcvd++; virthbainfo->interrupts_rcvd++;
pChannelHeader = virthbainfo->chinfo.queueinfo->chan; pChannelHeader = virthbainfo->chinfo.queueinfo->chan;
if (((readq(&pChannelHeader->Features) if (((readq(&pChannelHeader->features)
& ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS) != 0) & ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS) != 0)
&& ((readq(&pChannelHeader->Features) & && ((readq(&pChannelHeader->features) &
ULTRA_IO_DRIVER_DISABLES_INTS) != ULTRA_IO_DRIVER_DISABLES_INTS) !=
0)) { 0)) {
virthbainfo->interrupts_disabled++; virthbainfo->interrupts_disabled++;
@ -444,7 +444,7 @@ virthba_ISR(int irq, void *dev_id)
} }
pqhdr = (SIGNAL_QUEUE_HEADER __iomem *) pqhdr = (SIGNAL_QUEUE_HEADER __iomem *)
((char __iomem *) pChannelHeader + ((char __iomem *) pChannelHeader +
readq(&pChannelHeader->oChannelSpace)) + IOCHAN_FROM_IOPART; readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART;
writeq(readq(&pqhdr->NumInterruptsReceived) + 1, writeq(readq(&pqhdr->NumInterruptsReceived) + 1,
&pqhdr->NumInterruptsReceived); &pqhdr->NumInterruptsReceived);
atomic_set(&virthbainfo->interrupt_rcvd, 1); atomic_set(&virthbainfo->interrupt_rcvd, 1);
@ -578,9 +578,9 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
INIT_WORK(&virthbainfo->serverdown_completion, INIT_WORK(&virthbainfo->serverdown_completion,
virthba_serverdown_complete); virthba_serverdown_complete);
writeq(readq(&virthbainfo->chinfo.queueinfo->chan->Features) | writeq(readq(&virthbainfo->chinfo.queueinfo->chan->features) |
ULTRA_IO_CHANNEL_IS_POLLING, ULTRA_IO_CHANNEL_IS_POLLING,
&virthbainfo->chinfo.queueinfo->chan->Features); &virthbainfo->chinfo.queueinfo->chan->features);
/* start thread that will receive scsicmnd responses */ /* start thread that will receive scsicmnd responses */
DBGINF("starting rsp thread -- queueinfo: 0x%p, threadinfo: 0x%p.\n", DBGINF("starting rsp thread -- queueinfo: 0x%p, threadinfo: 0x%p.\n",
virthbainfo->chinfo.queueinfo, &virthbainfo->chinfo.threadinfo); virthbainfo->chinfo.queueinfo, &virthbainfo->chinfo.threadinfo);
@ -588,7 +588,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
pChannelHeader = virthbainfo->chinfo.queueinfo->chan; pChannelHeader = virthbainfo->chinfo.queueinfo->chan;
pqhdr = (SIGNAL_QUEUE_HEADER __iomem *) pqhdr = (SIGNAL_QUEUE_HEADER __iomem *)
((char __iomem *)pChannelHeader + ((char __iomem *)pChannelHeader +
readq(&pChannelHeader->oChannelSpace)) + IOCHAN_FROM_IOPART; readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART;
virthbainfo->flags_addr = &pqhdr->FeatureFlags; virthbainfo->flags_addr = &pqhdr->FeatureFlags;
if (!uisthread_start(&virthbainfo->chinfo.threadinfo, if (!uisthread_start(&virthbainfo->chinfo.threadinfo,
@ -622,7 +622,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
POSTCODE_LINUX_2(VHBA_PROBE_FAILURE_PC, POSTCODE_SEVERITY_ERR); POSTCODE_LINUX_2(VHBA_PROBE_FAILURE_PC, POSTCODE_SEVERITY_ERR);
} else { } else {
u64 __iomem *Features_addr = u64 __iomem *Features_addr =
&virthbainfo->chinfo.queueinfo->chan->Features; &virthbainfo->chinfo.queueinfo->chan->features;
LOGERR("request_irq(%d) uislib_virthba_ISR request succeeded\n", LOGERR("request_irq(%d) uislib_virthba_ISR request succeeded\n",
virthbainfo->interrupt_vector); virthbainfo->interrupt_vector);
mask = ~(ULTRA_IO_CHANNEL_IS_POLLING | mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
@ -1453,7 +1453,7 @@ static ssize_t enable_ints_write(struct file *file,
if (VirtHbasOpen[i].virthbainfo != NULL) { if (VirtHbasOpen[i].virthbainfo != NULL) {
virthbainfo = VirtHbasOpen[i].virthbainfo; virthbainfo = VirtHbasOpen[i].virthbainfo;
Features_addr = Features_addr =
&virthbainfo->chinfo.queueinfo->chan->Features; &virthbainfo->chinfo.queueinfo->chan->features;
if (new_value == 1) { if (new_value == 1) {
mask = ~(ULTRA_IO_CHANNEL_IS_POLLING | mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
ULTRA_IO_DRIVER_DISABLES_INTS); ULTRA_IO_DRIVER_DISABLES_INTS);

View File

@ -89,10 +89,10 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes,
} }
if (channelBytes == 0) if (channelBytes == 0)
/* we had better be a CLIENT of this channel */ /* we had better be a CLIENT of this channel */
channelBytes = (ulong) p->chan_hdr.Size; channelBytes = (ulong) p->chan_hdr.size;
if (uuid_le_cmp(guid, NULL_UUID_LE) == 0) if (uuid_le_cmp(guid, NULL_UUID_LE) == 0)
/* we had better be a CLIENT of this channel */ /* we had better be a CLIENT of this channel */
guid = p->chan_hdr.Type; guid = p->chan_hdr.chtype;
if (visor_memregion_resize(p->memregion, channelBytes) < 0) { if (visor_memregion_resize(p->memregion, channelBytes) < 0) {
ERRDRV("visor_memregion_resize failed: (status=0)\n"); ERRDRV("visor_memregion_resize failed: (status=0)\n");
rc = NULL; rc = NULL;
@ -194,14 +194,14 @@ EXPORT_SYMBOL_GPL(visorchannel_id);
char * char *
visorchannel_zoneid(VISORCHANNEL *channel, char *s) visorchannel_zoneid(VISORCHANNEL *channel, char *s)
{ {
return visorchannel_uuid_id(&channel->chan_hdr.ZoneGuid, s); return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
} }
EXPORT_SYMBOL_GPL(visorchannel_zoneid); EXPORT_SYMBOL_GPL(visorchannel_zoneid);
HOSTADDRESS HOSTADDRESS
visorchannel_get_clientpartition(VISORCHANNEL *channel) visorchannel_get_clientpartition(VISORCHANNEL *channel)
{ {
return channel->chan_hdr.PartitionHandle; return channel->chan_hdr.partition_handle;
} }
EXPORT_SYMBOL_GPL(visorchannel_get_clientpartition); EXPORT_SYMBOL_GPL(visorchannel_get_clientpartition);
@ -295,7 +295,7 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
* channel header * channel header
*/ */
#define SIG_QUEUE_OFFSET(chan_hdr, q) \ #define SIG_QUEUE_OFFSET(chan_hdr, q) \
((chan_hdr)->oChannelSpace + ((q) * sizeof(SIGNAL_QUEUE_HEADER))) ((chan_hdr)->ch_space_offset + ((q) * sizeof(SIGNAL_QUEUE_HEADER)))
/** Return offset of a specific queue entry (data) from the beginning of a /** Return offset of a specific queue entry (data) from the beginning of a
* channel header * channel header
@ -320,7 +320,7 @@ sig_read_header(VISORCHANNEL *channel, u32 queue,
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
if (channel->chan_hdr.oChannelSpace < sizeof(struct channel_header)) { if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header)) {
ERRDRV("oChannelSpace too small: (status=%d)\n", rc); ERRDRV("oChannelSpace too small: (status=%d)\n", rc);
goto Away; goto Away;
} }
@ -591,36 +591,36 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues,
} else } else
return; return;
} }
nbytes = (ulong) (phdr->Size); nbytes = (ulong) (phdr->size);
seq_printf(seq, "--- Begin channel @0x%-16.16Lx for 0x%lx bytes (region=0x%lx bytes) ---\n", seq_printf(seq, "--- Begin channel @0x%-16.16Lx for 0x%lx bytes (region=0x%lx bytes) ---\n",
addr + off, nbytes, nbytes_region); addr + off, nbytes, nbytes_region);
seq_printf(seq, "Type = %pUL\n", &phdr->Type); seq_printf(seq, "Type = %pUL\n", &phdr->chtype);
seq_printf(seq, "ZoneGuid = %pUL\n", &phdr->ZoneGuid); seq_printf(seq, "ZoneGuid = %pUL\n", &phdr->zone_uuid);
seq_printf(seq, "Signature = 0x%-16.16Lx\n", seq_printf(seq, "Signature = 0x%-16.16Lx\n",
(long long) phdr->Signature); (long long) phdr->signature);
seq_printf(seq, "LegacyState = %lu\n", (ulong) phdr->LegacyState); seq_printf(seq, "LegacyState = %lu\n", (ulong)phdr->legacy_state);
seq_printf(seq, "SrvState = %lu\n", (ulong) phdr->SrvState); seq_printf(seq, "SrvState = %lu\n", (ulong)phdr->srv_state);
seq_printf(seq, "CliStateBoot = %lu\n", (ulong) phdr->CliStateBoot); seq_printf(seq, "CliStateBoot = %lu\n", (ulong)phdr->cli_state_boot);
seq_printf(seq, "CliStateOS = %lu\n", (ulong) phdr->CliStateOS); seq_printf(seq, "CliStateOS = %lu\n", (ulong)phdr->cli_state_os);
seq_printf(seq, "HeaderSize = %lu\n", (ulong) phdr->HeaderSize); seq_printf(seq, "HeaderSize = %lu\n", (ulong)phdr->header_size);
seq_printf(seq, "Size = %llu\n", (long long) phdr->Size); seq_printf(seq, "Size = %llu\n", (long long)phdr->size);
seq_printf(seq, "Features = 0x%-16.16llx\n", seq_printf(seq, "Features = 0x%-16.16llx\n",
(long long) phdr->Features); (long long) phdr->features);
seq_printf(seq, "PartitionHandle = 0x%-16.16llx\n", seq_printf(seq, "PartitionHandle = 0x%-16.16llx\n",
(long long) phdr->PartitionHandle); (long long) phdr->partition_handle);
seq_printf(seq, "Handle = 0x%-16.16llx\n", seq_printf(seq, "Handle = 0x%-16.16llx\n",
(long long) phdr->Handle); (long long) phdr->handle);
seq_printf(seq, "VersionId = %lu\n", (ulong) phdr->VersionId); seq_printf(seq, "VersionId = %lu\n", (ulong) phdr->version_id);
seq_printf(seq, "oChannelSpace = %llu\n", seq_printf(seq, "oChannelSpace = %llu\n",
(long long) phdr->oChannelSpace); (long long) phdr->ch_space_offset);
if ((phdr->oChannelSpace == 0) || (errcode < 0)) if ((phdr->ch_space_offset == 0) || (errcode < 0))
; ;
else else
for (i = 0; i < nQueues; i++) { for (i = 0; i < nQueues; i++) {
SIGNAL_QUEUE_HEADER q; SIGNAL_QUEUE_HEADER q;
errcode = visorchannel_read(channel, errcode = visorchannel_read(channel,
off + phdr->oChannelSpace + off + phdr->ch_space_offset +
(i * sizeof(q)), (i * sizeof(q)),
&q, sizeof(q)); &q, sizeof(q));
if (errcode < 0) { if (errcode < 0) {