1.5 Network Interface Card Support
Windows NT currently supports the following types of network interface cards:
·Ethernet (802.3)
·Token Ring (802.5)
·FDDI
·LocalTalk
·ARCNET
·WAN (point-to-point and WAN cards)
·Wireless
When NDIS calls a miniport at its initialization function, it passes an array of NDIS-supported mediums. The NIC driver selects the medium that it supports; or, if the NIC driver can support more than one medium type, it selects the one that it prefers and returns its choice to NDIS. When a higher level NDIS protocol driver calls NdisOpenAdapter to bind to a specified NIC, it provides a list of medium types on which it can operate. NDIS uses the information from the NIC driver and from the upper layer driver to bind them appropriately. This binding provides the path by which packets are passed down the stack and sent out over the network and by which received packets are passed up the stack to higher level drivers.
The NDIS medium type defined for ARCNET is NdisMediumArcnet878_2. This medium type definition provides full compatibilitiy with Novell's ARCNET specification for Raw Arcnet.
Raw ARCNET is the format defined in the ARCNET Packet Header Definition Standard published by Novell, and is the one used by NetWare. A transport driver that supports this format is responsible for selecting from three different frame formats (short, long, or exception), given the length of the data it wishes to send. It is then responsible for performing all of the associated fragmenting, padding, setting the split flag and sequence number, and so forth, related to use of this standard.
The NdisMediumArcnet878_2 format allows a transport driver to be aware that it is running over ARCNET, without having to deal with the details of fragmenting and unfragmenting. With NdisMediumArcnet878_2, the on-the-wire format is the same as for Raw ARCNET. However, the transport driver is shielded from most of the details of the frame format. The NIC driver is responsible for fragmenting the frame, selecting the appropriate frame format, and inserting the padding, split flag, sequence number, and other related fields.
An ARCNET full NIC driver, in its MacOpenAdapter routine, first searches the MediumArray list for the medium type NdisMediumArcnet878_2. If found, it selects this medium type. If the transport driver does not list NdisMediumArcnet878_2, or if the NIC driver does not support it, the NIC driver then searches for NdisMedium802_3. If it finds this type, it selects it and must then perform 802.3 to ARCNET encapsulation on packets it sends, and corresponding de-encapsulation on packets it receives. The NDIS library handles this internally for miniports.
The Windows NT Tcpip and Nwlink transport drivers support NdisMediumArcnet878_2. The Windows NT Nbf (also known as NetBEUI) transport does not.
Currently, miniport NIC drivers for ATM media should implement LAN-emulation functions within themselves, and report their medium type as Ethernet 802.3 or 802.5. Native-mode ATM is not currently supported.
Types of NICs
NIC features determine the NDIS functions a driver for such a NIC uses to initialize its adapter and the functions it uses to send and receive packets. The ways in which each of these types of network adapter is programmed is described in this documentation. The two general categories of NICs are:
1.Busmaster DMA devices
These devices can directly access host memory, meaning the NIC has an on-board DMA controller that manages the sending and receiving of data from host memory to the network and from the network to host memory without using the CPU.
On a send, the miniport driver sets up the NIC to map the outgoing buffers and then causes the device to start its transfer to or from this memory. The NIC DMA controller transfers the data from shared system memory onto the network and interrupts the CPU when the send is complete. On a receive, the DMA controller transfers incoming data to host memory before notifying the host with an interrupt.
Such a device typically has a ring buffer for which the NIC's miniport allocates a set of buffers and can be programmed to efficiently handle several packets. A miniport driver that manages a busmaster DMA NIC typically supports multipacket sends and receives since such a miniport's device can efficiently handle several packets and improve its I/O throughput over sending and receiving a single packet at a time.
2.Non-busmaster DMA devices
There are three general types of NIC in this category.
·A NIC that contains on-board shared memory
The miniport that manages such a device must map the adapter shared memory to host memory and then copy outgoing packets to this device memory or copy incoming frames from device memory to buffers supplied by upper layer protocol drivers or other NIC drivers. Such a device generally cannot improve its performance by supporting multipacket sends and receives.
·A slave DMA NIC
The miniport that manages such a device uses the system DMA controller to manage the transfer of packets to and from the network. The miniport that manages such a NIC sets up its device for sends and receives in a different manner than a busmaster DMA device. Transfer of the data is with the cooperation of the host CPU.
·A NIC that uses programmed I/O
The miniport that manages a PIO device uses NDIS functions to move outgoing frames byte-by-byte, word-by-word, or long-by-long to device registers and then causes the device to send the data. The driver for such a device does not benefit from NDIS support for multipacket sends and receives. Miniports for this type of NIC should implement single packet sends and receives, as described in Chapter 4.
In summary, whether the NIC supports busmaster DMA affects the following:
·Whether the miniport supports multipacket or single-packet sends and receives
·What kind of memory is used, whether the memory is shared or not shared, and how much is allocated at driver initialization
·The steps by which the miniport sends data
·The steps by which the miniport receives data
·Whether the miniport supports passing media-specific information