1.9  Status Indications in an Intermediate Driver

An intermediate driver is required to supply a ProtocolStatus function and a ProtocolStatusComplete function. NDIS calls ProtocolStatus when an underlying NIC driver calls NdisMIndicateStatus to report a change in its hardware status. ProtocolStatus is called when the status change begins. If the action indicated by the status message is not complete when ProtocolStatus is called, NdisMIndicateStatusComplete is subsequently called by the underlying NIC driver. When this occurs, ProtocolStatusComplete is called to carry out any postprocessing for the status change. Examples of GeneralStatus reported to ProtocolStatus include:

·NDIS_STATUS_CLOSING. This status and the actions of ProtocolStatus is discussed in Section 1.7.

·NDIS_STATUS_RESET_START and NDIS_STATUS_RESET_END. Both these are reported to both ProtocolStatus and ProtocolStatusComplete as explained in Section 1.8.

·NDIS_STATUS_LINE_UP, if the intermediate driver is layered over a WAN-capable NIC driver that has established a connection with a remote node. See Part 2, Chapter 5 and Chapter 6, for more information on WAN drivers.

·NDIS_STATUS_RING_STATUS, for which StatusBuffer provides more detailed information, for instance on problems specific to a Token Ring medium.

When an intermediate driver receives a status indication, it indicates it up to the higher level driver(s) by calling NdisIndicateStatus only if the status indication causes the intermediate driver to change its internal state in a way that affects the operation of its MiniportXxx functions. That is, if the status indicated to the intermediate driver causes the driver to fail sends or requests, it can pass the status indication to the higher level driver(s) which presumably will then hold off on submitting sends and requests. If, however, the intermediate driver continues to accept sends and requests, perhaps queuing them internally, it need not pass the status indication up.