3.6 Shutdown Handler

All NIC drivers should register a shutdown handler during initialization. The definition of MiniportShutdown is:

VOID
MiniportShutdown(
IN PVOID ShutdownContext
);

A driver's shutdown handler should at least do the following:

·Insure that the hardware is not trying to copy any data to memory after returning from the shutdown handler. That is, if there is a DMA operation in progress, the operation should be terminated.

·Reset its hardware to its initial state.

The shutdown handler can be called as a result of a user operation, in which case it runs at IRQL PASSIVE_LEVEL. It can also be called as a result of an unrecoverable system error. If so, MiniportShutdown can be running at any IRQL. Only NdisXxx functions that can be called at any IRQL are safe to call from MiniportShutdown.