win-pvdrivers

view mingw/w32api.diff @ 371:f7fa99be363d

update mingw build doc and add diff of w32api changes needed.
author Andy Grover <andy.grover@oracle.com>
date Wed Jul 09 00:35:41 2008 -0700 (2008-07-09)
parents
children f038c7581cf4
line source
1 diff -r 79e257d5a1f7 include/ddk/ndis.h
2 --- a/include/ddk/ndis.h Tue Jul 08 22:16:37 2008 -0700
3 +++ b/include/ddk/ndis.h Wed Jul 09 00:34:21 2008 -0700
4 @@ -52,12 +52,16 @@ extern "C" {
5 #if defined(NDIS50_MINIPORT)
6 #ifndef NDIS50
7 #define NDIS50
8 +#define NDIS_MINIPORT_MAJOR_VERSION 5
9 +#define NDIS_MINIPORT_MINOR_VERSION 0
10 #endif
11 #endif /* NDIS50_MINIPORT */
13 #if defined(NDIS51_MINIPORT)
14 #ifndef NDIS51
15 #define NDIS51
16 +#define NDIS_MINIPORT_MAJOR_VERSION 5
17 +#define NDIS_MINIPORT_MINOR_VERSION 1
18 #endif
19 #endif /* NDIS51_MINIPORT */
21 @@ -399,19 +403,19 @@ typedef struct _NDIS_PACKET_PRIVATE {
23 typedef struct _NDIS_PACKET {
24 NDIS_PACKET_PRIVATE Private;
25 - union {
26 - struct {
27 + _ANONYMOUS_UNION union {
28 + _ANONYMOUS_STRUCT struct {
29 UCHAR MiniportReserved[2 * sizeof(PVOID)];
30 UCHAR WrapperReserved[2 * sizeof(PVOID)];
31 - } s1;
32 - struct {
33 + } DUMMYSTRUCTNAME;
34 + _ANONYMOUS_STRUCT struct {
35 UCHAR MiniportReservedEx[3 * sizeof(PVOID)];
36 UCHAR WrapperReservedEx[sizeof(PVOID)];
37 - } s2;
38 - struct {
39 + } DUMMYSTRUCTNAME;
40 + _ANONYMOUS_STRUCT struct {
41 UCHAR MacReserved[4 * sizeof(PVOID)];
42 - } s3;
43 - } u;
44 + } DUMMYSTRUCTNAME;
45 + } DUMMYUNIONNAME;
46 ULONG_PTR Reserved[2];
47 UCHAR ProtocolReserved[1];
48 } NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
49 @@ -642,6 +646,13 @@ typedef enum _NDIS_PNP_DEVICE_STATE {
50 #define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080
51 #define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100
53 +typedef enum _NDIS_DEVICE_PNP_EVENT
54 +{
55 + /* couldn't find public docs on other values */
56 + NdisDevicePnpEventSurpriseRemoved=2,
57 + NdisDevicePnpEventPowerProfileChanged=5
58 +} NDIS_DEVICE_PNP_EVENT;
59 +
61 /* OID_GEN_NETWORK_LAYER_ADDRESSES */
62 typedef struct _NETWORK_ADDRESS {
63 @@ -915,6 +926,33 @@ typedef struct _NDIS_TASK_IPSEC {
64 } V4ESP;
65 } NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC;
67 +typedef enum _NDIS_ENCAPSULATION {
68 + UNSPECIFIED_Encapsulation,
69 + NULL_Encapsulation,
70 + IEEE_802_3_Encapsulation,
71 + IEEE_802_5_Encapsulation,
72 + LLC_SNAP_ROUTED_Encapsulation,
73 + LLC_SNAP_BRIDGED_Encapsulation
74 +} NDIS_ENCAPSULATION;
75 +
76 +typedef struct _NDIS_ENCAPSULATION_FORMAT {
77 + NDIS_ENCAPSULATION Encapsulation;
78 + struct {
79 + ULONG FixedHeaderSize : 1;
80 + ULONG Reserved : 31;
81 + } Flags;
82 + ULONG EncapsulationHeaderSize;
83 +} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
84 +
85 +typedef struct _NDIS_TASK_OFFLOAD_HEADER
86 +{
87 + ULONG Version;
88 + ULONG Size;
89 + ULONG Reserved;
90 + UCHAR OffsetFirstTask;
91 + NDIS_ENCAPSULATION_FORMAT EncapsulationFormat;
92 +} NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER;
93 +
94 typedef struct _NDIS_TASK_OFFLOAD {
95 ULONG Version;
96 ULONG Size;
97 @@ -926,24 +964,6 @@ typedef struct _NDIS_TASK_OFFLOAD {
99 /* NDIS_TASK_OFFLOAD_HEADER.Version constants */
100 #define NDIS_TASK_OFFLOAD_VERSION 1
101 -
102 -typedef enum _NDIS_ENCAPSULATION {
103 - UNSPECIFIED_Encapsulation,
104 - NULL_Encapsulation,
105 - IEEE_802_3_Encapsulation,
106 - IEEE_802_5_Encapsulation,
107 - LLC_SNAP_ROUTED_Encapsulation,
108 - LLC_SNAP_BRIDGED_Encapsulation
109 -} NDIS_ENCAPSULATION;
110 -
111 -typedef struct _NDIS_ENCAPSULATION_FORMAT {
112 - NDIS_ENCAPSULATION Encapsulation;
113 - struct {
114 - ULONG FixedHeaderSize : 1;
115 - ULONG Reserved : 31;
116 - } Flags;
117 - ULONG EncapsulationHeaderSize;
118 -} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
120 typedef struct _NDIS_TASK_TCP_IP_CHECKSUM {
121 struct {
122 @@ -1542,6 +1562,8 @@ NdisAllocatePacketPool(
123 /*OUT*/ PNDIS_HANDLE PoolHandle,
124 /*IN*/ UINT NumberOfDescriptors,
125 /*IN*/ UINT ProtocolReservedLength);
126 +
127 +#define PROTOCOL_RESERVED_SIZE_IN_PACKET (4 * sizeof(PVOID))
129 NDISAPI
130 VOID
131 @@ -1756,6 +1778,46 @@ NdisFreeBuffer(
133 /*
134 * VOID
135 + * NdisGetFirstBufferFromPacketSafe(
136 + * IN PNDIS_PACKET _Packet,
137 + * OUT PNDIS_BUFFER * _FirstBuffer,
138 + * OUT PVOID * _FirstBufferVA,
139 + * OUT PUINT _FirstBufferLength,
140 + * OUT PUINT _TotalBufferLength),
141 + * IN MM_PAGE_PRIORITY _Priority)
142 + */
143 +#define NdisGetFirstBufferFromPacketSafe(_Packet, \
144 + _FirstBuffer, \
145 + _FirstBufferVA, \
146 + _FirstBufferLength, \
147 + _TotalBufferLength, \
148 + _Priority) \
149 +{ \
150 + PNDIS_BUFFER _Buffer; \
151 + \
152 + _Buffer = (_Packet)->Private.Head; \
153 + *(_FirstBuffer) = _Buffer; \
154 + if (_Buffer != NULL) \
155 + { \
156 + *(_FirstBufferVA) = MmGetSystemAddressForMdlSafe(_Buffer, _Priority); \
157 + *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
158 + _Buffer = _Buffer->Next; \
159 + *(_TotalBufferLength) = *(_FirstBufferLength); \
160 + while (_Buffer != NULL) { \
161 + *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
162 + _Buffer = _Buffer->Next; \
163 + } \
164 + } \
165 + else \
166 + { \
167 + *(_FirstBufferVA) = 0; \
168 + *(_FirstBufferLength) = 0; \
169 + *(_TotalBufferLength) = 0; \
170 + } \
171 +}
172 +
173 +/*
174 + * VOID
175 * NdisQueryBuffer(
176 * IN PNDIS_BUFFER Buffer,
177 * OUT PVOID *VirtualAddress OPTIONAL,
178 @@ -2092,7 +2154,7 @@ NdisFreeBuffer(
179 * NdisReinitializePacket(
180 * IN OUT PNDIS_PACKET Packet);
181 */
182 -#define NdisReinitializePacketCounts(Packet) \
183 +#define NdisReinitializePacket(Packet) \
184 { \
185 (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
186 (Packet)->Private.ValidCounts = FALSE; \
187 @@ -2967,6 +3029,11 @@ NdisMWanIndicateReceive(
188 /*IN*/ PUCHAR PacketBuffer,
189 /*IN*/ UINT PacketSize);
191 +#define NdisMIndicateReceivePacket(_handle, _packets, _number) \
192 +{ \
193 + (*((PNDIS_MINIPORT_BLOCK)(_handle))->PacketIndicateHandler)(_handle, _packets, _number); \
194 +}
195 +
196 NDISAPI
197 VOID
198 DDKAPI
199 @@ -3155,6 +3222,13 @@ DDKAPI
200 DDKAPI
201 NdisPacketPoolUsage(
202 /*IN*/ NDIS_HANDLE PoolHandle);
203 +
204 +NTOSAPI
205 +VOID
206 +DDKAPI
207 +NdisSetPacketPoolProtocolId(
208 + /*IN*/ NDIS_HANDLE PacketPoolHandle,
209 + /*IN*/ UINT ProtocolId);
211 NDISAPI
212 NDIS_STATUS
213 @@ -4517,6 +4591,29 @@ struct _NDIS_OPEN_BLOCK
215 /* Routines for NDIS miniport drivers */
217 +NTOSAPI
218 +VOID
219 +DDKAPI
220 +NdisMInitializeTimer(
221 + /*IN*/ /*OUT*/ PNDIS_MINIPORT_TIMER Timer,
222 + /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
223 + /*IN*/ PNDIS_TIMER_FUNCTION TimerFunction,
224 + /*IN*/ PVOID FunctionContext);
225 +
226 +NTOSAPI
227 +VOID
228 +DDKAPI
229 +NdisMSetPeriodicTimer(
230 + /*IN*/ PNDIS_MINIPORT_TIMER Timer,
231 + /*IN*/ UINT MillisecondsPeriod);
232 +
233 +NTOSAPI
234 +VOID
235 +DDKAPI
236 +NdisMCancelTimer(
237 + /*IN*/ PNDIS_MINIPORT_TIMER Timer,
238 + /*OUT*/ PBOOLEAN TimerCancelled);
239 +
240 NDISAPI
241 VOID
242 DDKAPI
243 diff -r 79e257d5a1f7 include/ddk/ntddndis.h
244 --- a/include/ddk/ntddndis.h Tue Jul 08 22:16:37 2008 -0700
245 +++ b/include/ddk/ntddndis.h Wed Jul 09 00:34:21 2008 -0700
246 @@ -179,6 +179,13 @@ typedef struct _NDIS_PNP_CAPABILITIES {
247 #define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000
248 #define NDIS_MINIPORT_64BITS_DMA 0x01000000
250 +/* TCP offload OIDs */
251 +#define OID_TCP_TASK_OFFLOAD 0xFC010201
252 +#define OID_TCP_TASK_IPSEC_ADD_SA 0xFC010202
253 +#define OID_TCP_TASK_IPSEC_ADD_UDPESP_SA 0xFC010203
254 +#define OID_TCP_TASK_IPSEC_DELETE_SA 0xFC010204
255 +#define OID_TCP_TASK_IPSEC_DELETE_UDPESP_SA 0xFC010205
256 +
257 #pragma pack(pop)
259 #ifdef __cplusplus
260 diff -r 79e257d5a1f7 include/ddk/winddk.h
261 --- a/include/ddk/winddk.h Tue Jul 08 22:16:37 2008 -0700
262 +++ b/include/ddk/winddk.h Wed Jul 09 00:34:21 2008 -0700
263 @@ -4896,6 +4896,10 @@ RtlStringFromGUID(
264 /*IN*/ REFGUID Guid,
265 /*OUT*/ PUNICODE_STRING GuidString);
267 +#define RtlStringCbCopyA(dst, dst_len, src) strncpy(dst, src, dst_len)
268 +#define RtlStringCbPrintfA(args...) snprintf(args)
269 +#define RtlStringCbVPrintfA(args...) vsnprintf(args)
270 +
271 NTOSAPI
272 BOOLEAN
273 DDKAPI
274 @@ -7726,38 +7730,18 @@ KeWaitForSingleObject(
275 /*IN*/ BOOLEAN Alertable,
276 /*IN*/ PLARGE_INTEGER Timeout /*OPTIONAL*/);
278 -#if defined(_X86_)
279 -
280 -NTOSAPI
281 -VOID
282 -FASTCALL
283 -KfLowerIrql(
284 - /*IN*/ KIRQL NewIrql);
285 -
286 -NTOSAPI
287 -KIRQL
288 -FASTCALL
289 -KfRaiseIrql(
290 - /*IN*/ KIRQL NewIrql);
291 -
292 -#define KeLowerIrql(a) KfLowerIrql(a)
293 -#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
294 -
295 -#else
296 -
297 -NTOSAPI
298 -VOID
299 -DDKAPI
300 +NTOSAPI
301 +VOID
302 +DDKAPI
303 +KeRaiseIrql(
304 + /*IN*/ KIRQL new_irql,
305 + /*OUT*/ PKIRQL old_irql);
306 +
307 +NTOSAPI
308 +VOID
309 +DDKAPI
310 KeLowerIrql(
311 - /*IN*/ KIRQL NewIrql);
312 -
313 -NTOSAPI
314 -KIRQL
315 -DDKAPI
316 -KeRaiseIrql(
317 - /*IN*/ KIRQL NewIrql);
318 -
319 -#endif
320 + /*IN*/ KIRQL irql);
322 NTOSAPI
323 KIRQL
324 diff -r 79e257d5a1f7 lib/ddk/ndis.def
325 --- a/lib/ddk/ndis.def Tue Jul 08 22:16:37 2008 -0700
326 +++ b/lib/ddk/ndis.def Wed Jul 09 00:34:21 2008 -0700
327 @@ -130,8 +130,8 @@ NdisImmediateReadSharedMemory@16
328 ;NdisImmediateWritePortUlong
329 ;NdisImmediateWritePortUshort
330 NdisImmediateWriteSharedMemory@16
331 -;NdisInitAnsiString DATA
332 -;NdisInitUnicodeString DATA
333 +NdisInitAnsiString@8
334 +NdisInitUnicodeString@8
335 ;NdisInitializeEvent
336 NdisInitializeReadWriteLock@4
337 ;NdisInitializeString
338 @@ -149,7 +149,7 @@ NdisMAllocateMapRegisters@20
339 NdisMAllocateMapRegisters@20
340 NdisMAllocateSharedMemory@20
341 NdisMAllocateSharedMemoryAsync@16
342 -;NdisMCancelTimer
343 +NdisMCancelTimer@8
344 NdisMCloseLog@4
345 NdisMCmActivateVc@8
346 NdisMCmCreateVc@16
347 @@ -179,7 +179,7 @@ NdisMGetDeviceProperty@24
348 ;NdisMIndicateStatus
349 ;NdisMIndicateStatusComplete
350 NdisMInitializeScatterGatherDma@12
351 -;NdisMInitializeTimer
352 +NdisMInitializeTimer@16
353 NdisMMapIoSpace@20
354 ;NdisMPciAssignResources
355 NdisMPromoteMiniport@4
356 @@ -202,7 +202,7 @@ NdisMSetAttributesEx@20
357 NdisMSetAttributesEx@20
358 ;NdisMSetInformationComplete
359 NdisMSetMiniportSecondary@8
360 -;NdisMSetPeriodicTimer
361 +NdisMSetPeriodicTimer@8
362 ;NdisMSetTimer
363 NdisMSleep@4
364 ;NdisMStartBufferPhysicalMapping
365 @@ -252,7 +252,7 @@ NdisSendPackets@12
366 NdisSendPackets@12
367 ;NdisSetEvent
368 ;NdisSetPacketCancelId
369 -;NdisSetPacketPoolProtocolId
370 +NdisSetPacketPoolProtocolId@8
371 ;NdisSetPacketStatus
372 ;NdisSetProtocolFilter
373 ;NdisSetTimer