A.3.10 Resetting a Network Interface Card
When a transport driver needs to reset a network interface card, as Figure A.3.10 shows, it calls MacReset through NdisReset with network interface card information provided in the NDIS binding handle. MacReset instructs the NIC driver to issue a hardware reset to the network interface card. The driver also sets its own software state.
During the reset operation, the NIC driver calls ProtocolStatus (through NdisIndicateStatus) twice for each bound transport driver, including the original caller. The first call is at the beginning of the reset, and NdisIndicateStatus accordingly delivers the general status code NDIS_STATUS_RESET_START. When the NIC driver again calls the reset functions at the end of the reset operation, NdisIndicateStatus delivers the general status code NDIS_STATUS_RESET_END.
When the NIC driver no longer needs to indicate status changes, it calls ProtocolStatusComplete through NdisIndicateStatusComplete for each bound transport driver. ProtocolStatusComplete allows each transport driver to do postprocessing for the status operation.
MacReset completes synchronously with a success or error status code, or asynchronously with NDIS_STATUS_PENDING. If the function is asynchronous, the NIC driver later calls ProtocolResetComplete through NdisCompleteReset to request postprocessing.
Figure A.3.10 Resetting a network interface card