2008-08-29 Andy Grover <andy.grover@oracle.com>
* include/ddk/ndis.h (NDIS_MINIPORT_MAJOR_VERSION, NDIS_MINIPORT_MINOR_VERSION, struct NDIS_TASK_OFFLOAD_HEADER, PROTOCOL_RESERVED_SIZE_IN_PACKET, NdisGetFirstBufferFromPacketSafe, NdisMIndicateReceivePacket, NdisSetPacketPoolProtocolId, NdisMInitializeTimer, NdisMSetPeriodicTimer, NdisMCancelTimer): Define. (enum NDIS_ENCAPSULATION, struct NDIS_ENCAPSULATION_FORMAT): move in file. (struct _NDIS_PACKET): Define using _ANONYMOUS_UNION and ANONYMOUS_STRUCT to eliminate warnings. (NdisReinitializePacket): Rename from NdisReinitializePacketCounts. * lib/ddk/ndis.def (NdisInitAnsiString, NdisInitUnicodeString, NdisMCancelTimer, NdisMInitializeTimer, NdisMSetPeriodicTimer, NdisSetPacketPoolProtocolId): Export.
This commit is contained in:
parent
1138964dd8
commit
1c931bf118
@ -1,3 +1,18 @@
|
|||||||
|
2008-08-29 Andy Grover <andy.grover@oracle.com>
|
||||||
|
|
||||||
|
* include/ddk/ndis.h (NDIS_MINIPORT_MAJOR_VERSION, NDIS_MINIPORT_MINOR_VERSION,
|
||||||
|
struct NDIS_TASK_OFFLOAD_HEADER, PROTOCOL_RESERVED_SIZE_IN_PACKET,
|
||||||
|
NdisGetFirstBufferFromPacketSafe, NdisMIndicateReceivePacket,
|
||||||
|
NdisSetPacketPoolProtocolId, NdisMInitializeTimer, NdisMSetPeriodicTimer,
|
||||||
|
NdisMCancelTimer): Define.
|
||||||
|
(enum NDIS_ENCAPSULATION, struct NDIS_ENCAPSULATION_FORMAT): move in file.
|
||||||
|
(struct _NDIS_PACKET): Define using _ANONYMOUS_UNION and ANONYMOUS_STRUCT to
|
||||||
|
eliminate warnings.
|
||||||
|
(NdisReinitializePacket): Rename from NdisReinitializePacketCounts.
|
||||||
|
* lib/ddk/ndis.def (NdisInitAnsiString, NdisInitUnicodeString, NdisMCancelTimer,
|
||||||
|
NdisMInitializeTimer, NdisMSetPeriodicTimer, NdisSetPacketPoolProtocolId):
|
||||||
|
Export.
|
||||||
|
|
||||||
2008-08-29 Andy Grover <andy.grover@oracle.com>
|
2008-08-29 Andy Grover <andy.grover@oracle.com>
|
||||||
|
|
||||||
* include/ddk/winddk.h (RtlStringCbCopyA, RtlStringCbPrintfA,
|
* include/ddk/winddk.h (RtlStringCbCopyA, RtlStringCbPrintfA,
|
||||||
|
@ -52,12 +52,16 @@ extern "C" {
|
|||||||
#if defined(NDIS50_MINIPORT)
|
#if defined(NDIS50_MINIPORT)
|
||||||
#ifndef NDIS50
|
#ifndef NDIS50
|
||||||
#define NDIS50
|
#define NDIS50
|
||||||
|
#define NDIS_MINIPORT_MAJOR_VERSION 5
|
||||||
|
#define NDIS_MINIPORT_MINOR_VERSION 0
|
||||||
#endif
|
#endif
|
||||||
#endif /* NDIS50_MINIPORT */
|
#endif /* NDIS50_MINIPORT */
|
||||||
|
|
||||||
#if defined(NDIS51_MINIPORT)
|
#if defined(NDIS51_MINIPORT)
|
||||||
#ifndef NDIS51
|
#ifndef NDIS51
|
||||||
#define NDIS51
|
#define NDIS51
|
||||||
|
#define NDIS_MINIPORT_MAJOR_VERSION 5
|
||||||
|
#define NDIS_MINIPORT_MINOR_VERSION 1
|
||||||
#endif
|
#endif
|
||||||
#endif /* NDIS51_MINIPORT */
|
#endif /* NDIS51_MINIPORT */
|
||||||
|
|
||||||
@ -399,19 +403,19 @@ typedef struct _NDIS_PACKET_PRIVATE {
|
|||||||
|
|
||||||
typedef struct _NDIS_PACKET {
|
typedef struct _NDIS_PACKET {
|
||||||
NDIS_PACKET_PRIVATE Private;
|
NDIS_PACKET_PRIVATE Private;
|
||||||
union {
|
_ANONYMOUS_UNION union {
|
||||||
struct {
|
_ANONYMOUS_STRUCT struct {
|
||||||
UCHAR MiniportReserved[2 * sizeof(PVOID)];
|
UCHAR MiniportReserved[2 * sizeof(PVOID)];
|
||||||
UCHAR WrapperReserved[2 * sizeof(PVOID)];
|
UCHAR WrapperReserved[2 * sizeof(PVOID)];
|
||||||
} s1;
|
} DUMMYSTRUCTNAME;
|
||||||
struct {
|
_ANONYMOUS_STRUCT struct {
|
||||||
UCHAR MiniportReservedEx[3 * sizeof(PVOID)];
|
UCHAR MiniportReservedEx[3 * sizeof(PVOID)];
|
||||||
UCHAR WrapperReservedEx[sizeof(PVOID)];
|
UCHAR WrapperReservedEx[sizeof(PVOID)];
|
||||||
} s2;
|
} DUMMYSTRUCTNAME;
|
||||||
struct {
|
_ANONYMOUS_STRUCT struct {
|
||||||
UCHAR MacReserved[4 * sizeof(PVOID)];
|
UCHAR MacReserved[4 * sizeof(PVOID)];
|
||||||
} s3;
|
} DUMMYSTRUCTNAME;
|
||||||
} u;
|
} DUMMYUNIONNAME;
|
||||||
ULONG_PTR Reserved[2];
|
ULONG_PTR Reserved[2];
|
||||||
UCHAR ProtocolReserved[1];
|
UCHAR ProtocolReserved[1];
|
||||||
} NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
|
} NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
|
||||||
@ -915,18 +919,6 @@ typedef struct _NDIS_TASK_IPSEC {
|
|||||||
} V4ESP;
|
} V4ESP;
|
||||||
} NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC;
|
} NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC;
|
||||||
|
|
||||||
typedef struct _NDIS_TASK_OFFLOAD {
|
|
||||||
ULONG Version;
|
|
||||||
ULONG Size;
|
|
||||||
NDIS_TASK Task;
|
|
||||||
ULONG OffsetNextTask;
|
|
||||||
ULONG TaskBufferLength;
|
|
||||||
UCHAR TaskBuffer[1];
|
|
||||||
} NDIS_TASK_OFFLOAD, *PNDIS_TASK_OFFLOAD;
|
|
||||||
|
|
||||||
/* NDIS_TASK_OFFLOAD_HEADER.Version constants */
|
|
||||||
#define NDIS_TASK_OFFLOAD_VERSION 1
|
|
||||||
|
|
||||||
typedef enum _NDIS_ENCAPSULATION {
|
typedef enum _NDIS_ENCAPSULATION {
|
||||||
UNSPECIFIED_Encapsulation,
|
UNSPECIFIED_Encapsulation,
|
||||||
NULL_Encapsulation,
|
NULL_Encapsulation,
|
||||||
@ -945,6 +937,27 @@ typedef struct _NDIS_ENCAPSULATION_FORMAT {
|
|||||||
ULONG EncapsulationHeaderSize;
|
ULONG EncapsulationHeaderSize;
|
||||||
} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
|
} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
|
||||||
|
|
||||||
|
typedef struct _NDIS_TASK_OFFLOAD_HEADER
|
||||||
|
{
|
||||||
|
ULONG Version;
|
||||||
|
ULONG Size;
|
||||||
|
ULONG Reserved;
|
||||||
|
UCHAR OffsetFirstTask;
|
||||||
|
NDIS_ENCAPSULATION_FORMAT EncapsulationFormat;
|
||||||
|
} NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER;
|
||||||
|
|
||||||
|
typedef struct _NDIS_TASK_OFFLOAD {
|
||||||
|
ULONG Version;
|
||||||
|
ULONG Size;
|
||||||
|
NDIS_TASK Task;
|
||||||
|
ULONG OffsetNextTask;
|
||||||
|
ULONG TaskBufferLength;
|
||||||
|
UCHAR TaskBuffer[1];
|
||||||
|
} NDIS_TASK_OFFLOAD, *PNDIS_TASK_OFFLOAD;
|
||||||
|
|
||||||
|
/* NDIS_TASK_OFFLOAD_HEADER.Version constants */
|
||||||
|
#define NDIS_TASK_OFFLOAD_VERSION 1
|
||||||
|
|
||||||
typedef struct _NDIS_TASK_TCP_IP_CHECKSUM {
|
typedef struct _NDIS_TASK_TCP_IP_CHECKSUM {
|
||||||
struct {
|
struct {
|
||||||
ULONG IpOptionsSupported:1;
|
ULONG IpOptionsSupported:1;
|
||||||
@ -1543,6 +1556,8 @@ NdisAllocatePacketPool(
|
|||||||
/*IN*/ UINT NumberOfDescriptors,
|
/*IN*/ UINT NumberOfDescriptors,
|
||||||
/*IN*/ UINT ProtocolReservedLength);
|
/*IN*/ UINT ProtocolReservedLength);
|
||||||
|
|
||||||
|
#define PROTOCOL_RESERVED_SIZE_IN_PACKET (4 * sizeof(PVOID))
|
||||||
|
|
||||||
NDISAPI
|
NDISAPI
|
||||||
VOID
|
VOID
|
||||||
DDKAPI
|
DDKAPI
|
||||||
@ -1754,6 +1769,46 @@ NdisFreeBuffer(
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* VOID
|
||||||
|
* NdisGetFirstBufferFromPacketSafe(
|
||||||
|
* IN PNDIS_PACKET _Packet,
|
||||||
|
* OUT PNDIS_BUFFER * _FirstBuffer,
|
||||||
|
* OUT PVOID * _FirstBufferVA,
|
||||||
|
* OUT PUINT _FirstBufferLength,
|
||||||
|
* OUT PUINT _TotalBufferLength),
|
||||||
|
* IN MM_PAGE_PRIORITY _Priority)
|
||||||
|
*/
|
||||||
|
#define NdisGetFirstBufferFromPacketSafe(_Packet, \
|
||||||
|
_FirstBuffer, \
|
||||||
|
_FirstBufferVA, \
|
||||||
|
_FirstBufferLength, \
|
||||||
|
_TotalBufferLength, \
|
||||||
|
_Priority) \
|
||||||
|
{ \
|
||||||
|
PNDIS_BUFFER _Buffer; \
|
||||||
|
\
|
||||||
|
_Buffer = (_Packet)->Private.Head; \
|
||||||
|
*(_FirstBuffer) = _Buffer; \
|
||||||
|
if (_Buffer != NULL) \
|
||||||
|
{ \
|
||||||
|
*(_FirstBufferVA) = MmGetSystemAddressForMdlSafe(_Buffer, _Priority); \
|
||||||
|
*(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
|
||||||
|
_Buffer = _Buffer->Next; \
|
||||||
|
*(_TotalBufferLength) = *(_FirstBufferLength); \
|
||||||
|
while (_Buffer != NULL) { \
|
||||||
|
*(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
|
||||||
|
_Buffer = _Buffer->Next; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
*(_FirstBufferVA) = 0; \
|
||||||
|
*(_FirstBufferLength) = 0; \
|
||||||
|
*(_TotalBufferLength) = 0; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VOID
|
* VOID
|
||||||
* NdisQueryBuffer(
|
* NdisQueryBuffer(
|
||||||
@ -2092,7 +2147,7 @@ NdisFreeBuffer(
|
|||||||
* NdisReinitializePacket(
|
* NdisReinitializePacket(
|
||||||
* IN OUT PNDIS_PACKET Packet);
|
* IN OUT PNDIS_PACKET Packet);
|
||||||
*/
|
*/
|
||||||
#define NdisReinitializePacketCounts(Packet) \
|
#define NdisReinitializePacket(Packet) \
|
||||||
{ \
|
{ \
|
||||||
(Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
|
(Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
|
||||||
(Packet)->Private.ValidCounts = FALSE; \
|
(Packet)->Private.ValidCounts = FALSE; \
|
||||||
@ -2967,6 +3022,11 @@ NdisMWanIndicateReceive(
|
|||||||
/*IN*/ PUCHAR PacketBuffer,
|
/*IN*/ PUCHAR PacketBuffer,
|
||||||
/*IN*/ UINT PacketSize);
|
/*IN*/ UINT PacketSize);
|
||||||
|
|
||||||
|
#define NdisMIndicateReceivePacket(_handle, _packets, _number) \
|
||||||
|
{ \
|
||||||
|
(*((PNDIS_MINIPORT_BLOCK)(_handle))->PacketIndicateHandler)(_handle, _packets, _number); \
|
||||||
|
}
|
||||||
|
|
||||||
NDISAPI
|
NDISAPI
|
||||||
VOID
|
VOID
|
||||||
DDKAPI
|
DDKAPI
|
||||||
@ -3156,6 +3216,13 @@ DDKAPI
|
|||||||
NdisPacketPoolUsage(
|
NdisPacketPoolUsage(
|
||||||
/*IN*/ NDIS_HANDLE PoolHandle);
|
/*IN*/ NDIS_HANDLE PoolHandle);
|
||||||
|
|
||||||
|
NTOSAPI
|
||||||
|
VOID
|
||||||
|
DDKAPI
|
||||||
|
NdisSetPacketPoolProtocolId(
|
||||||
|
/*IN*/ NDIS_HANDLE PacketPoolHandle,
|
||||||
|
/*IN*/ UINT ProtocolId);
|
||||||
|
|
||||||
NDISAPI
|
NDISAPI
|
||||||
NDIS_STATUS
|
NDIS_STATUS
|
||||||
DDKAPI
|
DDKAPI
|
||||||
@ -4517,6 +4584,29 @@ struct _NDIS_OPEN_BLOCK
|
|||||||
|
|
||||||
/* Routines for NDIS miniport drivers */
|
/* Routines for NDIS miniport drivers */
|
||||||
|
|
||||||
|
NTOSAPI
|
||||||
|
VOID
|
||||||
|
DDKAPI
|
||||||
|
NdisMInitializeTimer(
|
||||||
|
/*IN*/ /*OUT*/ PNDIS_MINIPORT_TIMER Timer,
|
||||||
|
/*IN*/ NDIS_HANDLE MiniportAdapterHandle,
|
||||||
|
/*IN*/ PNDIS_TIMER_FUNCTION TimerFunction,
|
||||||
|
/*IN*/ PVOID FunctionContext);
|
||||||
|
|
||||||
|
NTOSAPI
|
||||||
|
VOID
|
||||||
|
DDKAPI
|
||||||
|
NdisMSetPeriodicTimer(
|
||||||
|
/*IN*/ PNDIS_MINIPORT_TIMER Timer,
|
||||||
|
/*IN*/ UINT MillisecondsPeriod);
|
||||||
|
|
||||||
|
NTOSAPI
|
||||||
|
VOID
|
||||||
|
DDKAPI
|
||||||
|
NdisMCancelTimer(
|
||||||
|
/*IN*/ PNDIS_MINIPORT_TIMER Timer,
|
||||||
|
/*OUT*/ PBOOLEAN TimerCancelled);
|
||||||
|
|
||||||
NDISAPI
|
NDISAPI
|
||||||
VOID
|
VOID
|
||||||
DDKAPI
|
DDKAPI
|
||||||
|
@ -130,8 +130,8 @@ NdisImmediateReadSharedMemory@16
|
|||||||
;NdisImmediateWritePortUlong
|
;NdisImmediateWritePortUlong
|
||||||
;NdisImmediateWritePortUshort
|
;NdisImmediateWritePortUshort
|
||||||
NdisImmediateWriteSharedMemory@16
|
NdisImmediateWriteSharedMemory@16
|
||||||
;NdisInitAnsiString DATA
|
NdisInitAnsiString@8
|
||||||
;NdisInitUnicodeString DATA
|
NdisInitUnicodeString@8
|
||||||
;NdisInitializeEvent
|
;NdisInitializeEvent
|
||||||
NdisInitializeReadWriteLock@4
|
NdisInitializeReadWriteLock@4
|
||||||
;NdisInitializeString
|
;NdisInitializeString
|
||||||
@ -149,7 +149,7 @@ NdisInitializeWrapper@16
|
|||||||
NdisMAllocateMapRegisters@20
|
NdisMAllocateMapRegisters@20
|
||||||
NdisMAllocateSharedMemory@20
|
NdisMAllocateSharedMemory@20
|
||||||
NdisMAllocateSharedMemoryAsync@16
|
NdisMAllocateSharedMemoryAsync@16
|
||||||
;NdisMCancelTimer
|
NdisMCancelTimer@8
|
||||||
NdisMCloseLog@4
|
NdisMCloseLog@4
|
||||||
NdisMCmActivateVc@8
|
NdisMCmActivateVc@8
|
||||||
NdisMCmCreateVc@16
|
NdisMCmCreateVc@16
|
||||||
@ -179,7 +179,7 @@ NdisMGetDeviceProperty@24
|
|||||||
;NdisMIndicateStatus
|
;NdisMIndicateStatus
|
||||||
;NdisMIndicateStatusComplete
|
;NdisMIndicateStatusComplete
|
||||||
NdisMInitializeScatterGatherDma@12
|
NdisMInitializeScatterGatherDma@12
|
||||||
;NdisMInitializeTimer
|
NdisMInitializeTimer@16
|
||||||
NdisMMapIoSpace@20
|
NdisMMapIoSpace@20
|
||||||
;NdisMPciAssignResources
|
;NdisMPciAssignResources
|
||||||
NdisMPromoteMiniport@4
|
NdisMPromoteMiniport@4
|
||||||
@ -202,7 +202,7 @@ NdisMRemoveMiniport@4
|
|||||||
NdisMSetAttributesEx@20
|
NdisMSetAttributesEx@20
|
||||||
;NdisMSetInformationComplete
|
;NdisMSetInformationComplete
|
||||||
NdisMSetMiniportSecondary@8
|
NdisMSetMiniportSecondary@8
|
||||||
;NdisMSetPeriodicTimer
|
NdisMSetPeriodicTimer@8
|
||||||
;NdisMSetTimer
|
;NdisMSetTimer
|
||||||
NdisMSleep@4
|
NdisMSleep@4
|
||||||
;NdisMStartBufferPhysicalMapping
|
;NdisMStartBufferPhysicalMapping
|
||||||
@ -252,7 +252,7 @@ NdisSend@12
|
|||||||
NdisSendPackets@12
|
NdisSendPackets@12
|
||||||
;NdisSetEvent
|
;NdisSetEvent
|
||||||
;NdisSetPacketCancelId
|
;NdisSetPacketCancelId
|
||||||
;NdisSetPacketPoolProtocolId
|
NdisSetPacketPoolProtocolId@8
|
||||||
;NdisSetPacketStatus
|
;NdisSetPacketStatus
|
||||||
;NdisSetProtocolFilter
|
;NdisSetProtocolFilter
|
||||||
;NdisSetTimer
|
;NdisSetTimer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user