ReactOS 0.4.15-dev-7889-g76290a6
ParaNdis5-Driver.c File Reference
#include "ParaNdis5.h"
Include dependency graph for ParaNdis5-Driver.c:

Go to the source code of this file.

Functions

static VOID NTAPI ParaVirtualNICUnload (IN PDRIVER_OBJECT pDriverObject)
 
static VOID NTAPI ParaNdis5_Shutdown (IN NDIS_HANDLE MiniportAdapterContext)
 
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)
 
static void OnSendStoppedOnReset (VOID *p)
 
VOID ParaNdis_Suspend (PARANDIS_ADAPTER *pContext)
 
VOID ParaNdis_Resume (PARANDIS_ADAPTER *pContext)
 
static void NTAPI OnResetWorkItem (NDIS_WORK_ITEM *pWorkItem, PVOID Context)
 
static NDIS_STATUS NTAPI ParaNdis5_Reset (OUT PBOOLEAN AddressingReset, IN NDIS_HANDLE MiniportAdapterContext)
 
static VOID OnReceiveStopped (VOID *p)
 
static VOID OnSendStopped (VOID *p)
 
static void WaitHaltEvent (PARANDIS_ADAPTER *pContext, const char *Reason)
 
static VOID NTAPI ParaNdis5_Halt (IN NDIS_HANDLE MiniportAdapterContext)
 
static BOOLEAN NTAPI ParaNdis5_CheckForHang (IN NDIS_HANDLE MiniportAdapterContext)
 
static VOID NTAPI ParaNdis5_MiniportISR (OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
 
VOID NTAPI ParaNdis5_PnPEventNotify (IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_DEVICE_PNP_EVENT PnPEvent, IN PVOID InformationBuffer, IN ULONG InformationBufferLength)
 
NDIS_STATUS NTAPI DriverEntry (PVOID DriverObject, PVOID RegistryPath)
 

Variables

static NDIS_HANDLE DriverHandle
 
static ULONG gID = 0
 

Function Documentation

◆ DriverEntry()

NDIS_STATUS NTAPI DriverEntry ( PVOID  DriverObject,
PVOID  RegistryPath 
)

Definition at line 383 of file ParaNdis5-Driver.c.

384{
388
390
391 DEBUG_ENTRY(0);
392 _LogOutString(0, __DATE__ " " __TIME__);
393
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
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
451 return status;
452}
static VOID NTAPI ParaNdis5_Halt(IN NDIS_HANDLE MiniportAdapterContext)
static NDIS_HANDLE DriverHandle
static NDIS_STATUS NTAPI ParaNdis5_Reset(OUT PBOOLEAN AddressingReset, IN NDIS_HANDLE MiniportAdapterContext)
static VOID NTAPI ParaNdis5_MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
static BOOLEAN NTAPI ParaNdis5_CheckForHang(IN NDIS_HANDLE MiniportAdapterContext)
static VOID NTAPI ParaVirtualNICUnload(IN PDRIVER_OBJECT pDriverObject)
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)
VOID NTAPI ParaNdis5_PnPEventNotify(IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_DEVICE_PNP_EVENT PnPEvent, IN PVOID InformationBuffer, IN ULONG InformationBufferLength)
static VOID NTAPI ParaNdis5_Shutdown(IN NDIS_HANDLE MiniportAdapterContext)
VOID NTAPI ParaNdis5_SendPackets(IN NDIS_HANDLE MiniportAdapterContext, IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets)
VOID NTAPI ParaNdis5_ReturnPacket(IN NDIS_HANDLE MiniportAdapterContext, IN PNDIS_PACKET Packet)
VOID NTAPI ParaNdis5_CancelSendPackets(IN NDIS_HANDLE MiniportAdapterContext, IN PVOID CancelId)
VOID NTAPI ParaNdis5_HandleDPC(IN NDIS_HANDLE MiniportAdapterContext)
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)
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)
#define NULL
Definition: types.h:112
#define DEBUG_ENTRY(level)
Definition: kdebugprint.h:49
#define DPrintf(Level, Fmt)
Definition: kdebugprint.h:61
#define DEBUG_EXIT_STATUS(level, status)
Definition: kdebugprint.h:50
void _LogOutString(int level, const char *s)
void ParaNdis_DebugInitialize(PVOID DriverObject, PVOID RegistryPath)
#define NdisZeroMemory(Destination, Length)
Definition: ndis.h:3926
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
Definition: ndis.h:5592
VOID EXPORT NdisMRegisterUnloadHandler(IN NDIS_HANDLE NdisWrapperHandle, IN PDRIVER_UNLOAD UnloadHandler)
Definition: miniport.c:3151
NDIS_STATUS EXPORT NdisMRegisterMiniport(IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, IN UINT CharacteristicsLength)
Definition: miniport.c:2637
VOID EXPORT NdisTerminateWrapper(IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific)
Definition: miniport.c:3012
int NDIS_STATUS
Definition: ntddndis.h:475
Definition: ps.c:97
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

◆ OnReceiveStopped()

static VOID OnReceiveStopped ( VOID p)
static

Definition at line 274 of file ParaNdis5-Driver.c.

275{
276 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
277 DEBUG_ENTRY(0);
278 NdisSetEvent(&pContext->HaltEvent);
279}
VOID EXPORT NdisSetEvent(IN PNDIS_EVENT Event)
Definition: control.c:273
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by ParaNdis5_Halt().

◆ OnReceiveStoppedOnReset()

static void OnReceiveStoppedOnReset ( VOID p)
static

Definition at line 173 of file ParaNdis5-Driver.c.

174{
175 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
176 DEBUG_ENTRY(0);
177 NdisSetEvent(&pContext->ResetEvent);
178}

Referenced by ParaNdis_Suspend().

◆ OnResetWorkItem()

static void NTAPI OnResetWorkItem ( NDIS_WORK_ITEM pWorkItem,
PVOID  Context 
)
static

Definition at line 216 of file ParaNdis5-Driver.c.

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;
228
229 NdisFreeMemory(pwi, 0, 0);
232}
@ hopSysReset
Definition: DebugData.h:48
VOID ParaNdis_Resume(PARANDIS_ADAPTER *pContext)
VOID ParaNdis_Suspend(PARANDIS_ADAPTER *pContext)
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
Definition: memory.c:110
void ParaNdis_IndicateConnect(PARANDIS_ADAPTER *pContext, BOOLEAN bConnected, BOOLEAN bForce)
VOID ParaNdis_ReportLinkStatus(PARANDIS_ADAPTER *pContext, BOOLEAN bForce)
static void FORCEINLINE ParaNdis_DebugHistory(PARANDIS_ADAPTER *pContext, eHistoryLogOperation op, PVOID pParam1, ULONG lParam2, ULONG lParam3, ULONG lParam4)
Definition: ndis56common.h:647
#define NdisMResetComplete(MiniportAdapterHandle, Status, AddressingReset)
Definition: ndis.h:5674
PPARANDIS_ADAPTER pContext
Definition: ParaNdis5.h:85
NDIS_HANDLE MiniportHandle
Definition: ndis56common.h:349

Referenced by ParaNdis5_Reset().

◆ OnSendStopped()

static VOID OnSendStopped ( VOID p)
static

Definition at line 284 of file ParaNdis5-Driver.c.

285{
286 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
287 DEBUG_ENTRY(0);
288 NdisSetEvent(&pContext->HaltEvent);
289}

Referenced by ParaNdis5_Halt().

◆ OnSendStoppedOnReset()

static void OnSendStoppedOnReset ( VOID p)
static

Definition at line 183 of file ParaNdis5-Driver.c.

184{
185 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)p;
186 DEBUG_ENTRY(0);
187 NdisSetEvent(&pContext->ResetEvent);
188}

Referenced by ParaNdis_Suspend().

◆ ParaNdis5_CheckForHang()

static BOOLEAN NTAPI ParaNdis5_CheckForHang ( IN NDIS_HANDLE  MiniportAdapterContext)
static

Definition at line 338 of file ParaNdis5-Driver.c.

339{
340 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
341 DEBUG_ENTRY(8);
342 return ParaNdis_CheckForHang(pContext);
343}
BOOLEAN ParaNdis_CheckForHang(PARANDIS_ADAPTER *pContext)

Referenced by DriverEntry().

◆ ParaNdis5_Halt()

