mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 18:37:08 +00:00
[DDK/NDIS]
- Group some related definitions. - Remove some duplicated NDIS_MINIPORT_MAJOR_VERSION/NDIS_MINIPORT_MINOR_VERSION combinations. - Add some missing NDIS_LEGACY_DRIVER guards. - _ANONYMOUS_UNION -> __MINGW_EXTENSION - Update NDIS_PROCESSOR_TYPE and NDIS_INTERFACE_TYPE. - Guard NDIS_GENERIC_OBJECT with NDIS_SUPPORT_NDIS6. - Add missing NDIS_WAN_GET_STATS, NdisAllocateGenericObject, NdisFreeGenericObject, fPACKET_WRAPPER_RESERVED and NDIS_FLAGS_* definitions. - PNDIS_PACKET_POOL : HANDLE -> NDIS_HANDLE. - Improve MEDIA_SPECIFIC_INFORMATION - Some minor formatting. svn path=/trunk/; revision=48169
This commit is contained in:
parent
b03d6b06cd
commit
281e92894d
1 changed files with 221 additions and 128 deletions
|
@ -251,38 +251,73 @@ typedef struct _NET_PNP_EVENT {
|
|||
|
||||
#endif /* !defined(NDIS_LEGACY_PROTOCOL) */
|
||||
|
||||
#if !defined(NDIS_LEGACY_DRIVER)
|
||||
|
||||
#if (NDIS_LEGACY_MINIPORT || NDIS_LEGACY_PROTOCOL || NDIS_WRAPPER)
|
||||
#define NDIS_LEGACY_DRIVER 1
|
||||
#else
|
||||
#define NDIS_LEGACY_DRIVER 0
|
||||
#endif
|
||||
|
||||
#endif /* !defined(NDIS_LEGACY_DRIVER) */
|
||||
|
||||
#if !defined(NDIS_SUPPORT_NDIS6)
|
||||
|
||||
#if ((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) || \
|
||||
(defined (NDIS60)) || NDIS_WRAPPER)
|
||||
#define NDIS_SUPPORT_NDIS6 1
|
||||
#else
|
||||
#define NDIS_SUPPORT_NDIS6 0
|
||||
#endif
|
||||
|
||||
#endif /* !defined(NDIS_SUPPORT_NDIS6) */
|
||||
|
||||
#if !defined(NDIS_SUPPORT_NDIS61)
|
||||
#if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
|
||||
(defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 1))) || \
|
||||
(defined (NDIS61)) || NDIS_WRAPPER)
|
||||
#define NDIS_SUPPORT_NDIS61 1
|
||||
#else
|
||||
#define NDIS_SUPPORT_NDIS61 0
|
||||
#endif
|
||||
#endif // !defined(NDIS_SUPPORT_NDIS61)
|
||||
|
||||
#if !defined(NDIS_SUPPORT_NDIS620)
|
||||
|
||||
#if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
|
||||
(defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 20))) || \
|
||||
(defined (NDIS620)) || NDIS_WRAPPER)
|
||||
#define NDIS_SUPPORT_NDIS620 1
|
||||
#else
|
||||
#define NDIS_SUPPORT_NDIS620 0
|
||||
#endif
|
||||
|
||||
#endif /* !defined(NDIS_SUPPORT_NDIS620) */
|
||||
|
||||
#if (NDIS_SUPPORT_NDIS620)
|
||||
#undef NDIS_SUPPORT_NDIS61
|
||||
#define NDIS_SUPPORT_NDIS61 1
|
||||
#endif
|
||||
|
||||
#if (NDIS_SUPPORT_NDIS61)
|
||||
#undef NDIS_SUPPORT_NDIS6
|
||||
#define NDIS_SUPPORT_NDIS6 1
|
||||
#endif
|
||||
|
||||
#if defined(NDIS61_MINIPORT) || defined(NDIS60_MINIPORT) || defined(NDIS61) || \
|
||||
defined(NDIS60) || defined(NDIS_WRAPPER) || defined(NDIS_LEGACY_DRIVER)
|
||||
#define NDIS_SUPPORT_60_COMPATIBLE_API 1
|
||||
#else
|
||||
#define NDIS_SUPPORT_60_COMPATIBLE_API 0
|
||||
#endif
|
||||
|
||||
#if defined(NDIS_WRAPPER)
|
||||
#define NDISAPI
|
||||
#else
|
||||
#define NDISAPI DECLSPEC_IMPORT
|
||||
#endif
|
||||
|
||||
#if defined(NDIS50_MINIPORT) && !defined(NDIS_MINIPORT_MAJOR_VERSION) && !defined(NDIS_MINIPORT_MINOR_VERSION)
|
||||
#define NDIS_MINIPORT_MAJOR_VERSION 5
|
||||
#define NDIS_MINIPORT_MINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
#if defined(NDIS51_MINIPORT) && !defined(NDIS_MINIPORT_MAJOR_VERSION) && !defined(NDIS_MINIPORT_MINOR_VERSION)
|
||||
#define NDIS_MINIPORT_MAJOR_VERSION 5
|
||||
#define NDIS_MINIPORT_MINOR_VERSION 1
|
||||
#endif
|
||||
|
||||
#if defined(NDIS50) && !defined(NDIS_PROTOCOL_MAJOR_VERSION) && !defined(NDIS_PROTOCOL_MINOR_VERSION)
|
||||
#define NDIS_PROTOCOL_MAJOR_VERSION 5
|
||||
#define NDIS_PROTOCOL_MINOR_VERSION 0
|
||||
#endif
|
||||
|
||||
#if defined(NDIS51) && !defined(NDIS_PROTOCOL_MAJOR_VERSION) && !defined(NDIS_PROTOCOL_MINOR_VERSION)
|
||||
#define NDIS_PROTOCOL_MAJOR_VERSION 5
|
||||
#define NDIS_PROTOCOL_MINOR_VERSION 1
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
/* FIXME: */
|
||||
typedef PVOID QUEUED_CLOSE;
|
||||
#endif
|
||||
|
||||
typedef ULONG NDIS_OID, *PNDIS_OID;
|
||||
typedef PVOID QUEUED_CLOSE; //FIXME : Doesn't exist in public headers
|
||||
|
||||
typedef struct _X_FILTER FDDI_FILTER, *PFDDI_FILTER;
|
||||
typedef struct _X_FILTER TR_FILTER, *PTR_FILTER;
|
||||
|
@ -300,7 +335,7 @@ typedef struct _REFERENCE {
|
|||
typedef struct _NDIS_SPIN_LOCK {
|
||||
KSPIN_LOCK SpinLock;
|
||||
KIRQL OldIrql;
|
||||
} NDIS_SPIN_LOCK, * PNDIS_SPIN_LOCK;
|
||||
} NDIS_SPIN_LOCK, *PNDIS_SPIN_LOCK;
|
||||
|
||||
typedef struct _NDIS_EVENT {
|
||||
KEVENT Event;
|
||||
|
@ -561,12 +596,30 @@ typedef struct _NDIS_GUID {
|
|||
#define NDIS_GUID_UNICODE_STRING 0x00000008
|
||||
#define NDIS_GUID_ARRAY 0x00000010
|
||||
|
||||
typedef HANDLE PNDIS_PACKET_POOL;
|
||||
#if NDIS_LEGACY_DRIVER
|
||||
|
||||
/* NDIS_PACKET_PRIVATE.Flags constants */
|
||||
#define fPACKET_WRAPPER_RESERVED 0x3f
|
||||
#define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40
|
||||
#define fPACKET_ALLOCATED_BY_NDIS 0x80
|
||||
|
||||
#define NDIS_FLAGS_PROTOCOL_ID_MASK 0x0000000f
|
||||
#define NDIS_FLAGS_MULTICAST_PACKET 0x00000010
|
||||
#define NDIS_FLAGS_RESERVED2 0x00000020
|
||||
#define NDIS_FLAGS_RESERVED3 0x00000040
|
||||
#define NDIS_FLAGS_DONT_LOOPBACK 0x00000080
|
||||
#define NDIS_FLAGS_IS_LOOPBACK_PACKET 0x00000100
|
||||
#define NDIS_FLAGS_LOOPBACK_ONLY 0x00000200
|
||||
#define NDIS_FLAGS_RESERVED4 0x00000400
|
||||
#define NDIS_FLAGS_DOUBLE_BUFFERED 0x00000800
|
||||
#define NDIS_FLAGS_SENT_AT_DPC 0x00001000
|
||||
#define NDIS_FLAGS_USES_SG_BUFFER_LIST 0x00002000
|
||||
#define NDIS_FLAGS_USES_ORIGINAL_PACKET 0x00004000
|
||||
#define NDIS_FLAGS_PADDED 0x00010000
|
||||
#define NDIS_FLAGS_XLATE_AT_TOP 0x00020000
|
||||
|
||||
typedef NDIS_HANDLE PNDIS_PACKET_POOL;
|
||||
|
||||
typedef struct _NDIS_PACKET_PRIVATE {
|
||||
UINT PhysicalCount;
|
||||
UINT TotalLength;
|
||||
|
@ -578,7 +631,9 @@ typedef struct _NDIS_PACKET_PRIVATE {
|
|||
BOOLEAN ValidCounts;
|
||||
UCHAR NdisPacketFlags;
|
||||
USHORT NdisPacketOobOffset;
|
||||
} NDIS_PACKET_PRIVATE, * PNDIS_PACKET_PRIVATE;
|
||||
} NDIS_PACKET_PRIVATE, *PNDIS_PACKET_PRIVATE;
|
||||
|
||||
#endif /* NDIS_LEGACY_DRIVER */
|
||||
|
||||
typedef struct _NDIS_PACKET {
|
||||
NDIS_PACKET_PRIVATE Private;
|
||||
|
@ -606,24 +661,26 @@ typedef enum _NDIS_CLASS_ID {
|
|||
NdisClassAtmAALInfo
|
||||
} NDIS_CLASS_ID;
|
||||
|
||||
typedef struct MediaSpecificInformation {
|
||||
typedef struct _MEDIA_SPECIFIC_INFORMATION {
|
||||
UINT NextEntryOffset;
|
||||
NDIS_CLASS_ID ClassId;
|
||||
UINT Size;
|
||||
UCHAR ClassInformation[1];
|
||||
} MEDIA_SPECIFIC_INFORMATION;
|
||||
} MEDIA_SPECIFIC_INFORMATION, *PMEDIA_SPECIFIC_INFORMATION;
|
||||
|
||||
#if NDIS_LEGACY_DRIVER
|
||||
typedef struct _NDIS_PACKET_OOB_DATA {
|
||||
_ANONYMOUS_UNION union {
|
||||
__MINGW_EXTENSION union {
|
||||
ULONGLONG TimeToSend;
|
||||
ULONGLONG TimeSent;
|
||||
} DUMMYUNIONNAME;
|
||||
};
|
||||
ULONGLONG TimeReceived;
|
||||
UINT HeaderSize;
|
||||
UINT SizeMediaSpecificInfo;
|
||||
PVOID MediaSpecificInformation;
|
||||
NDIS_STATUS Status;
|
||||
} NDIS_PACKET_OOB_DATA, *PNDIS_PACKET_OOB_DATA;
|
||||
#endif
|
||||
|
||||
typedef struct _NDIS_PM_PACKET_PATTERN {
|
||||
ULONG Priority;
|
||||
|
@ -737,7 +794,8 @@ typedef enum _NDIS_PROCESSOR_TYPE {
|
|||
NdisProcessorMips,
|
||||
NdisProcessorAlpha,
|
||||
NdisProcessorPpc,
|
||||
NdisProcessorAmd64
|
||||
NdisProcessorAmd64,
|
||||
NdisProcessorIA64
|
||||
} NDIS_PROCESSOR_TYPE, *PNDIS_PROCESSOR_TYPE;
|
||||
|
||||
typedef enum _NDIS_ENVIRONMENT_TYPE {
|
||||
|
@ -761,13 +819,16 @@ typedef enum _NDIS_INTERFACE_TYPE {
|
|||
NdisInterfaceInternalPowerBus = InternalPowerBus,
|
||||
NdisInterfacePNPISABus = PNPISABus,
|
||||
NdisInterfacePNPBus = PNPBus,
|
||||
NdisInterfaceUSB,
|
||||
NdisInterfaceIrda,
|
||||
NdisInterface1394,
|
||||
NdisMaximumInterfaceType
|
||||
} NDIS_INTERFACE_TYPE, *PNDIS_INTERFACE_TYPE;
|
||||
|
||||
#define NdisInterruptLevelSensitive LevelSensitive
|
||||
#define NdisInterruptLatched Latched
|
||||
typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE;
|
||||
|
||||
typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE;
|
||||
|
||||
typedef enum _NDIS_PARAMETER_TYPE {
|
||||
NdisParameterInteger,
|
||||
|
@ -777,7 +838,7 @@ typedef enum _NDIS_PARAMETER_TYPE {
|
|||
NdisParameterBinary
|
||||
} NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE;
|
||||
|
||||
typedef struct {
|
||||
typedef struct _BINARY_DATA {
|
||||
USHORT Length;
|
||||
PVOID Buffer;
|
||||
} BINARY_DATA;
|
||||
|
@ -791,7 +852,6 @@ typedef struct _NDIS_CONFIGURATION_PARAMETER {
|
|||
} ParameterData;
|
||||
} NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER;
|
||||
|
||||
|
||||
typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS, *PNDIS_PHYSICAL_ADDRESS;
|
||||
|
||||
typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT {
|
||||
|
@ -817,7 +877,6 @@ typedef struct _NDIS_WAN_LINE_UP {
|
|||
NDIS_STRING DeviceName;
|
||||
} NDIS_WAN_LINE_UP, *PNDIS_WAN_LINE_UP;
|
||||
|
||||
|
||||
typedef VOID
|
||||
(NTAPI *ADAPTER_SHUTDOWN_HANDLER)(
|
||||
IN PVOID ShutdownContext);
|
||||
|
@ -1032,12 +1091,14 @@ typedef struct _NDIS_PACKET_EXTENSION {
|
|||
PVOID NdisPacketInfo[MaxPerPacketInfo];
|
||||
} NDIS_PACKET_EXTENSION, *PNDIS_PACKET_EXTENSION;
|
||||
|
||||
#if NDIS_SUPPORT_NDIS6
|
||||
typedef struct _NDIS_GENERIC_OBJECT {
|
||||
NDIS_OBJECT_HEADER Header;
|
||||
PVOID Caller;
|
||||
PVOID CallersCaller;
|
||||
PDRIVER_OBJECT DriverObject;
|
||||
} NDIS_GENERIC_OBJECT, *PNDIS_GENERIC_OBJECT;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PNDIS_PACKET
|
||||
|
@ -1244,6 +1305,23 @@ typedef struct _WAN_CO_LINKPARAMS {
|
|||
ULONG SendWindow;
|
||||
} WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS;
|
||||
|
||||
typedef struct _NDIS_WAN_GET_STATS {
|
||||
UCHAR LocalAddress[6];
|
||||
ULONG BytesSent;
|
||||
ULONG BytesRcvd;
|
||||
ULONG FramesSent;
|
||||
ULONG FramesRcvd;
|
||||
ULONG CRCErrors;
|
||||
ULONG TimeoutErrors;
|
||||
ULONG AlignmentErrors;
|
||||
ULONG SerialOverrunErrors;
|
||||
ULONG FramingErrors;
|
||||
ULONG BufferOverrunErrors;
|
||||
ULONG BytesTransmittedUncompressed;
|
||||
ULONG BytesReceivedUncompressed;
|
||||
ULONG BytesTransmittedCompressed;
|
||||
ULONG BytesReceivedCompressed;
|
||||
} NDIS_WAN_GET_STATS, *PNDIS_WAN_GET_STATS;
|
||||
|
||||
/* Call Manager */
|
||||
|
||||
|
@ -2120,7 +2198,6 @@ NdisQueryBufferOffset(
|
|||
((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
|
||||
(_Packet)->Private.NdisPacketOobOffset))->HeaderSize
|
||||
|
||||
|
||||
/*
|
||||
* NDIS_STATUS
|
||||
* NDIS_GET_PACKET_STATUS(
|
||||
|
@ -4238,8 +4315,8 @@ typedef struct _NDIS_MINIPORT_WORK_ITEM {
|
|||
|
||||
struct _NDIS_WORK_ITEM;
|
||||
typedef VOID (*NDIS_PROC)(struct _NDIS_WORK_ITEM *, PVOID);
|
||||
typedef struct _NDIS_WORK_ITEM
|
||||
{
|
||||
|
||||
typedef struct _NDIS_WORK_ITEM {
|
||||
PVOID Context;
|
||||
NDIS_PROC Routine;
|
||||
UCHAR WrapperReserved[8*sizeof(PVOID)];
|
||||
|
@ -4700,10 +4777,26 @@ struct _NDIS_OPEN_BLOCK
|
|||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* Routines for NDIS miniport drivers */
|
||||
|
||||
#if NDIS_SUPPORT_NDIS6
|
||||
|
||||
NDISAPI
|
||||
PNDIS_GENERIC_OBJECT
|
||||
NTAPI
|
||||
NdisAllocateGenericObject(
|
||||
PDRIVER_OBJECT DriverObject OPTIONAL,
|
||||
ULONG Tag,
|
||||
USHORT Size);
|
||||
|
||||
NDISAPI
|
||||
VOID
|
||||
NTAPI
|
||||
NdisFreeGenericObject(
|
||||
IN PNDIS_GENERIC_OBJECT NdisObject);
|
||||
|
||||
#endif /* NDIS_SUPPORT_NDIS6 */
|
||||
|
||||
NDISAPI
|
||||
VOID
|
||||
NTAPI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue