A.2.1 Full NIC Driver Upper-Edge Functions

The full NIC driver must provide the minimum upper-edge functions defined in Table A.2.1. A bound transport driver makes all calls to these functions indirectly, through the NDIS interface library.

The full NIC driver can optionally make use of the NDIS interface filter libraries (Ethernet, Token Ring, and FDDI) to manage multiple transport driver bindings to a network interface card. If the full NIC driver uses a filter library, it must supply the action functions listed in Table A.2.2.

Some of the full NIC driver functions use synchronous processing, while others use asynchronous processing. NDIS 3.0 implements synchronous functions without a wait for an external event. Asynchronous function completion occurs when the NIC driver calls an NDIS interface library completion function, which in turn calls a transport driver completion function for postprocessing.

Names of the full NIC driver functions mentioned in these discussions use Mac as a generic prefix. For all functions written for an actual NIC driver, you may provide your own names, or you can simply substitute the name of the specific driver for Mac. For details of the functions and types mentioned in these sections, see Chapter 1 in the Network Driver Reference.

Table A.2.1 Full NIC Driver Upper-Edge Functions

Function Definition Async Option
DriverEntry Called by the operating system to activate and initialize the NIC driver. Not Appli-cable
MacAddAdapter Called by the NDIS interface library to add support for a network card. No
MacCloseAdapter Called by a transport driver to close an open binding. Yes
MacDeferredProcessingRoutine Called by the operating system to complete interrupt processing that MacInterruptServiceRoutine does not perform. This function is the DPR for the NIC driver. No
MacInterruptServiceRoutine Called by the operating system as an ISR that invokes processing associated with a network card interrupt. No
MacOpenAdapter Called by a transport driver to open a binding between itself and a network card. Yes
MacQueryGlobalStatistics Called by the operating system to query current NIC driver statistics about a logical adapter. Yes
MacRemoveAdapter Called by the operating system to remove a registered network card. No
MacRequest Called by a transport driver to query or set NIC driver information. Yes
MacReset Called by a transport driver to issue a hardware reset to a network card. Yes
MacSend Called by a transport driver to instruct the NIC driver to transmit a packet through a network interface card onto the network. Yes
MacSynchronizeFunction Called by a NIC driver function to synchronize access to shared data by the ISR and non-ISR network card functions. No
MacTimerFunction Called by the operating system for time-delayed processing after the timer expires. No
MacTransferData Called by a transport driver to copy the data from a received packet. Yes
MacUnload Called by the operating system to instruct the NIC driver to unload itself. No
MacChangeEthAddresses Called by the Ethernet filter library to initiate processing if the multicast address list for a network card changes. Yes
MacChangeFddiAddresses Called by the FDDI filter library to initiate processing if the multicast address list for a network card changes. Yes
MacChangeFilter Called by the Ethernet, Token Ring, or FDDI filter library to initiate processing when a binding sets or clears a filter class. Yes
MacChangeGroup Called by the Token Ring filter library to initiate processing if the group address for all bindings changes. Yes
MacChangeTrAddress Called by the Token Ring filter library to initiate processing if the functional address for a network card changes. Yes
MacCloseAction Called by the Ethernet, Token Ring, or FDDI filter library to complete processing when a binding closes while the NIC driver is indicating a received packet to a bound transport driver. No