ReactOS  0.4.15-dev-439-g292f67a
ParaNdis5-Driver.c
Go to the documentation of this file.
1 /*
2  * This file contains driver-related part of NDIS5.X adapter driver.
3  *
4  * Copyright (c) 2008-2017 Red Hat, Inc.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met :
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and / or other materials provided with the distribution.
14  * 3. Neither the names of the copyright holders nor the names of their contributors
15  * may be used to endorse or promote products derived from this software
16  * without specific prior written permission.
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  */
29 #include "ParaNdis5.h"
30 
31 //#define NO_XP_POWER_MANAGEMENT
32 
33 #ifdef WPP_EVENT_TRACING
34 #include "ParaNdis5-Driver.tmh"
35 #endif
36 
38 static ULONG gID = 0;
39 
40 /******************************************************
41 Unload handler, only responsibility is cleanup WPP
42 *******************************************************/
44 {
45  DEBUG_ENTRY(0);
46  ParaNdis_DebugCleanup(pDriverObject);
47 }
48 
49 /*************************************************************
50 Required NDIS function
51 Responsible to put the adapter to known (initial) hardware state
52 
53 Do not call any NDIS functions
54 *************************************************************/
55 static VOID NTAPI ParaNdis5_Shutdown(IN NDIS_HANDLE MiniportAdapterContext)
56 {
57  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
58  ParaNdis_OnShutdown(pContext);
59 }
60 
61 /******************************************************
62 Required NDIS procedure
63 Allocates and initializes adapter context
64 Finally sets send and receive to Enabled state and reports connect
65 Returns:
66 NDIS_STATUS SUCCESS or some error code
67 *******************************************************/
70  IN PNDIS_MEDIUM MediumArray,
74 {
76  PARANDIS_ADAPTER *pContext = NULL;
77  UINT i;
78  for(i = 0; i < MediumArraySize; ++i)
79  {
80  if(MediumArray[i] == NdisMedium802_3)
81  {
84  break;
85  }
86  }
87 
89  {
90  pContext =
92  if (!pContext)
93  {
95  }
96  }
97 
99  {
100  PVOID pResourceList = &status;
101  UINT uSize = 0;
102  NdisZeroMemory(pContext, sizeof(PARANDIS_ADAPTER));
104  pContext->DriverHandle = DriverHandle;
108  if (uSize > 0)
109  pResourceList = ParaNdis_AllocateMemory(MiniportAdapterHandle, uSize);
110  else
111  pResourceList = NULL;
112  if (!pResourceList)
114  else
115  {
116  ULONG attributes;
118  // in XP SP2, if this flag is NOT set, the NDIS halts miniport
119  // upon transition to S1..S4.
120  // it seems that XP SP3 ignores it and always sends SET_POWER to D3
121 #ifndef NO_XP_POWER_MANAGEMENT
122  attributes |= NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND;
123 #endif
126  pContext,
127  0,
128  attributes,
131  status = ParaNdis_InitializeContext(pContext, (PNDIS_RESOURCE_LIST)pResourceList);
132  NdisFreeMemory(pResourceList, 0, 0);
133  }
134  }
135 
137  {
140  {
142  ParaNdis_IndicateConnect(pContext, FALSE, TRUE);
143  ParaNdis5_StopSend(pContext, FALSE, NULL);
144  ParaNdis5_StopReceive(pContext, FALSE, NULL);
145  if (!pContext->ulMilliesToConnect)
146  {
147  ParaNdis_ReportLinkStatus(pContext, FALSE);
148  }
149  else
150  {
151  NdisSetTimer(&pContext->ConnectTimer, pContext->ulMilliesToConnect);
152  }
153  }
154  else
155  {
156  ParaNdis_CleanupContext(pContext);
157  }
158  }
159 
160  if (status != NDIS_STATUS_SUCCESS && pContext)
161  {
162  NdisFreeMemory(pContext, 0, 0);
163  }
164 
166  return status;
167 }
168 
169 
170 /*************************************************************
171 Callback of delayed receive pause procedure upon reset request
172 *************************************************************/
174 {
175  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
176  DEBUG_ENTRY(0);
177  NdisSetEvent(&pContext->ResetEvent);
178 }
179 
180 /*************************************************************
181 Callback of delayed send pause procedure upon reset request
182 *************************************************************/
184 {
185  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
186  DEBUG_ENTRY(0);
187  NdisSetEvent(&pContext->ResetEvent);
188 }
189 
191 {
192  DEBUG_ENTRY(0);
193  NdisResetEvent(&pContext->ResetEvent);
195  {
196  NdisSetEvent(&pContext->ResetEvent);
197  }
198  NdisWaitEvent(&pContext->ResetEvent, 0);
199  NdisResetEvent(&pContext->ResetEvent);
201  {
202  NdisSetEvent(&pContext->ResetEvent);
203  }
204  NdisWaitEvent(&pContext->ResetEvent, 0);
205  NdisResetEvent(&pContext->ResetEvent);
206  DEBUG_EXIT_STATUS(0, 0);
207 }
208 
210 {
211  ParaNdis5_StopSend(pContext, FALSE, NULL);
212  ParaNdis5_StopReceive(pContext, FALSE, NULL);
213  DEBUG_EXIT_STATUS(0, 0);
214 }
215 
217 {
218  tGeneralWorkItem *pwi = (tGeneralWorkItem *)pWorkItem;
219  PARANDIS_ADAPTER *pContext = pwi->pContext;
220  DEBUG_ENTRY(0);
221 
222  pContext->bResetInProgress = TRUE;
224  ParaNdis_Suspend(pContext);
225  ParaNdis_Resume(pContext);
226  pContext->bResetInProgress = FALSE;
227  ParaNdis_ReportLinkStatus(pContext, FALSE);
228 
229  NdisFreeMemory(pwi, 0, 0);
232 }
233 
234 
235 /*************************************************************
236 Required NDIS procedure
237 Called when some procedure (like OID handler) returns PENDING and
238 does not complete or when CheckForHang return TRUE
239 *************************************************************/
241  OUT PBOOLEAN AddressingReset,
242  IN NDIS_HANDLE MiniportAdapterContext)
243 {
245  tGeneralWorkItem *pwi;
246  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
247  DEBUG_ENTRY(0);
248  ParaNdis_DebugHistory(pContext, hopSysReset, NULL, 1, 0, 0);
250  pwi = ParaNdis_AllocateMemory(pContext, sizeof(tGeneralWorkItem));
251  if (pwi)
252  {
253  pwi->pContext = pContext;
256  {
258  }
259  else
260  {
261  NdisFreeMemory(pwi, 0, 0);
262  }
263  }
265  {
266  ParaNdis_DebugHistory(pContext, hopSysReset, NULL, 0, status, 0);
267  }
268  return status;
269 }
270 
271 /*************************************************************
272 Callback of delayed receive pause procedure
273 *************************************************************/
275 {
276  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
277  DEBUG_ENTRY(0);
278  NdisSetEvent(&pContext->HaltEvent);
279 }
280 
281 /*************************************************************
282 Callback of delayed send pause procedure
283 *************************************************************/
285 {
286  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
287  DEBUG_ENTRY(0);
288  NdisSetEvent(&pContext->HaltEvent);
289 }
290 
291 static void WaitHaltEvent(PARANDIS_ADAPTER *pContext, const char *Reason)
292 {
293  UINT ms = 5000;
294  if (!NdisWaitEvent(&pContext->HaltEvent, 1))
295  {
296  while (!NdisWaitEvent(&pContext->HaltEvent, ms))
297  {
298  DPrintf(0, ("[%s]", __FUNCTION__));
299  }
300  }
301 }
302 
303 /*************************************************************
304 Required NDIS procedure
305 Stops TX and RX path and finished the function of adapter
306 *************************************************************/
308  IN NDIS_HANDLE MiniportAdapterContext)
309 {
311  BOOLEAN bUnused;
312  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
313  DEBUG_ENTRY(0);
314 
315  ParaNdis_DebugHistory(pContext, hopHalt, NULL, 1, 0, 0);
316 
317  NdisCancelTimer(&pContext->ConnectTimer, &bUnused);
318  NdisResetEvent(&pContext->HaltEvent);
320  NdisSetEvent(&pContext->HaltEvent);
321  WaitHaltEvent(pContext, "Send");
322  NdisResetEvent(&pContext->HaltEvent);
324  NdisSetEvent(&pContext->HaltEvent);
325  WaitHaltEvent(pContext, "Receive");
326  ParaNdis_CleanupContext(pContext);
327  NdisCancelTimer(&pContext->DPCPostProcessTimer, &bUnused);
328  ParaNdis_DebugHistory(pContext, hopHalt, NULL, 0, 0, 0);
330  NdisFreeMemory(pContext, 0, 0);
332 }
333 
334 
335 /*************************************************************
336 Called periodically (usually each 2 seconds)
337 *************************************************************/
338 static BOOLEAN NTAPI ParaNdis5_CheckForHang(IN NDIS_HANDLE MiniportAdapterContext)
339 {
340  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
341  DEBUG_ENTRY(8);
342  return ParaNdis_CheckForHang(pContext);
343 }
344 
345 /*************************************************************
346 Required NDIS procedure
347 Responsible for hardware interrupt handling
348 *************************************************************/
349 static VOID NTAPI ParaNdis5_MiniportISR(OUT PBOOLEAN InterruptRecognized,
350  OUT PBOOLEAN QueueMiniportHandleInterrupt,
351  IN NDIS_HANDLE MiniportAdapterContext)
352 {
353  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
354  BOOLEAN b;
355  *QueueMiniportHandleInterrupt = FALSE;
356  b = ParaNdis_OnLegacyInterrupt(pContext, QueueMiniportHandleInterrupt);
357  *InterruptRecognized = b;
359 }
360 
361 /*************************************************************
362 Parameters:
363 
364 Return value:
365 
366 *************************************************************/
368  IN NDIS_DEVICE_PNP_EVENT PnPEvent,
369  IN PVOID InformationBuffer,
370  IN ULONG InformationBufferLength)
371 {
372  PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
373  ParaNdis_OnPnPEvent(pContext, PnPEvent, InformationBuffer, InformationBufferLength);
374 }
375 
376 /*************************************************************
377 Driver's entry point
378 Parameters:
379  as usual
380 Return value:
381  SUCCESS or error code
382 *************************************************************/
384 {
388 
390 
391  DEBUG_ENTRY(0);
392  _LogOutString(0, __DATE__ " " __TIME__);
393 
395  DriverObject,
396  RegistryPath,
397  NULL
398  );
399 
400  if (DriverHandle)
401  {
402  NdisZeroMemory(&chars, sizeof(chars));
403  //NDIS version of the miniport
404  chars.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION;
405  chars.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION;
406  //Init and destruction
407  chars.InitializeHandler = ParaNdis5_Initialize;
408  chars.HaltHandler = ParaNdis5_Halt;
409 
410  //Interrupt and DPC handling
411  chars.HandleInterruptHandler = ParaNdis5_HandleDPC;
412  chars.ISRHandler = ParaNdis5_MiniportISR;
413 
414  //Packet transfer - send path and notification on the send packet
415  chars.SendPacketsHandler = ParaNdis5_SendPackets;
416  chars.ReturnPacketHandler = ParaNdis5_ReturnPacket;
417 
418  //OID set\get
419  chars.SetInformationHandler = ParaNdis5_SetOID;
420  chars.QueryInformationHandler = ParaNdis5_QueryOID;
421 
422  //Reset
423  chars.ResetHandler = ParaNdis5_Reset;
424  chars.CheckForHangHandler = ParaNdis5_CheckForHang; //optional
425 
426  chars.CancelSendPacketsHandler = ParaNdis5_CancelSendPackets;
427  chars.PnPEventNotifyHandler = ParaNdis5_PnPEventNotify;
428  chars.AdapterShutdownHandler = ParaNdis5_Shutdown;
429 
431  DriverHandle,
432  &chars,
433  sizeof(chars));
434  }
435 
437  {
439  }
440  else if (DriverHandle)
441  {
442  DPrintf(0, ("NdisMRegisterMiniport failed"));
444  }
445  else
446  {
447  DPrintf(0, ("NdisMInitializeWrapper failed"));
448  }
449 
450  DEBUG_EXIT_STATUS(status ? 0 : 4, status);
451  return status;
452 }
NDIS_STATUS ParaNdis_InitializeContext(PARANDIS_ADAPTER *pContext, PNDIS_RESOURCE_LIST ResourceList)
void _LogOutString(int level, const char *s)
#define DEBUG_EXIT_STATUS(level, status)
Definition: kdebugprint.h:50
#define IN
Definition: typedefs.h:39
BOOLEAN EXPORT NdisWaitEvent(IN PNDIS_EVENT Event, IN UINT MsToWait)
Definition: control.c:290
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS OpenErrorStatus
Definition: ndis.h:6008
NDIS_STATUS ParaNdis_FinishInitialization(PARANDIS_ADAPTER *pContext)
VOID EXPORT NdisMQueryAdapterResources(OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, OUT PNDIS_RESOURCE_LIST ResourceList, IN OUT PUINT BufferSize)
Definition: hardware.c:103
VOID EXPORT NdisMResetComplete(IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status, IN BOOLEAN AddressingReset)
Definition: miniport.c:2795
BOOLEAN ParaNdis_CheckForHang(PARANDIS_ADAPTER *pContext)
#define NDIS_ATTRIBUTE_DESERIALIZE
Definition: ndis.h:588
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
#define NdisInitializeWorkItem(_WI_, _R_, _C_)
Definition: ndis.h:3197
LONG EXPORT NdisInterlockedIncrement(IN PLONG Addend)
Definition: misc.c:400
NDIS_TIMER DPCPostProcessTimer
Definition: ndis56common.h:486
NDIS_STATUS ParaNdis5_StopReceive(PARANDIS_ADAPTER *pContext, BOOLEAN bStop, ONPAUSECOMPLETEPROC Callback)
NDIS_STATUS NTAPI DriverEntry(PVOID DriverObject, PVOID RegistryPath)
static NDIS_STATUS NTAPI ParaNdis5_Reset(OUT PBOOLEAN AddressingReset, IN NDIS_HANDLE MiniportAdapterContext)
#define DEBUG_ENTRY(level)
Definition: kdebugprint.h:49
* PNDIS_STATUS
Definition: ndis.h:45
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4668
#define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND
Definition: ndis.h:589
VOID EXPORT NdisSetTimer(IN PNDIS_TIMER Timer, IN UINT MillisecondsToDelay)
Definition: time.c:317
enum _NDIS_DEVICE_PNP_EVENT NDIS_DEVICE_PNP_EVENT
VOID ParaNdis_CleanupContext(PARANDIS_ADAPTER *pContext)
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT SelectedMediumIndex
Definition: ndis.h:6008
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT MediumArraySize
Definition: ndis.h:6013
#define NDIS_STATUS_UNSUPPORTED_MEDIA
Definition: ndis.h:490
VOID ParaNdis_ReportLinkStatus(PARANDIS_ADAPTER *pContext, BOOLEAN bForce)
static void WaitHaltEvent(PARANDIS_ADAPTER *pContext, const char *Reason)
static ULONG gID
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _In_ NDIS_HANDLE WrapperConfigurationContext
Definition: ndis.h:3944
VOID EXPORT NdisMRegisterUnloadHandler(IN NDIS_HANDLE NdisWrapperHandle, IN PDRIVER_UNLOAD UnloadHandler)
Definition: miniport.c:3151
int NDIS_STATUS
Definition: ntddndis.h:471
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PVOID ParaNdis_AllocateMemory(PARANDIS_ADAPTER *pContext, ULONG ulRequiredSize)
#define DPrintf(Level, Fmt)
Definition: kdebugprint.h:61
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
NDIS_STATUS EXPORT NdisScheduleWorkItem(IN PNDIS_WORK_ITEM pWorkItem)
Definition: misc.c:467
NDIS_STATUS ParaNdis5_StopSend(PARANDIS_ADAPTER *pContext, BOOLEAN bStop, ONPAUSECOMPLETEPROC Callback)
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
static NDIS_HANDLE DriverHandle
static VOID NTAPI ParaNdis5_Shutdown(IN NDIS_HANDLE MiniportAdapterContext)
#define b
Definition: ke_i.h:79
PPARANDIS_ADAPTER pContext
Definition: ParaNdis5.h:85
VOID ParaNdis_Suspend(PARANDIS_ADAPTER *pContext)
VOID NTAPI ParaNdis5_HandleDPC(IN NDIS_HANDLE MiniportAdapterContext)
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
VOID EXPORT NdisTerminateWrapper(IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific)
Definition: miniport.c:3012
VOID NTAPI ParaNdis5_PnPEventNotify(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_DEVICE_PNP_EVENT PnPEvent, IN PVOID InformationBuffer, IN ULONG InformationBufferLength)
#define NDIS_ATTRIBUTE_BUS_MASTER
Definition: ndis.h:586
static VOID OnReceiveStopped(VOID *p)
NDIS_HANDLE MiniportHandle
Definition: ndis56common.h:349
NDIS_STATUS NTAPI ParaNdis5_QueryOID(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesWritten, OUT PULONG BytesNeeded)
void ParaNdis_IndicateConnect(PARANDIS_ADAPTER *pContext, BOOLEAN bConnected, BOOLEAN bForce)
NDIS_TIMER ConnectTimer
Definition: ndis56common.h:485
NDIS_STATUS NTAPI ParaNdis5_SetOID(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesRead, OUT PULONG BytesNeeded)
BOOLEAN ParaNdis_OnLegacyInterrupt(PARANDIS_ADAPTER *pContext, BOOLEAN *pRunDpc)
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
VOID NTAPI ParaNdis5_ReturnPacket(IN NDIS_HANDLE MiniportAdapterContext, IN PNDIS_PACKET Packet)
char * PBOOLEAN
Definition: retypes.h:11
static VOID OnSendStopped(VOID *p)
static NDIS_STATUS NTAPI ParaNdis5_Initialize(OUT PNDIS_STATUS OpenErrorStatus, OUT PUINT SelectedMediumIndex, IN PNDIS_MEDIUM MediumArray, IN UINT MediumArraySize, IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE WrapperConfigurationContext)
static void OnReceiveStoppedOnReset(VOID *p)
VOID EXPORT NdisResetEvent(IN PNDIS_EVENT Event)
Definition: control.c:256
enum _NDIS_MEDIUM * PNDIS_MEDIUM
NDIS_HANDLE DriverHandle
Definition: ndis56common.h:348
void ParaNdis_DebugCleanup(PDRIVER_OBJECT pDriverObject)
static VOID NTAPI ParaNdis5_MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
static void OnSendStoppedOnReset(VOID *p)
static void FORCEINLINE ParaNdis_DebugHistory(PARANDIS_ADAPTER *pContext, eHistoryLogOperation op, PVOID pParam1, ULONG lParam2, ULONG lParam3, ULONG lParam4)
Definition: ndis56common.h:647
static BOOLEAN NTAPI ParaNdis5_CheckForHang(IN NDIS_HANDLE MiniportAdapterContext)
static VOID NTAPI ParaNdis5_Halt(IN NDIS_HANDLE MiniportAdapterContext)
VOID EXPORT NdisSetEvent(IN PNDIS_EVENT Event)
Definition: control.c:273
NDIS_WORK_ITEM wi
Definition: ParaNdis5.h:84
void ParaNdis_DebugRegisterMiniport(PARANDIS_ADAPTER *pContext, BOOLEAN bRegister)
VOID ParaNdis_OnPnPEvent(PARANDIS_ADAPTER *pContext, NDIS_DEVICE_PNP_EVENT pEvent, PVOID pInfo, ULONG ulSize)
NDIS_HANDLE WrapperConfigurationHandle
Definition: ndis56common.h:481
unsigned int UINT
Definition: ndis.h:50
VOID NTAPI ParaNdis5_CancelSendPackets(IN NDIS_HANDLE MiniportAdapterContext, IN PVOID CancelId)
void ParaNdis_DebugInitialize(PVOID DriverObject, PVOID RegistryPath)
#define NdisZeroMemory(Destination, Length)
Definition: ndis.h:3926
static VOID NTAPI ParaVirtualNICUnload(IN PDRIVER_OBJECT pDriverObject)
#define OUT
Definition: typedefs.h:40
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
Definition: ndis.h:5592
GLfloat GLfloat p
Definition: glext.h:8902
VOID ParaNdis_OnShutdown(PARANDIS_ADAPTER *pContext)
NDIS_STATUS EXPORT NdisMRegisterMiniport(IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, IN UINT CharacteristicsLength)
Definition: miniport.c:2637
VOID EXPORT NdisCancelTimer(IN PNDIS_TIMER Timer, OUT PBOOLEAN TimerCancelled)
Definition: time.c:27
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:45
#define __FUNCTION__
Definition: types.h:112
VOID ParaNdis_Resume(PARANDIS_ADAPTER *pContext)
static SERVICE_STATUS status
Definition: service.c:31
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
Definition: memory.c:110
VOID EXPORT NdisMSetAttributesEx(IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE MiniportAdapterContext, IN UINT CheckForHangTimeInSeconds OPTIONAL, IN ULONG AttributeFlags, IN NDIS_INTERFACE_TYPE AdapterType)
Definition: miniport.c:2883
unsigned int * PUINT
Definition: ndis.h:50
VOID NTAPI ParaNdis5_SendPackets(IN NDIS_HANDLE MiniportAdapterContext, IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets)
static void NTAPI OnResetWorkItem(NDIS_WORK_ITEM *pWorkItem, PVOID Context)
Definition: ps.c:97