Commit 223c1aa6 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: fix typedefs in nvspprotocol.h

It's all clean now.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent abb7aacb
...@@ -236,8 +236,8 @@ NetVscInitialize( ...@@ -236,8 +236,8 @@ NetVscInitialize(
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
DPRINT_DBG(NETVSC, "sizeof(struct hv_netvsc_packet)=%zd, sizeof(NVSP_MESSAGE)=%zd, sizeof(struct vmtransfer_page_packet_header)=%zd", 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(NVSP_MESSAGE), sizeof(struct vmtransfer_page_packet_header)); 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 */ /* Make sure we are at least 2 pages since 1 page is used for control */
ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1)); ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1));
...@@ -270,7 +270,7 @@ NetVscInitializeReceiveBufferWithNetVsp( ...@@ -270,7 +270,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
{ {
int ret=0; int ret=0;
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *initPacket; struct nvsp_message *initPacket;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -318,7 +318,7 @@ NetVscInitializeReceiveBufferWithNetVsp( ...@@ -318,7 +318,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
initPacket = &netDevice->ChannelInitPacket; initPacket = &netDevice->ChannelInitPacket;
memset(initPacket, 0, sizeof(NVSP_MESSAGE)); memset(initPacket, 0, sizeof(struct nvsp_message));
initPacket->Header.MessageType = NvspMessage1TypeSendReceiveBuffer; initPacket->Header.MessageType = NvspMessage1TypeSendReceiveBuffer;
initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->ReceiveBufferGpadlHandle; initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->ReceiveBufferGpadlHandle;
...@@ -327,7 +327,7 @@ NetVscInitializeReceiveBufferWithNetVsp( ...@@ -327,7 +327,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
/* Send the gpadl notification request */ /* Send the gpadl notification request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket, initPacket,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)initPacket, (unsigned long)initPacket,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -355,7 +355,7 @@ NetVscInitializeReceiveBufferWithNetVsp( ...@@ -355,7 +355,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
netDevice->ReceiveSectionCount = initPacket->Messages.Version1Messages.SendReceiveBufferComplete.NumSections; 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) if (netDevice->ReceiveSections == NULL)
{ {
ret = -1; ret = -1;
...@@ -364,7 +364,7 @@ NetVscInitializeReceiveBufferWithNetVsp( ...@@ -364,7 +364,7 @@ NetVscInitializeReceiveBufferWithNetVsp(
memcpy(netDevice->ReceiveSections, memcpy(netDevice->ReceiveSections,
initPacket->Messages.Version1Messages.SendReceiveBufferComplete.Sections, 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, DPRINT_INFO(NETVSC,
"Receive sections info (count %d, offset %d, endoffset %d, suballoc size %d, num suballocs %d)", "Receive sections info (count %d, offset %d, endoffset %d, suballoc size %d, num suballocs %d)",
...@@ -399,7 +399,7 @@ NetVscInitializeSendBufferWithNetVsp( ...@@ -399,7 +399,7 @@ NetVscInitializeSendBufferWithNetVsp(
{ {
int ret=0; int ret=0;
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *initPacket; struct nvsp_message *initPacket;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -447,7 +447,7 @@ NetVscInitializeSendBufferWithNetVsp( ...@@ -447,7 +447,7 @@ NetVscInitializeSendBufferWithNetVsp(
initPacket = &netDevice->ChannelInitPacket; initPacket = &netDevice->ChannelInitPacket;
memset(initPacket, 0, sizeof(NVSP_MESSAGE)); memset(initPacket, 0, sizeof(struct nvsp_message));
initPacket->Header.MessageType = NvspMessage1TypeSendSendBuffer; initPacket->Header.MessageType = NvspMessage1TypeSendSendBuffer;
initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->SendBufferGpadlHandle; initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->SendBufferGpadlHandle;
...@@ -456,7 +456,7 @@ NetVscInitializeSendBufferWithNetVsp( ...@@ -456,7 +456,7 @@ NetVscInitializeSendBufferWithNetVsp(
/* Send the gpadl notification request */ /* Send the gpadl notification request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket, initPacket,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)initPacket, (unsigned long)initPacket,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -496,7 +496,7 @@ NetVscDestroyReceiveBuffer( ...@@ -496,7 +496,7 @@ NetVscDestroyReceiveBuffer(
struct NETVSC_DEVICE *NetDevice struct NETVSC_DEVICE *NetDevice
) )
{ {
NVSP_MESSAGE *revokePacket; struct nvsp_message *revokePacket;
int ret=0; int ret=0;
...@@ -514,14 +514,14 @@ NetVscDestroyReceiveBuffer( ...@@ -514,14 +514,14 @@ NetVscDestroyReceiveBuffer(
/* Send the revoke receive buffer */ /* Send the revoke receive buffer */
revokePacket = &NetDevice->RevokePacket; revokePacket = &NetDevice->RevokePacket;
memset(revokePacket, 0, sizeof(NVSP_MESSAGE)); memset(revokePacket, 0, sizeof(struct nvsp_message));
revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer; revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer;
revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID;
ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device, ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device,
revokePacket, revokePacket,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)revokePacket, (unsigned long)revokePacket,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
0); 0);
...@@ -584,7 +584,7 @@ NetVscDestroySendBuffer( ...@@ -584,7 +584,7 @@ NetVscDestroySendBuffer(
struct NETVSC_DEVICE *NetDevice struct NETVSC_DEVICE *NetDevice
) )
{ {
NVSP_MESSAGE *revokePacket; struct nvsp_message *revokePacket;
int ret=0; int ret=0;
...@@ -602,14 +602,14 @@ NetVscDestroySendBuffer( ...@@ -602,14 +602,14 @@ NetVscDestroySendBuffer(
/* Send the revoke send buffer */ /* Send the revoke send buffer */
revokePacket = &NetDevice->RevokePacket; revokePacket = &NetDevice->RevokePacket;
memset(revokePacket, 0, sizeof(NVSP_MESSAGE)); memset(revokePacket, 0, sizeof(struct nvsp_message));
revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer; revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer;
revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID; revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID;
ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device, ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device,
revokePacket, revokePacket,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)revokePacket, (unsigned long)revokePacket,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
0); 0);
...@@ -663,7 +663,7 @@ NetVscConnectToVsp( ...@@ -663,7 +663,7 @@ NetVscConnectToVsp(
{ {
int ret=0; int ret=0;
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *initPacket; struct nvsp_message *initPacket;
int ndisVersion; int ndisVersion;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -678,7 +678,7 @@ NetVscConnectToVsp( ...@@ -678,7 +678,7 @@ NetVscConnectToVsp(
initPacket = &netDevice->ChannelInitPacket; initPacket = &netDevice->ChannelInitPacket;
memset(initPacket, 0, sizeof(NVSP_MESSAGE)); memset(initPacket, 0, sizeof(struct nvsp_message));
initPacket->Header.MessageType = NvspMessageTypeInit; initPacket->Header.MessageType = NvspMessageTypeInit;
initPacket->Messages.InitMessages.Init.MinProtocolVersion = NVSP_MIN_PROTOCOL_VERSION; initPacket->Messages.InitMessages.Init.MinProtocolVersion = NVSP_MIN_PROTOCOL_VERSION;
initPacket->Messages.InitMessages.Init.MaxProtocolVersion = NVSP_MAX_PROTOCOL_VERSION; initPacket->Messages.InitMessages.Init.MaxProtocolVersion = NVSP_MAX_PROTOCOL_VERSION;
...@@ -688,7 +688,7 @@ NetVscConnectToVsp( ...@@ -688,7 +688,7 @@ NetVscConnectToVsp(
/* Send the init request */ /* Send the init request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket, initPacket,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)initPacket, (unsigned long)initPacket,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -724,7 +724,7 @@ NetVscConnectToVsp( ...@@ -724,7 +724,7 @@ NetVscConnectToVsp(
DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendNdisVersion..."); DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendNdisVersion...");
/* Send the ndis version */ /* Send the ndis version */
memset(initPacket, 0, sizeof(NVSP_MESSAGE)); memset(initPacket, 0, sizeof(struct nvsp_message));
ndisVersion = 0x00050000; ndisVersion = 0x00050000;
...@@ -735,7 +735,7 @@ NetVscConnectToVsp( ...@@ -735,7 +735,7 @@ NetVscConnectToVsp(
/* Send the init request */ /* Send the init request */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
initPacket, initPacket,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)initPacket, (unsigned long)initPacket,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
0); 0);
...@@ -995,7 +995,7 @@ NetVscOnSendCompletion( ...@@ -995,7 +995,7 @@ NetVscOnSendCompletion(
) )
{ {
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *nvspPacket; struct nvsp_message *nvspPacket;
struct hv_netvsc_packet *nvscPacket; struct hv_netvsc_packet *nvscPacket;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -1008,7 +1008,7 @@ NetVscOnSendCompletion( ...@@ -1008,7 +1008,7 @@ NetVscOnSendCompletion(
return; 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); DPRINT_DBG(NETVSC, "send completion packet - type %d", nvspPacket->Header.MessageType);
...@@ -1017,7 +1017,7 @@ NetVscOnSendCompletion( ...@@ -1017,7 +1017,7 @@ NetVscOnSendCompletion(
nvspPacket->Header.MessageType == NvspMessage1TypeSendSendBufferComplete) nvspPacket->Header.MessageType == NvspMessage1TypeSendSendBufferComplete)
{ {
/* Copy the response back */ /* Copy the response back */
memcpy(&netDevice->ChannelInitPacket, nvspPacket, sizeof(NVSP_MESSAGE)); memcpy(&netDevice->ChannelInitPacket, nvspPacket, sizeof(struct nvsp_message));
osd_WaitEventSet(netDevice->ChannelInitEvent); osd_WaitEventSet(netDevice->ChannelInitEvent);
} }
else if (nvspPacket->Header.MessageType == NvspMessage1TypeSendRNDISPacketComplete) else if (nvspPacket->Header.MessageType == NvspMessage1TypeSendRNDISPacketComplete)
...@@ -1051,7 +1051,7 @@ NetVscOnSend( ...@@ -1051,7 +1051,7 @@ NetVscOnSend(
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
int ret=0; int ret=0;
NVSP_MESSAGE sendMessage; struct nvsp_message sendMessage;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -1079,14 +1079,14 @@ NetVscOnSend( ...@@ -1079,14 +1079,14 @@ NetVscOnSend(
Packet->PageBuffers, Packet->PageBuffers,
Packet->PageBufferCount, Packet->PageBufferCount,
&sendMessage, &sendMessage,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)Packet); (unsigned long)Packet);
} }
else else
{ {
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
&sendMessage, &sendMessage,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
(unsigned long)Packet, (unsigned long)Packet,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -1114,7 +1114,7 @@ NetVscOnReceive( ...@@ -1114,7 +1114,7 @@ NetVscOnReceive(
{ {
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
struct vmtransfer_page_packet_header *vmxferpagePacket; struct vmtransfer_page_packet_header *vmxferpagePacket;
NVSP_MESSAGE *nvspPacket; struct nvsp_message *nvspPacket;
struct hv_netvsc_packet *netvscPacket=NULL; struct hv_netvsc_packet *netvscPacket=NULL;
LIST_ENTRY* entry; LIST_ENTRY* entry;
unsigned long start; unsigned long start;
...@@ -1145,7 +1145,7 @@ NetVscOnReceive( ...@@ -1145,7 +1145,7 @@ NetVscOnReceive(
return; 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 */ /* Make sure this is a valid nvsp packet */
if (nvspPacket->Header.MessageType != NvspMessage1TypeSendRNDISPacket ) if (nvspPacket->Header.MessageType != NvspMessage1TypeSendRNDISPacket )
...@@ -1305,7 +1305,7 @@ NetVscSendReceiveCompletion( ...@@ -1305,7 +1305,7 @@ NetVscSendReceiveCompletion(
u64 TransactionId u64 TransactionId
) )
{ {
NVSP_MESSAGE recvcompMessage; struct nvsp_message recvcompMessage;
int retries=0; int retries=0;
int ret=0; int ret=0;
...@@ -1320,7 +1320,7 @@ NetVscSendReceiveCompletion( ...@@ -1320,7 +1320,7 @@ NetVscSendReceiveCompletion(
/* Send the completion */ /* Send the completion */
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
&recvcompMessage, &recvcompMessage,
sizeof(NVSP_MESSAGE), sizeof(struct nvsp_message),
TransactionId, TransactionId,
VmbusPacketTypeCompletion, VmbusPacketTypeCompletion,
0); 0);
......
...@@ -72,13 +72,13 @@ struct NETVSC_DEVICE { ...@@ -72,13 +72,13 @@ struct NETVSC_DEVICE {
u32 ReceiveBufferSize; u32 ReceiveBufferSize;
u32 ReceiveBufferGpadlHandle; u32 ReceiveBufferGpadlHandle;
u32 ReceiveSectionCount; u32 ReceiveSectionCount;
PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections; struct nvsp_1_receive_buffer_section *ReceiveSections;
/* Used for NetVSP initialization protocol */ /* Used for NetVSP initialization protocol */
struct osd_waitevent *ChannelInitEvent; struct osd_waitevent *ChannelInitEvent;
NVSP_MESSAGE ChannelInitPacket; struct nvsp_message ChannelInitPacket;
NVSP_MESSAGE RevokePacket; struct nvsp_message RevokePacket;
/* unsigned char HwMacAddr[HW_MACADDR_LEN]; */ /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */
/* Holds rndis device info */ /* Holds rndis device info */
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define NVSP_MIN_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 #define NVSP_MIN_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
#define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 #define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
typedef enum _NVSP_MESSAGE_TYPE { enum {
NvspMessageTypeNone = 0, NvspMessageTypeNone = 0,
/* Init Messages */ /* Init Messages */
...@@ -57,9 +57,9 @@ typedef enum _NVSP_MESSAGE_TYPE { ...@@ -57,9 +57,9 @@ typedef enum _NVSP_MESSAGE_TYPE {
* the maximum number of messages. * the maximum number of messages.
*/ */
NvspNumMessagePerVersion = 9, NvspNumMessagePerVersion = 9,
} NVSP_MESSAGE_TYPE, *PNVSP_MESSAGE_TYPE; };
typedef enum _NVSP_STATUS { enum {
NvspStatusNone = 0, NvspStatusNone = 0,
NvspStatusSuccess, NvspStatusSuccess,
NvspStatusFailure, NvspStatusFailure,
...@@ -68,11 +68,11 @@ typedef enum _NVSP_STATUS { ...@@ -68,11 +68,11 @@ typedef enum _NVSP_STATUS {
NvspStatusInvalidRndisPacket, NvspStatusInvalidRndisPacket,
NvspStatusBusy, NvspStatusBusy,
NvspStatusMax, NvspStatusMax,
} NVSP_STATUS, *PNVSP_STATUS; };
typedef struct _NVSP_MESSAGE_HEADER { struct nvsp_message_header {
u32 MessageType; u32 MessageType;
} NVSP_MESSAGE_HEADER, *PNVSP_MESSAGE_HEADER; };
/* Init Messages */ /* Init Messages */
...@@ -81,26 +81,26 @@ typedef struct _NVSP_MESSAGE_HEADER { ...@@ -81,26 +81,26 @@ typedef struct _NVSP_MESSAGE_HEADER {
* has been opened. This message should never include anything other then * has been opened. This message should never include anything other then
* versioning (i.e. this message will be the same for ever). * versioning (i.e. this message will be the same for ever).
*/ */
typedef struct _NVSP_MESSAGE_INIT { struct nvsp_message_init {
u32 MinProtocolVersion; u32 MinProtocolVersion;
u32 MaxProtocolVersion; 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 * This message is used by the VSP to complete the initialization of the
* channel. This message should never include anything other then versioning * channel. This message should never include anything other then versioning
* (i.e. this message will be the same for ever). * (i.e. this message will be the same for ever).
*/ */
typedef struct _NVSP_MESSAGE_INIT_COMPLETE { struct nvsp_message_init_complete {
u32 NegotiatedProtocolVersion; u32 NegotiatedProtocolVersion;
u32 MaximumMdlChainLength; u32 MaximumMdlChainLength;
u32 Status; u32 Status;
} __attribute__((packed)) NVSP_MESSAGE_INIT_COMPLETE, *PNVSP_MESSAGE_INIT_COMPLETE; } __attribute__((packed));
typedef union _NVSP_MESSAGE_INIT_UBER { union nvsp_message_init_uber {
NVSP_MESSAGE_INIT Init; struct nvsp_message_init Init;
NVSP_MESSAGE_INIT_COMPLETE InitComplete; struct nvsp_message_init_complete InitComplete;
} __attribute__((packed)) NVSP_MESSAGE_INIT_UBER; } __attribute__((packed));
/* Version 1 Messages */ /* Version 1 Messages */
...@@ -108,33 +108,33 @@ typedef union _NVSP_MESSAGE_INIT_UBER { ...@@ -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 * 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. * 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 NdisMajorVersion;
u32 NdisMinorVersion; 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 * 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. * 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; u32 GpadlHandle;
u16 Id; 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 Offset;
u32 SubAllocationSize; u32 SubAllocationSize;
u32 NumSubAllocations; u32 NumSubAllocations;
u32 EndOffset; 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 * 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 * VSC. This message must be sent by the VSP before the VSP uses the receive
* buffer. * buffer.
*/ */
typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE { struct nvsp_1_message_send_receive_buffer_complete {
u32 Status; u32 Status;
u32 NumSections; u32 NumSections;
...@@ -157,33 +157,33 @@ typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE { ...@@ -157,33 +157,33 @@ typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE {
* LargeOffset SmallOffset * LargeOffset SmallOffset
*/ */
NVSP_1_RECEIVE_BUFFER_SECTION Sections[1]; struct nvsp_1_receive_buffer_section Sections[1];
} __attribute__((packed)) NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE, *PNVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE; } __attribute__((packed));
/* /*
* This message is sent by the VSC to revoke the receive buffer. After the VSP * 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 * completes this transaction, the vsp should never use the receive buffer
* again. * again.
*/ */
typedef struct _NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER { struct nvsp_1_message_revoke_receive_buffer {
u16 Id; 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 * 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. * 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; u32 GpadlHandle;
u16 Id; 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 * 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 * VSC. This message must be sent by the VSP before the VSP uses the sent
* buffer. * buffer.
*/ */
typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE { struct nvsp_1_message_send_send_buffer_complete {
u32 Status; u32 Status;
/* /*
...@@ -193,21 +193,21 @@ typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE { ...@@ -193,21 +193,21 @@ typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE {
* decreases. * decreases.
*/ */
u32 SectionSize; 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 * 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. * 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; 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 * This message is used by both the VSP and the VSC to send a RNDIS message to
* the opposite channel endpoint. * 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 * This field is specified by RNIDS. They assume there's two different
* channels of communication. However, the Network VSP only has one. * channels of communication. However, the Network VSP only has one.
...@@ -223,40 +223,42 @@ typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET { ...@@ -223,40 +223,42 @@ typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET {
*/ */
u32 SendBufferSectionIndex; u32 SendBufferSectionIndex;
u32 SendBufferSectionSize; 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 * 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 * to the opposite channel endpoint. At this point, the initiator of this
* message cannot use any resources associated with the original RNDIS packet. * 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; u32 Status;
} NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE, *PNVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE; };
typedef union _NVSP_MESSAGE_1_UBER { union nvsp_1_message_uber {
NVSP_1_MESSAGE_SEND_NDIS_VERSION SendNdisVersion; struct nvsp_1_message_send_ndis_version SendNdisVersion;
NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER SendReceiveBuffer; struct nvsp_1_message_send_receive_buffer SendReceiveBuffer;
NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE SendReceiveBufferComplete; struct nvsp_1_message_send_receive_buffer_complete
NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER RevokeReceiveBuffer; SendReceiveBufferComplete;
struct nvsp_1_message_revoke_receive_buffer RevokeReceiveBuffer;
NVSP_1_MESSAGE_SEND_SEND_BUFFER SendSendBuffer; struct nvsp_1_message_send_send_buffer SendSendBuffer;
NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE SendSendBufferComplete; struct nvsp_1_message_send_send_buffer_complete SendSendBufferComplete;
NVSP_1_MESSAGE_REVOKE_SEND_BUFFER RevokeSendBuffer; struct nvsp_1_message_revoke_send_buffer RevokeSendBuffer;
NVSP_1_MESSAGE_SEND_RNDIS_PACKET SendRNDISPacket; struct nvsp_1_message_send_rndis_packet SendRNDISPacket;
NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE SendRNDISPacketComplete; struct nvsp_1_message_send_rndis_packet_complete
} __attribute__((packed)) NVSP_1_MESSAGE_UBER; SendRNDISPacketComplete;
} __attribute__((packed));
typedef union _NVSP_ALL_MESSAGES { union nvsp_all_messages {
NVSP_MESSAGE_INIT_UBER InitMessages; union nvsp_message_init_uber InitMessages;
NVSP_1_MESSAGE_UBER Version1Messages; union nvsp_1_message_uber Version1Messages;
} __attribute__((packed)) NVSP_ALL_MESSAGES; } __attribute__((packed));
/* ALL Messages */ /* ALL Messages */
typedef struct _NVSP_MESSAGE { struct nvsp_message {
NVSP_MESSAGE_HEADER Header; struct nvsp_message_header Header;
NVSP_ALL_MESSAGES Messages; union nvsp_all_messages Messages;
} __attribute__((packed)) NVSP_MESSAGE, *PNVSP_MESSAGE; } __attribute__((packed));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment