Поделиться через


Windows 98/Me Compatibility Notes (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NDIS-WDM miniport drivers built for Windows 98/Me platforms must indicate received packets, complete packet transmissions, indicate status, and complete requests in the context of NDIS-timer threads or NDIS-called functions. Typically, the NDIS-WDM miniport driver is notified about these operations through the driver's WDM lower interface. The NDIS-WDM miniport driver must queue such an operation, start another thread using an NDIS timer object with a time-out set to zero, and complete the operation in the new thread.

The following code snippet shows how to queue a packet that is received and then indicate this packet up the stack using an NDIS timer object:

// Code for queuing packet 
// Acquire spin lock to Adapter structure.
 // Queue NDIS_PACKET for the packet to the tail of the list of 
// pending receives.
if (Adapter->IndicatingReceives == FALSE) {
    Adapter->IndicatingReceives = TRUE;
  NdisSetTimer(&Adapter->IndicateTimer, 0); // Start timer thread.
}
// Release spin lock;


// Code for timer thread (&Adapter->IndicateTimer function) 
// Acquire spin lock to Adapter structure.
while (/* pending receive queue is not empty */) {
    // Dequeue NDIS_PACKET from pending receive queue.
    // Release spin lock.
     Status = NDIS_GET_PACKET_STATUS(pNdisPacket);
  NdisMIndicateReceivePacket(
        MiniportAdapterHandle,
        pNdisPacket,
        NumberOfPackets);
    if (Status == NDIS_STATUS_RESOURCES) {
         // Call own MiniportReturnPacket handler with the packet.
    }
    // Reacquire spin lock to Adapter structure.
}
Adapter->IndicatingReceives = FALSE;
// Release spin lock.

 

 

Send comments about this topic to Microsoft