static VOID NTAPI ParaNdis5_Halt ( IN NDIS_HANDLE  MiniportAdapterContext)
static

Definition at line 307 of file ParaNdis5-Driver.c.

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}
@ hopHalt
Definition: DebugData.h:49
static VOID OnSendStopped(VOID *p)
static VOID OnReceiveStopped(VOID *p)
static void WaitHaltEvent(PARANDIS_ADAPTER *pContext, const char *Reason)
NDIS_STATUS ParaNdis5_StopReceive(PARANDIS_ADAPTER *pContext, BOOLEAN bStop, ONPAUSECOMPLETEPROC Callback)
NDIS_STATUS ParaNdis5_StopSend(PARANDIS_ADAPTER *pContext, BOOLEAN bStop, ONPAUSECOMPLETEPROC Callback)
unsigned char BOOLEAN
VOID EXPORT NdisResetEvent(IN PNDIS_EVENT Event)
Definition: control.c:256
VOID EXPORT NdisCancelTimer(IN PNDIS_TIMER Timer, OUT PBOOLEAN TimerCancelled)
Definition: time.c:27
VOID ParaNdis_CleanupContext(PARANDIS_ADAPTER *pContext)
void ParaNdis_DebugRegisterMiniport(PARANDIS_ADAPTER *pContext, BOOLEAN bRegister)
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
NDIS_TIMER DPCPostProcessTimer
Definition: ndis56common.h:486
NDIS_TIMER ConnectTimer
Definition: ndis56common.h:485

Referenced by DriverEntry().

◆ ParaNdis5_Initialize()

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

Definition at line 68 of file ParaNdis5-Driver.c.

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
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 {
143 ParaNdis5_StopSend(pContext, FALSE, NULL);
144 ParaNdis5_StopReceive(pContext, FALSE, NULL);
145 if (!pContext->ulMilliesToConnect)
146 {
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}
static ULONG gID
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 NdisSetTimer(IN PNDIS_TIMER Timer, IN UINT MillisecondsToDelay)
Definition: time.c:317
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
NDIS_STATUS ParaNdis_FinishInitialization(PARANDIS_ADAPTER *pContext)
PVOID ParaNdis_AllocateMemory(PARANDIS_ADAPTER *pContext, ULONG ulRequiredSize)
NDIS_STATUS ParaNdis_InitializeContext(PARANDIS_ADAPTER *pContext, PNDIS_RESOURCE_LIST ResourceList)
#define NdisInterlockedIncrement(Addend)
Definition: ndis.h:4386
unsigned int UINT
Definition: ndis.h:50
#define NDIS_ATTRIBUTE_BUS_MASTER
Definition: ndis.h:586
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT SelectedMediumIndex
Definition: ndis.h:6011
#define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND
Definition: ndis.h:589
#define NDIS_ATTRIBUTE_DESERIALIZE
Definition: ndis.h:588
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT MediumArraySize
Definition: ndis.h:6013
@ NdisInterfacePci
Definition: ndis.h:905
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _In_ NDIS_HANDLE WrapperConfigurationContext
Definition: ndis.h:3946
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4668
#define NDIS_STATUS_UNSUPPORTED_MEDIA
Definition: ndis.h:490
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
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
@ NdisMedium802_3
Definition: ntddndis.h:188
NDIS_HANDLE WrapperConfigurationHandle
Definition: ndis56common.h:481
NDIS_HANDLE DriverHandle
Definition: ndis56common.h:348
uint32_t ULONG
Definition: typedefs.h:59

Referenced by DriverEntry().

◆ ParaNdis5_MiniportISR()

static VOID NTAPI ParaNdis5_MiniportISR ( OUT PBOOLEAN  InterruptRecognized,
OUT PBOOLEAN  QueueMiniportHandleInterrupt,
IN NDIS_HANDLE  MiniportAdapterContext 
)
static

Definition at line 349 of file ParaNdis5-Driver.c.

352{
353 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
354 BOOLEAN b;
355 *QueueMiniportHandleInterrupt = FALSE;
356 b = ParaNdis_OnLegacyInterrupt(pContext, QueueMiniportHandleInterrupt);
357 *InterruptRecognized = b;
359}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
BOOLEAN ParaNdis_OnLegacyInterrupt(PARANDIS_ADAPTER *pContext, BOOLEAN *pRunDpc)

Referenced by DriverEntry().

◆ ParaNdis5_PnPEventNotify()

VOID NTAPI ParaNdis5_PnPEventNotify ( IN NDIS_HANDLE  MiniportAdapterContext,
IN NDIS_DEVICE_PNP_EVENT  PnPEvent,
IN PVOID  InformationBuffer,
IN ULONG  InformationBufferLength 
)

Definition at line 367 of file ParaNdis5-Driver.c.

371{
372 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
373 ParaNdis_OnPnPEvent(pContext, PnPEvent, InformationBuffer, InformationBufferLength);
374}
VOID ParaNdis_OnPnPEvent(PARANDIS_ADAPTER *pContext, NDIS_DEVICE_PNP_EVENT pEvent, PVOID pInfo, ULONG ulSize)

Referenced by DriverEntry().

◆ ParaNdis5_Reset()

static NDIS_STATUS NTAPI ParaNdis5_Reset ( OUT PBOOLEAN  AddressingReset,
IN NDIS_HANDLE  MiniportAdapterContext 
)
static

Definition at line 240 of file ParaNdis5-Driver.c.

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}
static void NTAPI OnResetWorkItem(NDIS_WORK_ITEM *pWorkItem, PVOID Context)
NDIS_STATUS EXPORT NdisScheduleWorkItem(IN PNDIS_WORK_ITEM pWorkItem)
Definition: misc.c:467
#define NdisInitializeWorkItem(_WI_, _R_, _C_)
Definition: ndis.h:3197
NDIS_WORK_ITEM wi
Definition: ParaNdis5.h:84

