Commit 9f33d054 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: rndis.h: typedef removal, part 1

This removes about half of the typedefs in rndis.h

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 88a3716f
...@@ -68,13 +68,13 @@ typedef struct _RNDIS_REQUEST { ...@@ -68,13 +68,13 @@ typedef struct _RNDIS_REQUEST {
/* FIXME: We assumed a fixed size response here. If we do ever need to handle a bigger response, */ /* FIXME: We assumed a fixed size response here. If we do ever need to handle a bigger response, */
/* we can either define a max response message or add a response buffer variable above this field */ /* we can either define a max response message or add a response buffer variable above this field */
RNDIS_MESSAGE ResponseMessage; struct rndis_message ResponseMessage;
/* Simplify allocation by having a netvsc packet inline */ /* Simplify allocation by having a netvsc packet inline */
struct hv_netvsc_packet Packet; struct hv_netvsc_packet Packet;
PAGE_BUFFER Buffer; PAGE_BUFFER Buffer;
/* FIXME: We assumed a fixed size request here. */ /* FIXME: We assumed a fixed size request here. */
RNDIS_MESSAGE RequestMessage; struct rndis_message RequestMessage;
} RNDIS_REQUEST; } RNDIS_REQUEST;
...@@ -82,7 +82,7 @@ typedef struct _RNDIS_FILTER_PACKET { ...@@ -82,7 +82,7 @@ typedef struct _RNDIS_FILTER_PACKET {
void *CompletionContext; void *CompletionContext;
PFN_ON_SENDRECVCOMPLETION OnCompletion; PFN_ON_SENDRECVCOMPLETION OnCompletion;
RNDIS_MESSAGE Message; struct rndis_message Message;
} RNDIS_FILTER_PACKET; } RNDIS_FILTER_PACKET;
...@@ -94,27 +94,17 @@ RndisFilterSendRequest( ...@@ -94,27 +94,17 @@ RndisFilterSendRequest(
RNDIS_REQUEST *Request RNDIS_REQUEST *Request
); );
static void static void RndisFilterReceiveResponse(RNDIS_DEVICE *Device,
RndisFilterReceiveResponse( struct rndis_message *Response);
RNDIS_DEVICE *Device,
RNDIS_MESSAGE *Response
);
static void static void RndisFilterReceiveIndicateStatus(RNDIS_DEVICE *Device,
RndisFilterReceiveIndicateStatus( struct rndis_message *Response);
RNDIS_DEVICE *Device,
RNDIS_MESSAGE *Response
);
static void static void RndisFilterReceiveData(RNDIS_DEVICE *Device,
RndisFilterReceiveData( struct rndis_message *Message,
RNDIS_DEVICE *Device, struct hv_netvsc_packet *Packet);
RNDIS_MESSAGE *Message,
struct hv_netvsc_packet *Packet
);
static int static int RndisFilterOnReceive(
RndisFilterOnReceive(
struct hv_device *Device, struct hv_device *Device,
struct hv_netvsc_packet *Packet struct hv_netvsc_packet *Packet
); );
...@@ -234,8 +224,8 @@ static inline void PutRndisDevice(RNDIS_DEVICE *Device) ...@@ -234,8 +224,8 @@ static inline void PutRndisDevice(RNDIS_DEVICE *Device)
static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageType, u32 MessageLength) static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageType, u32 MessageLength)
{ {
RNDIS_REQUEST *request; RNDIS_REQUEST *request;
RNDIS_MESSAGE *rndisMessage; struct rndis_message *rndisMessage;
RNDIS_SET_REQUEST *set; struct rndis_set_request *set;
unsigned long flags; unsigned long flags;
request = kzalloc(sizeof(RNDIS_REQUEST), GFP_KERNEL); request = kzalloc(sizeof(RNDIS_REQUEST), GFP_KERNEL);
...@@ -280,7 +270,7 @@ static inline void PutRndisRequest(RNDIS_DEVICE *Device, RNDIS_REQUEST *Request) ...@@ -280,7 +270,7 @@ static inline void PutRndisRequest(RNDIS_DEVICE *Device, RNDIS_REQUEST *Request)
kfree(Request); kfree(Request);
} }
static inline void DumpRndisMessage(RNDIS_MESSAGE *RndisMessage) static inline void DumpRndisMessage(struct rndis_message *RndisMessage)
{ {
switch (RndisMessage->NdisMessageType) switch (RndisMessage->NdisMessageType)
{ {
...@@ -373,11 +363,8 @@ RndisFilterSendRequest( ...@@ -373,11 +363,8 @@ RndisFilterSendRequest(
} }
static void static void RndisFilterReceiveResponse(RNDIS_DEVICE *Device,
RndisFilterReceiveResponse( struct rndis_message *Response)
RNDIS_DEVICE *Device,
RNDIS_MESSAGE *Response
)
{ {
LIST_ENTRY *anchor; LIST_ENTRY *anchor;
LIST_ENTRY *curr; LIST_ENTRY *curr;
...@@ -406,7 +393,7 @@ RndisFilterReceiveResponse( ...@@ -406,7 +393,7 @@ RndisFilterReceiveResponse(
if (found) if (found)
{ {
if (Response->MessageLength <= sizeof(RNDIS_MESSAGE)) if (Response->MessageLength <= sizeof(struct rndis_message))
{ {
memcpy(&request->ResponseMessage, Response, Response->MessageLength); memcpy(&request->ResponseMessage, Response, Response->MessageLength);
} }
...@@ -435,13 +422,10 @@ RndisFilterReceiveResponse( ...@@ -435,13 +422,10 @@ RndisFilterReceiveResponse(
DPRINT_EXIT(NETVSC); DPRINT_EXIT(NETVSC);
} }
static void static void RndisFilterReceiveIndicateStatus(RNDIS_DEVICE *Device,
RndisFilterReceiveIndicateStatus( struct rndis_message *Response)
RNDIS_DEVICE *Device,
RNDIS_MESSAGE *Response
)
{ {
RNDIS_INDICATE_STATUS *indicate = &Response->Message.IndicateStatus; struct rndis_indicate_status *indicate = &Response->Message.IndicateStatus;
if (indicate->Status == RNDIS_STATUS_MEDIA_CONNECT) if (indicate->Status == RNDIS_STATUS_MEDIA_CONNECT)
{ {
...@@ -457,20 +441,17 @@ RndisFilterReceiveIndicateStatus( ...@@ -457,20 +441,17 @@ RndisFilterReceiveIndicateStatus(
} }
} }
static void static void RndisFilterReceiveData(RNDIS_DEVICE *Device,
RndisFilterReceiveData( struct rndis_message *Message,
RNDIS_DEVICE *Device, struct hv_netvsc_packet *Packet)
RNDIS_MESSAGE *Message,
struct hv_netvsc_packet *Packet
)
{ {
RNDIS_PACKET *rndisPacket; struct rndis_packet *rndisPacket;
u32 dataOffset; u32 dataOffset;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
/* empty ethernet frame ?? */ /* empty ethernet frame ?? */
ASSERT(Packet->PageBuffers[0].Length > RNDIS_MESSAGE_SIZE(RNDIS_PACKET)); ASSERT(Packet->PageBuffers[0].Length > RNDIS_MESSAGE_SIZE(struct rndis_packet));
rndisPacket = &Message->Message.Packet; rndisPacket = &Message->Message.Packet;
...@@ -499,8 +480,8 @@ RndisFilterOnReceive( ...@@ -499,8 +480,8 @@ RndisFilterOnReceive(
{ {
struct NETVSC_DEVICE *netDevice = (struct NETVSC_DEVICE*)Device->Extension; struct NETVSC_DEVICE *netDevice = (struct NETVSC_DEVICE*)Device->Extension;
RNDIS_DEVICE *rndisDevice; RNDIS_DEVICE *rndisDevice;
RNDIS_MESSAGE rndisMessage; struct rndis_message rndisMessage;
RNDIS_MESSAGE *rndisHeader; struct rndis_message *rndisHeader;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -521,7 +502,7 @@ RndisFilterOnReceive( ...@@ -521,7 +502,7 @@ RndisFilterOnReceive(
return -1; return -1;
} }
rndisHeader = (RNDIS_MESSAGE *)kmap_atomic(pfn_to_page(Packet->PageBuffers[0].Pfn), KM_IRQ0); rndisHeader = (struct rndis_message *)kmap_atomic(pfn_to_page(Packet->PageBuffers[0].Pfn), KM_IRQ0);
rndisHeader = (void*)((unsigned long)rndisHeader + Packet->PageBuffers[0].Offset); rndisHeader = (void*)((unsigned long)rndisHeader + Packet->PageBuffers[0].Offset);
...@@ -540,13 +521,13 @@ RndisFilterOnReceive( ...@@ -540,13 +521,13 @@ RndisFilterOnReceive(
} }
#endif #endif
if ((rndisHeader->NdisMessageType != REMOTE_NDIS_PACKET_MSG) && (rndisHeader->MessageLength > sizeof(RNDIS_MESSAGE))) if ((rndisHeader->NdisMessageType != REMOTE_NDIS_PACKET_MSG) && (rndisHeader->MessageLength > sizeof(struct rndis_message)))
{ {
DPRINT_ERR(NETVSC, "incoming rndis message buffer overflow detected (got %u, max %zu)...marking it an error!", DPRINT_ERR(NETVSC, "incoming rndis message buffer overflow detected (got %u, max %zu)...marking it an error!",
rndisHeader->MessageLength, sizeof(RNDIS_MESSAGE)); rndisHeader->MessageLength, sizeof(struct rndis_message));
} }
memcpy(&rndisMessage, rndisHeader, (rndisHeader->MessageLength > sizeof(RNDIS_MESSAGE))?sizeof(RNDIS_MESSAGE):rndisHeader->MessageLength); memcpy(&rndisMessage, rndisHeader, (rndisHeader->MessageLength > sizeof(struct rndis_message))?sizeof(struct rndis_message):rndisHeader->MessageLength);
kunmap_atomic(rndisHeader - Packet->PageBuffers[0].Offset, KM_IRQ0); kunmap_atomic(rndisHeader - Packet->PageBuffers[0].Offset, KM_IRQ0);
...@@ -592,8 +573,8 @@ RndisFilterQueryDevice( ...@@ -592,8 +573,8 @@ RndisFilterQueryDevice(
{ {
RNDIS_REQUEST *request; RNDIS_REQUEST *request;
u32 inresultSize = *ResultSize; u32 inresultSize = *ResultSize;
RNDIS_QUERY_REQUEST *query; struct rndis_query_request *query;
RNDIS_QUERY_COMPLETE *queryComplete; struct rndis_query_complete *queryComplete;
int ret=0; int ret=0;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -601,7 +582,7 @@ RndisFilterQueryDevice( ...@@ -601,7 +582,7 @@ RndisFilterQueryDevice(
ASSERT(Result); ASSERT(Result);
*ResultSize = 0; *ResultSize = 0;
request = GetRndisRequest(Device, REMOTE_NDIS_QUERY_MSG, RNDIS_MESSAGE_SIZE(RNDIS_QUERY_REQUEST)); request = GetRndisRequest(Device, REMOTE_NDIS_QUERY_MSG, RNDIS_MESSAGE_SIZE(struct rndis_query_request));
if (!request) if (!request)
{ {
ret = -1; ret = -1;
...@@ -611,7 +592,7 @@ RndisFilterQueryDevice( ...@@ -611,7 +592,7 @@ RndisFilterQueryDevice(
/* Setup the rndis query */ /* Setup the rndis query */
query = &request->RequestMessage.Message.QueryRequest; query = &request->RequestMessage.Message.QueryRequest;
query->Oid = Oid; query->Oid = Oid;
query->InformationBufferOffset = sizeof(RNDIS_QUERY_REQUEST); query->InformationBufferOffset = sizeof(struct rndis_query_request);
query->InformationBufferLength = 0; query->InformationBufferLength = 0;
query->DeviceVcHandle = 0; query->DeviceVcHandle = 0;
...@@ -681,16 +662,16 @@ RndisFilterSetPacketFilter( ...@@ -681,16 +662,16 @@ RndisFilterSetPacketFilter(
) )
{ {
RNDIS_REQUEST *request; RNDIS_REQUEST *request;
RNDIS_SET_REQUEST *set; struct rndis_set_request *set;
RNDIS_SET_COMPLETE *setComplete; struct rndis_set_complete *setComplete;
u32 status; u32 status;
int ret; int ret;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
ASSERT(RNDIS_MESSAGE_SIZE(RNDIS_SET_REQUEST) + sizeof(u32) <= sizeof(RNDIS_MESSAGE)); ASSERT(RNDIS_MESSAGE_SIZE(struct rndis_set_request) + sizeof(u32) <= sizeof(struct rndis_message));
request = GetRndisRequest(Device, REMOTE_NDIS_SET_MSG, RNDIS_MESSAGE_SIZE(RNDIS_SET_REQUEST) + sizeof(u32)); request = GetRndisRequest(Device, REMOTE_NDIS_SET_MSG, RNDIS_MESSAGE_SIZE(struct rndis_set_request) + sizeof(u32));
if (!request) if (!request)
{ {
ret = -1; ret = -1;
...@@ -701,9 +682,9 @@ RndisFilterSetPacketFilter( ...@@ -701,9 +682,9 @@ RndisFilterSetPacketFilter(
set = &request->RequestMessage.Message.SetRequest; set = &request->RequestMessage.Message.SetRequest;
set->Oid = RNDIS_OID_GEN_CURRENT_PACKET_FILTER; set->Oid = RNDIS_OID_GEN_CURRENT_PACKET_FILTER;
set->InformationBufferLength = sizeof(u32); set->InformationBufferLength = sizeof(u32);
set->InformationBufferOffset = sizeof(RNDIS_SET_REQUEST); set->InformationBufferOffset = sizeof(struct rndis_set_request);
memcpy((void*)(unsigned long)set + sizeof(RNDIS_SET_REQUEST), &NewFilter, sizeof(u32)); memcpy((void*)(unsigned long)set + sizeof(struct rndis_set_request), &NewFilter, sizeof(u32));
ret = RndisFilterSendRequest(Device, request); ret = RndisFilterSendRequest(Device, request);
if (ret != 0) if (ret != 0)
...@@ -793,14 +774,14 @@ RndisFilterInitDevice( ...@@ -793,14 +774,14 @@ RndisFilterInitDevice(
) )
{ {
RNDIS_REQUEST *request; RNDIS_REQUEST *request;
RNDIS_INITIALIZE_REQUEST *init; struct rndis_initialize_request *init;
RNDIS_INITIALIZE_COMPLETE *initComplete; struct rndis_initialize_complete *initComplete;
u32 status; u32 status;
int ret; int ret;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
request = GetRndisRequest(Device, REMOTE_NDIS_INITIALIZE_MSG, RNDIS_MESSAGE_SIZE(RNDIS_INITIALIZE_REQUEST)); request = GetRndisRequest(Device, REMOTE_NDIS_INITIALIZE_MSG, RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
if (!request) if (!request)
{ {
ret = -1; ret = -1;
...@@ -853,12 +834,12 @@ RndisFilterHaltDevice( ...@@ -853,12 +834,12 @@ RndisFilterHaltDevice(
) )
{ {
RNDIS_REQUEST *request; RNDIS_REQUEST *request;
RNDIS_HALT_REQUEST *halt; struct rndis_halt_request *halt;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
/* Attempt to do a rndis device halt */ /* Attempt to do a rndis device halt */
request = GetRndisRequest(Device, REMOTE_NDIS_HALT_MSG, RNDIS_MESSAGE_SIZE(RNDIS_HALT_REQUEST)); request = GetRndisRequest(Device, REMOTE_NDIS_HALT_MSG, RNDIS_MESSAGE_SIZE(struct rndis_halt_request));
if (!request) if (!request)
{ {
goto Cleanup; goto Cleanup;
...@@ -1088,8 +1069,8 @@ RndisFilterOnSend( ...@@ -1088,8 +1069,8 @@ RndisFilterOnSend(
{ {
int ret=0; int ret=0;
RNDIS_FILTER_PACKET *filterPacket; RNDIS_FILTER_PACKET *filterPacket;
RNDIS_MESSAGE *rndisMessage; struct rndis_message *rndisMessage;
RNDIS_PACKET *rndisPacket; struct rndis_packet *rndisPacket;
u32 rndisMessageSize; u32 rndisMessageSize;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -1101,13 +1082,13 @@ RndisFilterOnSend( ...@@ -1101,13 +1082,13 @@ RndisFilterOnSend(
memset(filterPacket, 0, sizeof(RNDIS_FILTER_PACKET)); memset(filterPacket, 0, sizeof(RNDIS_FILTER_PACKET));
rndisMessage = &filterPacket->Message; rndisMessage = &filterPacket->Message;
rndisMessageSize = RNDIS_MESSAGE_SIZE(RNDIS_PACKET); rndisMessageSize = RNDIS_MESSAGE_SIZE(struct rndis_packet);
rndisMessage->NdisMessageType = REMOTE_NDIS_PACKET_MSG; rndisMessage->NdisMessageType = REMOTE_NDIS_PACKET_MSG;
rndisMessage->MessageLength = Packet->TotalDataBufferLength + rndisMessageSize; rndisMessage->MessageLength = Packet->TotalDataBufferLength + rndisMessageSize;
rndisPacket = &rndisMessage->Message.Packet; rndisPacket = &rndisMessage->Message.Packet;
rndisPacket->DataOffset = sizeof(RNDIS_PACKET); rndisPacket->DataOffset = sizeof(struct rndis_packet);
rndisPacket->DataLength = Packet->TotalDataBufferLength; rndisPacket->DataLength = Packet->TotalDataBufferLength;
Packet->IsDataPacket = true; Packet->IsDataPacket = true;
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include "rndis.h" #include "rndis.h"
#define RNDIS_HEADER_SIZE (sizeof(RNDIS_MESSAGE) - \ #define RNDIS_HEADER_SIZE (sizeof(struct rndis_message) - \
sizeof(RNDIS_MESSAGE_CONTAINER)) sizeof(union rndis_message_container))
#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
......
...@@ -282,7 +282,7 @@ ...@@ -282,7 +282,7 @@
*/ */
#define REMOTE_NDIS_BUS_MSG 0xff000001 #define REMOTE_NDIS_BUS_MSG 0xff000001
/* Defines for DeviceFlags in RNDIS_INITIALIZE_COMPLETE */ /* Defines for DeviceFlags in struct rndis_initialize_complete */
#define RNDIS_DF_CONNECTIONLESS 0x00000001 #define RNDIS_DF_CONNECTIONLESS 0x00000001
#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
#define RNDIS_DF_RAW_DATA 0x00000004 #define RNDIS_DF_RAW_DATA 0x00000004
...@@ -313,15 +313,15 @@ ...@@ -313,15 +313,15 @@
/* NdisInitialize message */ /* NdisInitialize message */
typedef struct _RNDIS_INITIALIZE_REQUEST { struct rndis_initialize_request {
u32 RequestId; u32 RequestId;
u32 MajorVersion; u32 MajorVersion;
u32 MinorVersion; u32 MinorVersion;
u32 MaxTransferSize; u32 MaxTransferSize;
} RNDIS_INITIALIZE_REQUEST, *PRNDIS_INITIALIZE_REQUEST; };
/* Response to NdisInitialize */ /* Response to NdisInitialize */
typedef struct _RNDIS_INITIALIZE_COMPLETE { struct rndis_initialize_complete {
u32 RequestId; u32 RequestId;
u32 Status; u32 Status;
u32 MajorVersion; u32 MajorVersion;
...@@ -333,95 +333,95 @@ typedef struct _RNDIS_INITIALIZE_COMPLETE { ...@@ -333,95 +333,95 @@ typedef struct _RNDIS_INITIALIZE_COMPLETE {
u32 PacketAlignmentFactor; u32 PacketAlignmentFactor;
u32 AFListOffset; u32 AFListOffset;
u32 AFListSize; u32 AFListSize;
} RNDIS_INITIALIZE_COMPLETE, *PRNDIS_INITIALIZE_COMPLETE; };
/* Call manager devices only: Information about an address family */ /* Call manager devices only: Information about an address family */
/* supported by the device is appended to the response to NdisInitialize. */ /* supported by the device is appended to the response to NdisInitialize. */
typedef struct _RNDIS_CO_ADDRESS_FAMILY { struct rndis_co_address_family {
u32 AddressFamily; u32 AddressFamily;
u32 MajorVersion; u32 MajorVersion;
u32 MinorVersion; u32 MinorVersion;
} RNDIS_CO_ADDRESS_FAMILY, *PRNDIS_CO_ADDRESS_FAMILY; };
/* NdisHalt message */ /* NdisHalt message */
typedef struct _RNDIS_HALT_REQUEST { struct rndis_halt_request {
u32 RequestId; u32 RequestId;
} RNDIS_HALT_REQUEST, *PRNDIS_HALT_REQUEST; };
/* NdisQueryRequest message */ /* NdisQueryRequest message */
typedef struct _RNDIS_QUERY_REQUEST { struct rndis_query_request {
u32 RequestId; u32 RequestId;
u32 Oid; u32 Oid;
u32 InformationBufferLength; u32 InformationBufferLength;
u32 InformationBufferOffset; u32 InformationBufferOffset;
u32 DeviceVcHandle; u32 DeviceVcHandle;
} RNDIS_QUERY_REQUEST, *PRNDIS_QUERY_REQUEST; };
/* Response to NdisQueryRequest */ /* Response to NdisQueryRequest */
typedef struct _RNDIS_QUERY_COMPLETE { struct rndis_query_complete {
u32 RequestId; u32 RequestId;
u32 Status; u32 Status;
u32 InformationBufferLength; u32 InformationBufferLength;
u32 InformationBufferOffset; u32 InformationBufferOffset;
} RNDIS_QUERY_COMPLETE, *PRNDIS_QUERY_COMPLETE; };
/* NdisSetRequest message */ /* NdisSetRequest message */
typedef struct _RNDIS_SET_REQUEST { struct rndis_set_request {
u32 RequestId; u32 RequestId;
u32 Oid; u32 Oid;
u32 InformationBufferLength; u32 InformationBufferLength;
u32 InformationBufferOffset; u32 InformationBufferOffset;
u32 DeviceVcHandle; u32 DeviceVcHandle;
} RNDIS_SET_REQUEST, *PRNDIS_SET_REQUEST; };
/* Response to NdisSetRequest */ /* Response to NdisSetRequest */
typedef struct _RNDIS_SET_COMPLETE { struct rndis_set_complete {
u32 RequestId; u32 RequestId;
u32 Status; u32 Status;
} RNDIS_SET_COMPLETE, *PRNDIS_SET_COMPLETE; };
/* NdisReset message */ /* NdisReset message */
typedef struct _RNDIS_RESET_REQUEST { struct rndis_reset_request {
u32 Reserved; u32 Reserved;
} RNDIS_RESET_REQUEST, *PRNDIS_RESET_REQUEST; };
/* Response to NdisReset */ /* Response to NdisReset */
typedef struct _RNDIS_RESET_COMPLETE { struct rndis_reset_complete {
u32 Status; u32 Status;
u32 AddressingReset; u32 AddressingReset;
} RNDIS_RESET_COMPLETE, *PRNDIS_RESET_COMPLETE; };
/* NdisMIndicateStatus message */ /* NdisMIndicateStatus message */
typedef struct _RNDIS_INDICATE_STATUS { struct rndis_indicate_status {
u32 Status; u32 Status;
u32 StatusBufferLength; u32 StatusBufferLength;
u32 StatusBufferOffset; u32 StatusBufferOffset;
} RNDIS_INDICATE_STATUS, *PRNDIS_INDICATE_STATUS; };
/* Diagnostic information passed as the status buffer in */ /* Diagnostic information passed as the status buffer in */
/* RNDIS_INDICATE_STATUS messages signifying error conditions. */ /* struct rndis_indicate_status messages signifying error conditions. */
typedef struct _RNDIS_DIAGNOSTIC_INFO { typedef struct _RNDIS_DIAGNOSTIC_INFO {
u32 DiagStatus; u32 DiagStatus;
u32 ErrorOffset; u32 ErrorOffset;
} RNDIS_DIAGNOSTIC_INFO, *PRNDIS_DIAGNOSTIC_INFO; } RNDIS_DIAGNOSTIC_INFO, *PRNDIS_DIAGNOSTIC_INFO;
/* NdisKeepAlive message */ /* NdisKeepAlive message */
typedef struct _RNDIS_KEEPALIVE_REQUEST { struct rndis_keepalive_request {
u32 RequestId; u32 RequestId;
} RNDIS_KEEPALIVE_REQUEST, *PRNDIS_KEEPALIVE_REQUEST; };
/* Response to NdisKeepAlive */ /* Response to NdisKeepAlive */
typedef struct _RNDIS_KEEPALIVE_COMPLETE { struct rndis_keepalive_complete {
u32 RequestId; u32 RequestId;
u32 Status; u32 Status;
} RNDIS_KEEPALIVE_COMPLETE, *PRNDIS_KEEPALIVE_COMPLETE; };
/* /*
* Data message. All Offset fields contain byte offsets from the beginning of * Data message. All Offset fields contain byte offsets from the beginning of
* the RNDIS_PACKET structure. All Length fields are in bytes. VcHandle is set * struct rndis_packet. All Length fields are in bytes. VcHandle is set
* to 0 for connectionless data, otherwise it contains the VC handle. * to 0 for connectionless data, otherwise it contains the VC handle.
*/ */
typedef struct _RNDIS_PACKET { struct rndis_packet {
u32 DataOffset; u32 DataOffset;
u32 DataLength; u32 DataLength;
u32 OOBDataOffset; u32 OOBDataOffset;
...@@ -431,33 +431,33 @@ typedef struct _RNDIS_PACKET { ...@@ -431,33 +431,33 @@ typedef struct _RNDIS_PACKET {
u32 PerPacketInfoLength; u32 PerPacketInfoLength;
u32 VcHandle; u32 VcHandle;
u32 Reserved; u32 Reserved;
} RNDIS_PACKET, *PRNDIS_PACKET; };
/* Optional Out of Band data associated with a Data message. */ /* Optional Out of Band data associated with a Data message. */
typedef struct _RNDIS_OOBD { struct rndis_oobd {
u32 Size; u32 Size;
u32 Type; u32 Type;
u32 ClassInformationOffset; u32 ClassInformationOffset;
} RNDIS_OOBD, *PRNDIS_OOBD; };
/* Packet extension field contents associated with a Data message. */ /* Packet extension field contents associated with a Data message. */
typedef struct _RNDIS_PER_PACKET_INFO { struct rndis_per_packet_info {
u32 Size; u32 Size;
u32 Type; u32 Type;
u32 PerPacketInformationOffset; u32 PerPacketInformationOffset;
} RNDIS_PER_PACKET_INFO, *PRNDIS_PER_PACKET_INFO; };
/* Format of Information buffer passed in a SetRequest for the OID */ /* Format of Information buffer passed in a SetRequest for the OID */
/* OID_GEN_RNDIS_CONFIG_PARAMETER. */ /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
typedef struct _RNDIS_CONFIG_PARAMETER_INFO { struct rndis_config_parameter_info {
u32 ParameterNameOffset; u32 ParameterNameOffset;
u32 ParameterNameLength; u32 ParameterNameLength;
u32 ParameterType; u32 ParameterType;
u32 ParameterValueOffset; u32 ParameterValueOffset;
u32 ParameterValueLength; u32 ParameterValueLength;
} RNDIS_CONFIG_PARAMETER_INFO, *PRNDIS_CONFIG_PARAMETER_INFO; };
/* Values for ParameterType in RNDIS_CONFIG_PARAMETER_INFO */ /* Values for ParameterType in struct rndis_config_parameter_info */
#define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0 #define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0
#define RNDIS_CONFIG_PARAM_TYPE_STRING 2 #define RNDIS_CONFIG_PARAM_TYPE_STRING 2
...@@ -580,20 +580,20 @@ typedef struct _RCONDIS_MP_DEACTIVATE_VC_COMPLETE { ...@@ -580,20 +580,20 @@ typedef struct _RCONDIS_MP_DEACTIVATE_VC_COMPLETE {
/* union with all of the RNDIS messages */ /* union with all of the RNDIS messages */
typedef union _RNDIS_MESSAGE_CONTAINER { union rndis_message_container {
RNDIS_PACKET Packet; struct rndis_packet Packet;
RNDIS_INITIALIZE_REQUEST InitializeRequest; struct rndis_initialize_request InitializeRequest;
RNDIS_HALT_REQUEST HaltRequest; struct rndis_halt_request HaltRequest;
RNDIS_QUERY_REQUEST QueryRequest; struct rndis_query_request QueryRequest;
RNDIS_SET_REQUEST SetRequest; struct rndis_set_request SetRequest;
RNDIS_RESET_REQUEST ResetRequest; struct rndis_reset_request ResetRequest;
RNDIS_KEEPALIVE_REQUEST KeepaliveRequest; struct rndis_keepalive_request KeepaliveRequest;
RNDIS_INDICATE_STATUS IndicateStatus; struct rndis_indicate_status IndicateStatus;
RNDIS_INITIALIZE_COMPLETE InitializeComplete; struct rndis_initialize_complete InitializeComplete;
RNDIS_QUERY_COMPLETE QueryComplete; struct rndis_query_complete QueryComplete;
RNDIS_SET_COMPLETE SetComplete; struct rndis_set_complete SetComplete;
RNDIS_RESET_COMPLETE ResetComplete; struct rndis_reset_complete ResetComplete;
RNDIS_KEEPALIVE_COMPLETE KeepaliveComplete; struct rndis_keepalive_complete KeepaliveComplete;
RCONDIS_MP_CREATE_VC CoMiniportCreateVc; RCONDIS_MP_CREATE_VC CoMiniportCreateVc;
RCONDIS_MP_DELETE_VC CoMiniportDeleteVc; RCONDIS_MP_DELETE_VC CoMiniportDeleteVc;
RCONDIS_INDICATE_STATUS CoIndicateStatus; RCONDIS_INDICATE_STATUS CoIndicateStatus;
...@@ -603,27 +603,27 @@ typedef union _RNDIS_MESSAGE_CONTAINER { ...@@ -603,27 +603,27 @@ typedef union _RNDIS_MESSAGE_CONTAINER {
RCONDIS_MP_DELETE_VC_COMPLETE CoMiniportDeleteVcComplete; RCONDIS_MP_DELETE_VC_COMPLETE CoMiniportDeleteVcComplete;
RCONDIS_MP_ACTIVATE_VC_COMPLETE CoMiniportActivateVcComplete; RCONDIS_MP_ACTIVATE_VC_COMPLETE CoMiniportActivateVcComplete;
RCONDIS_MP_DEACTIVATE_VC_COMPLETE CoMiniportDeactivateVcComplete; RCONDIS_MP_DEACTIVATE_VC_COMPLETE CoMiniportDeactivateVcComplete;
} RNDIS_MESSAGE_CONTAINER, *PRNDIS_MESSAGE_CONTAINER; };
/* Remote NDIS message format */ /* Remote NDIS message format */
typedef __struct_bcount(MessageLength) struct _RNDIS_MESSAGE { struct rndis_message {
u32 NdisMessageType; u32 NdisMessageType;
/* Total length of this message, from the beginning */ /* Total length of this message, from the beginning */
/* of the RNDIS_MESSAGE struct, in bytes. */ /* of the sruct rndis_message, in bytes. */
u32 MessageLength; u32 MessageLength;
/* Actual message */ /* Actual message */
RNDIS_MESSAGE_CONTAINER Message; union rndis_message_container Message;
} RNDIS_MESSAGE, *PRNDIS_MESSAGE; };
/* Handy macros */ /* Handy macros */
/* get the size of an RNDIS message. Pass in the message type, */ /* get the size of an RNDIS message. Pass in the message type, */
/* RNDIS_SET_REQUEST, RNDIS_PACKET for example */ /* struct rndis_set_request, struct rndis_packet for example */
#define RNDIS_MESSAGE_SIZE(Message) \ #define RNDIS_MESSAGE_SIZE(Message) \
(sizeof(Message) + (sizeof(RNDIS_MESSAGE) - \ (sizeof(Message) + (sizeof(struct rndis_message) - \
sizeof(RNDIS_MESSAGE_CONTAINER))) sizeof(union rndis_message_container)))
/* get pointer to info buffer with message pointer */ /* get pointer to info buffer with message pointer */
#define MESSAGE_TO_INFO_BUFFER(Message) \ #define MESSAGE_TO_INFO_BUFFER(Message) \
......
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