Staging: hv: fix typedefs in nvspprotocol.h

It's all clean now.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-08-28 16:20:53 -07:00
Родитель abb7aacb50
Коммит 223c1aa632
3 изменённых файлов: 90 добавлений и 88 удалений

Просмотреть файл

@ -236,8 +236,8 @@ NetVscInitialize(
DPRINT_ENTER(NETVSC);
DPRINT_DBG(NETVSC, "sizeof(struct hv_netvsc_packet)=%zd, sizeof(NVSP_MESSAGE)=%zd, sizeof(struct vmtransfer_page_packet_header)=%zd",
sizeof(struct hv_netvsc_packet), sizeof(NVSP_MESSAGE), sizeof(struct vmtransfer_page_packet_header));
DPRINT_DBG(NETVSC, "sizeof(struct hv_netvsc_packet)=%zd, sizeof(struct nvsp_message)=%zd, sizeof(struct vmtransfer_page_packet_header)=%zd",
sizeof(struct hv_netvsc_packet), sizeof(struct nvsp_message), sizeof(struct vmtransfer_page_packet_header));
/* Make sure we are at least 2 pages since 1 page is used for control */
ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1));
@ -270,7 +270,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
{
int ret=0;
struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *initPacket;
struct nvsp_message *initPacket;
DPRINT_ENTER(NETVSC);
@ -318,7 +318,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
initPacket = &netDevice->ChannelInitPacket;
memset(initPacket, 0, sizeof(NVSP_MESSAGE));
memset(initPacket, 0, sizeof(struct nvsp_message));
initPacket->Header.MessageType = NvspMessage1TypeSendReceiveBuffer;
initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->ReceiveBufferGpadlHandle;
@ -327,7 +327,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
/* Send the gpadl notification request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)initPacket,
VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
@ -355,7 +355,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
netDevice->ReceiveSectionCount = initPacket->Messages.Version1Messages.SendReceiveBufferComplete.NumSections;
netDevice->ReceiveSections = kmalloc(netDevice->ReceiveSectionCount * sizeof(NVSP_1_RECEIVE_BUFFER_SECTION), GFP_KERNEL);
netDevice->ReceiveSections = kmalloc(netDevice->ReceiveSectionCount * sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL);
if (netDevice->ReceiveSections == NULL)
{
ret = -1;
@ -364,7 +364,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
memcpy(netDevice->ReceiveSections,
initPacket->Messages.Version1Messages.SendReceiveBufferComplete.Sections,
netDevice->ReceiveSectionCount * sizeof(NVSP_1_RECEIVE_BUFFER_SECTION));
netDevice->ReceiveSectionCount * sizeof(struct nvsp_1_receive_buffer_section));
DPRINT_INFO(NETVSC,
"Receive sections info (count %d, offset %d, endoffset %d, suballoc size %d, num suballocs %d)",
@ -399,7 +399,7 @@ NetVscInitializeSendBufferWithNetVsp(
{
int ret=0;
struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *initPacket;
struct nvsp_message *initPacket;
DPRINT_ENTER(NETVSC);
@ -447,7 +447,7 @@ NetVscInitializeSendBufferWithNetVsp(
initPacket = &netDevice->ChannelInitPacket;
memset(initPacket, 0, sizeof(NVSP_MESSAGE));
memset(initPacket, 0, sizeof(struct nvsp_message));
initPacket->Header.MessageType = NvspMessage1TypeSendSendBuffer;
initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->SendBufferGpadlHandle;
@ -456,7 +456,7 @@ NetVscInitializeSendBufferWithNetVsp(
/* Send the gpadl notification request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)initPacket,
VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
@ -496,7 +496,7 @@ NetVscDestroyReceiveBuffer(
struct NETVSC_DEVICE *NetDevice
)
{
NVSP_MESSAGE *revokePacket;
struct nvsp_message *revokePacket;
int ret=0;
@ -514,14 +514,14 @@ NetVscDestroyReceiveBuffer(
/* Send the revoke receive buffer */
revokePacket = &NetDevice->RevokePacket;
memset(revokePacket, 0, sizeof(NVSP_MESSAGE));
memset(revokePacket, 0, sizeof(struct nvsp_message));
revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer;
revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID;
ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device,
revokePacket,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)revokePacket,
VmbusPacketTypeDataInBand,
0);
@ -584,7 +584,7 @@ NetVscDestroySendBuffer(
struct NETVSC_DEVICE *NetDevice
)
{
NVSP_MESSAGE *revokePacket;
struct nvsp_message *revokePacket;
int ret=0;
@ -602,14 +602,14 @@ NetVscDestroySendBuffer(
/* Send the revoke send buffer */
revokePacket = &NetDevice->RevokePacket;
memset(revokePacket, 0, sizeof(NVSP_MESSAGE));
memset(revokePacket, 0, sizeof(struct nvsp_message));
revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer;
revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID;
ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device,
revokePacket,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)revokePacket,
VmbusPacketTypeDataInBand,
0);
@ -663,7 +663,7 @@ NetVscConnectToVsp(
{
int ret=0;
struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *initPacket;
struct nvsp_message *initPacket;
int ndisVersion;
DPRINT_ENTER(NETVSC);
@ -678,7 +678,7 @@ NetVscConnectToVsp(
initPacket = &netDevice->ChannelInitPacket;
memset(initPacket, 0, sizeof(NVSP_MESSAGE));
memset(initPacket, 0, sizeof(struct nvsp_message));
initPacket->Header.MessageType = NvspMessageTypeInit;
initPacket->Messages.InitMessages.Init.MinProtocolVersion = NVSP_MIN_PROTOCOL_VERSION;
initPacket->Messages.InitMessages.Init.MaxProtocolVersion = NVSP_MAX_PROTOCOL_VERSION;
@ -688,7 +688,7 @@ NetVscConnectToVsp(
/* Send the init request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)initPacket,
VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
@ -724,7 +724,7 @@ NetVscConnectToVsp(
DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendNdisVersion...");
/* Send the ndis version */
memset(initPacket, 0, sizeof(NVSP_MESSAGE));
memset(initPacket, 0, sizeof(struct nvsp_message));
ndisVersion = 0x00050000;
@ -735,7 +735,7 @@ NetVscConnectToVsp(
/* Send the init request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)initPacket,
VmbusPacketTypeDataInBand,
0);
@ -995,7 +995,7 @@ NetVscOnSendCompletion(
)
{
struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *nvspPacket;
struct nvsp_message *nvspPacket;
struct hv_netvsc_packet *nvscPacket;
DPRINT_ENTER(NETVSC);
@ -1008,7 +1008,7 @@ NetVscOnSendCompletion(
return;
}
nvspPacket = (NVSP_MESSAGE*)((unsigned long)Packet + (Packet->DataOffset8 << 3));
nvspPacket = (struct nvsp_message *)((unsigned long)Packet + (Packet->DataOffset8 << 3));
DPRINT_DBG(NETVSC, "send completion packet - type %d", nvspPacket->Header.MessageType);
@ -1017,7 +1017,7 @@ NetVscOnSendCompletion(
nvspPacket->Header.MessageType == NvspMessage1TypeSendSendBufferComplete)
{
/* Copy the response back */
memcpy(&netDevice->ChannelInitPacket, nvspPacket, sizeof(NVSP_MESSAGE));
memcpy(&netDevice->ChannelInitPacket, nvspPacket, sizeof(struct nvsp_message));
osd_WaitEventSet(netDevice->ChannelInitEvent);
}
else if (nvspPacket->Header.MessageType == NvspMessage1TypeSendRNDISPacketComplete)
@ -1051,7 +1051,7 @@ NetVscOnSend(
struct NETVSC_DEVICE *netDevice;
int ret=0;
NVSP_MESSAGE sendMessage;
struct nvsp_message sendMessage;
DPRINT_ENTER(NETVSC);
@ -1079,14 +1079,14 @@ NetVscOnSend(
Packet->PageBuffers,
Packet->PageBufferCount,
&sendMessage,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)Packet);
}
else
{
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
&sendMessage,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
(unsigned long)Packet,
VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
@ -1114,7 +1114,7 @@ NetVscOnReceive(
{
struct NETVSC_DEVICE *netDevice;
struct vmtransfer_page_packet_header *vmxferpagePacket;
NVSP_MESSAGE *nvspPacket;
struct nvsp_message *nvspPacket;
struct hv_netvsc_packet *netvscPacket=NULL;
LIST_ENTRY* entry;
unsigned long start;
@ -1145,7 +1145,7 @@ NetVscOnReceive(
return;
}
nvspPacket = (NVSP_MESSAGE*)((unsigned long)Packet + (Packet->DataOffset8 << 3));
nvspPacket = (struct nvsp_message*)((unsigned long)Packet + (Packet->DataOffset8 << 3));
/* Make sure this is a valid nvsp packet */
if (nvspPacket->Header.MessageType != NvspMessage1TypeSendRNDISPacket )
@ -1305,7 +1305,7 @@ NetVscSendReceiveCompletion(
u64 TransactionId
)
{
NVSP_MESSAGE recvcompMessage;
struct nvsp_message recvcompMessage;
int retries=0;
int ret=0;
@ -1320,7 +1320,7 @@ retry_send_cmplt:
/* Send the completion */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
&recvcompMessage,
sizeof(NVSP_MESSAGE),
sizeof(struct nvsp_message),
TransactionId,
VmbusPacketTypeCompletion,
0);

Просмотреть файл

@ -72,13 +72,13 @@ struct NETVSC_DEVICE {
u32 ReceiveBufferSize;
u32 ReceiveBufferGpadlHandle;
u32 ReceiveSectionCount;
PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections;
struct nvsp_1_receive_buffer_section *ReceiveSections;
/* Used for NetVSP initialization protocol */
struct osd_waitevent *ChannelInitEvent;
NVSP_MESSAGE ChannelInitPacket;
struct nvsp_message ChannelInitPacket;
NVSP_MESSAGE RevokePacket;
struct nvsp_message RevokePacket;
/* unsigned char HwMacAddr[HW_MACADDR_LEN]; */
/* Holds rndis device info */

Просмотреть файл

@ -29,7 +29,7 @@
#define NVSP_MIN_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
#define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
typedef enum _NVSP_MESSAGE_TYPE {
enum {
NvspMessageTypeNone = 0,
/* Init Messages */
@ -57,9 +57,9 @@ typedef enum _NVSP_MESSAGE_TYPE {
* the maximum number of messages.
*/
NvspNumMessagePerVersion = 9,
} NVSP_MESSAGE_TYPE, *PNVSP_MESSAGE_TYPE;
};
typedef enum _NVSP_STATUS {
enum {
NvspStatusNone = 0,
NvspStatusSuccess,
NvspStatusFailure,
@ -68,11 +68,11 @@ typedef enum _NVSP_STATUS {
NvspStatusInvalidRndisPacket,
NvspStatusBusy,
NvspStatusMax,
} NVSP_STATUS, *PNVSP_STATUS;
};
typedef struct _NVSP_MESSAGE_HEADER {
struct nvsp_message_header {
u32 MessageType;
} NVSP_MESSAGE_HEADER, *PNVSP_MESSAGE_HEADER;
};
/* Init Messages */
@ -81,26 +81,26 @@ typedef struct _NVSP_MESSAGE_HEADER {
* has been opened. This message should never include anything other then
* versioning (i.e. this message will be the same for ever).
*/
typedef struct _NVSP_MESSAGE_INIT {
struct nvsp_message_init {
u32 MinProtocolVersion;
u32 MaxProtocolVersion;
} __attribute__((packed)) NVSP_MESSAGE_INIT, *PNVSP_MESSAGE_INIT;
} __attribute__((packed));
/*
* This message is used by the VSP to complete the initialization of the
* channel. This message should never include anything other then versioning
* (i.e. this message will be the same for ever).
*/
typedef struct _NVSP_MESSAGE_INIT_COMPLETE {
struct nvsp_message_init_complete {
u32 NegotiatedProtocolVersion;
u32 MaximumMdlChainLength;
u32 Status;
} __attribute__((packed)) NVSP_MESSAGE_INIT_COMPLETE, *PNVSP_MESSAGE_INIT_COMPLETE;
} __attribute__((packed));
typedef union _NVSP_MESSAGE_INIT_UBER {
NVSP_MESSAGE_INIT Init;
NVSP_MESSAGE_INIT_COMPLETE InitComplete;
} __attribute__((packed)) NVSP_MESSAGE_INIT_UBER;
union nvsp_message_init_uber {
struct nvsp_message_init Init;
struct nvsp_message_init_complete InitComplete;
} __attribute__((packed));
/* Version 1 Messages */
@ -108,33 +108,33 @@ typedef union _NVSP_MESSAGE_INIT_UBER {
* This message is used by the VSC to send the NDIS version to the VSP. The VSP
* can use this information when handling OIDs sent by the VSC.
*/
typedef struct _NVSP_1_MESSAGE_SEND_NDIS_VERSION {
struct nvsp_1_message_send_ndis_version {
u32 NdisMajorVersion;
u32 NdisMinorVersion;
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_NDIS_VERSION, *PNVSP_1_MESSAGE_SEND_NDIS_VERSION;
} __attribute__((packed));
/*
* This message is used by the VSC to send a receive buffer to the VSP. The VSP
* can then use the receive buffer to send data to the VSC.
*/
typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER {
struct nvsp_1_message_send_receive_buffer {
u32 GpadlHandle;
u16 Id;
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER, *PNVSP_1_MESSAGE_SEND_RECEIVE_BUFFER;
} __attribute__((packed));
typedef struct _NVSP_1_RECEIVE_BUFFER_SECTION {
struct nvsp_1_receive_buffer_section {
u32 Offset;
u32 SubAllocationSize;
u32 NumSubAllocations;
u32 EndOffset;
} __attribute__((packed)) NVSP_1_RECEIVE_BUFFER_SECTION, *PNVSP_1_RECEIVE_BUFFER_SECTION;
} __attribute__((packed));
/*
* This message is used by the VSP to acknowledge a receive buffer send by the
* VSC. This message must be sent by the VSP before the VSP uses the receive
* buffer.
*/
typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE {
struct nvsp_1_message_send_receive_buffer_complete {
u32 Status;
u32 NumSections;
@ -157,33 +157,33 @@ typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE {
* LargeOffset SmallOffset
*/
NVSP_1_RECEIVE_BUFFER_SECTION Sections[1];
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE, *PNVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE;
struct nvsp_1_receive_buffer_section Sections[1];
} __attribute__((packed));
/*
* This message is sent by the VSC to revoke the receive buffer. After the VSP
* completes this transaction, the vsp should never use the receive buffer
* again.
*/
typedef struct _NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER {
struct nvsp_1_message_revoke_receive_buffer {
u16 Id;
} NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER, *PNVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER;
};
/*
* This message is used by the VSC to send a send buffer to the VSP. The VSC
* can then use the send buffer to send data to the VSP.
*/
typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER {
struct nvsp_1_message_send_send_buffer {
u32 GpadlHandle;
u16 Id;
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_SEND_BUFFER, *PNVSP_1_MESSAGE_SEND_SEND_BUFFER;
} __attribute__((packed));
/*
* This message is used by the VSP to acknowledge a send buffer sent by the
* VSC. This message must be sent by the VSP before the VSP uses the sent
* buffer.
*/
typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE {
struct nvsp_1_message_send_send_buffer_complete {
u32 Status;
/*
@ -193,21 +193,21 @@ typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE {
* decreases.
*/
u32 SectionSize;
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE, *PNVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE;
} __attribute__((packed));
/*
* This message is sent by the VSC to revoke the send buffer. After the VSP
* completes this transaction, the vsp should never use the send buffer again.
*/
typedef struct _NVSP_1_MESSAGE_REVOKE_SEND_BUFFER {
struct nvsp_1_message_revoke_send_buffer {
u16 Id;
} NVSP_1_MESSAGE_REVOKE_SEND_BUFFER, *PNVSP_1_MESSAGE_REVOKE_SEND_BUFFER;
};
/*
* This message is used by both the VSP and the VSC to send a RNDIS message to
* the opposite channel endpoint.
*/
typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET {
struct nvsp_1_message_send_rndis_packet {
/*
* This field is specified by RNIDS. They assume there's two different
* channels of communication. However, the Network VSP only has one.
@ -223,40 +223,42 @@ typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET {
*/
u32 SendBufferSectionIndex;
u32 SendBufferSectionSize;
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_RNDIS_PACKET, *PNVSP_1_MESSAGE_SEND_RNDIS_PACKET;
} __attribute__((packed));
/*
* This message is used by both the VSP and the VSC to complete a RNDIS message
* to the opposite channel endpoint. At this point, the initiator of this
* message cannot use any resources associated with the original RNDIS packet.
*/
typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE {
struct nvsp_1_message_send_rndis_packet_complete {
u32 Status;
} NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE, *PNVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE;
};
typedef union _NVSP_MESSAGE_1_UBER {
NVSP_1_MESSAGE_SEND_NDIS_VERSION SendNdisVersion;
union nvsp_1_message_uber {
struct nvsp_1_message_send_ndis_version SendNdisVersion;
NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER SendReceiveBuffer;
NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE SendReceiveBufferComplete;
NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER RevokeReceiveBuffer;
struct nvsp_1_message_send_receive_buffer SendReceiveBuffer;
struct nvsp_1_message_send_receive_buffer_complete
SendReceiveBufferComplete;
struct nvsp_1_message_revoke_receive_buffer RevokeReceiveBuffer;
NVSP_1_MESSAGE_SEND_SEND_BUFFER SendSendBuffer;
NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE SendSendBufferComplete;
NVSP_1_MESSAGE_REVOKE_SEND_BUFFER RevokeSendBuffer;
struct nvsp_1_message_send_send_buffer SendSendBuffer;
struct nvsp_1_message_send_send_buffer_complete SendSendBufferComplete;
struct nvsp_1_message_revoke_send_buffer RevokeSendBuffer;
NVSP_1_MESSAGE_SEND_RNDIS_PACKET SendRNDISPacket;
NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE SendRNDISPacketComplete;
} __attribute__((packed)) NVSP_1_MESSAGE_UBER;
struct nvsp_1_message_send_rndis_packet SendRNDISPacket;
struct nvsp_1_message_send_rndis_packet_complete
SendRNDISPacketComplete;
} __attribute__((packed));
typedef union _NVSP_ALL_MESSAGES {
NVSP_MESSAGE_INIT_UBER InitMessages;
NVSP_1_MESSAGE_UBER Version1Messages;
} __attribute__((packed)) NVSP_ALL_MESSAGES;
union nvsp_all_messages {
union nvsp_message_init_uber InitMessages;
union nvsp_1_message_uber Version1Messages;
} __attribute__((packed));
/* ALL Messages */
typedef struct _NVSP_MESSAGE {
NVSP_MESSAGE_HEADER Header;
NVSP_ALL_MESSAGES Messages;
} __attribute__((packed)) NVSP_MESSAGE, *PNVSP_MESSAGE;
struct nvsp_message {
struct nvsp_message_header Header;
union nvsp_all_messages Messages;
} __attribute__((packed));