Referenced by DriverEntry().

◆ ParaNdis5_Shutdown()

static VOID NTAPI ParaNdis5_Shutdown ( IN NDIS_HANDLE  MiniportAdapterContext)
static

Definition at line 55 of file ParaNdis5-Driver.c.

56{
57 PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
58 ParaNdis_OnShutdown(pContext);
59}
VOID ParaNdis_OnShutdown(PARANDIS_ADAPTER *pContext)

Referenced by DriverEntry().

◆ ParaNdis_Resume()

VOID ParaNdis_Resume ( PARANDIS_ADAPTER pContext)

Definition at line 209 of file ParaNdis5-Driver.c.

210{
211 ParaNdis5_StopSend(pContext, FALSE, NULL);
212 ParaNdis5_StopReceive(pContext, FALSE, NULL);
213 DEBUG_EXIT_STATUS(0, 0);
214}

Referenced by OnResetWorkItem(), and ParaNdis_PowerOn().

◆ ParaNdis_Suspend()

VOID ParaNdis_Suspend ( PARANDIS_ADAPTER pContext)

Definition at line 190 of file ParaNdis5-Driver.c.

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}
static void OnSendStoppedOnReset(VOID *p)
static void OnReceiveStoppedOnReset(VOID *p)
BOOLEAN EXPORT NdisWaitEvent(IN PNDIS_EVENT Event, IN UINT MsToWait)
Definition: control.c:290

Referenced by OnResetWorkItem(), and ParaNdis_PowerOff().

◆ ParaVirtualNICUnload()

static VOID NTAPI ParaVirtualNICUnload ( IN PDRIVER_OBJECT  pDriverObject)
static

Definition at line 43 of file ParaNdis5-Driver.c.

44{
45 DEBUG_ENTRY(0);
46 ParaNdis_DebugCleanup(pDriverObject);
47}
void ParaNdis_DebugCleanup(PDRIVER_OBJECT pDriverObject)

Referenced by DriverEntry().

◆ WaitHaltEvent()

static void WaitHaltEvent ( PARANDIS_ADAPTER pContext,
const char Reason 
)
static

Definition at line 291 of file ParaNdis5-Driver.c.

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}
#define __FUNCTION__
Definition: types.h:116

Referenced by ParaNdis5_Halt().

Variable Documentation

◆ DriverHandle

◆ gID

ULONG gID = 0
static

Definition at line 38 of file ParaNdis5-Driver.c.

Referenced by ParaNdis5_Initialize().