5.2.3 Adapters, Bindings, and Links
WAN miniports can set up and manage many links per binding and thus many links per NIC.
Like other miniports, every WAN miniport must have at least one NIC for which it allocates and maintains a NIC-specific context area. The NIC-specific context area is simply a way to store, retrieve, and use information about the hardware specifics of the NIC, such as interrupt, bus type, I/O range, and memory windows, as well as to maintain runtime state. A miniport NIC driver should specify one NIC-specific context area for each adapter in the system that it supports.
From a WAN miniport’s point-of-view, there is only one binding per adapter even if several protocols above the driver are bound to a particular adapter. Because WAN miniports are ignorant of such protocols (this work is handled by NDISWAN), the WAN miniports do not maintain bindings for their NICs. In effect, NDISWAN binds to one or more WAN NIC driver(s) and one or more protocol driver(s) bind to NDISWAN.
Links are logical, point-to-point bidirectional communication channels. There can be many links per adapter. Links are dynamically brought up and torn down. The link speed and quality of the link can be different for each connection. However, it is assumed that the padding and link capabilities are universal for all links on an adapter. If a WAN NIC driver specifies a 20-byte header padding and 4-byte tail padding, they must remain constant for all links on that adapter. If a WAN NIC driver specifies that it does not want PPP Address and Control field compression, it is assumed true for all links on that adapter. If a WAN driver specifies that it can do the older RAS framing, it is assumed true for all links on that NIC.
Protocols bind once to NDISWAN and do not bind to the WAN miniport NIC drivers. This saves memory and simplifies the WAN miniport driver. Because there will typically be several protocols in a given system and there could be more than one WAN miniport NIC driver, the reduction in the number of bindings save memory (that is, each protocol doesn't have to bind to each WAN miniport adapter). In the preceding figure, if each protocol bound to each WAN miniport NIC driver, there would be nine bindings. Also, since protocols can rely on only having a single WAN binding, this can simplify some protocols.
A WAN driver must be an NDIS miniport NIC driver. Full NIC drivers are not supported for WAN adapters. This and the previous chapters on miniport NIC drivers provide the design information a driver developer needs to write a WAN miniport NIC driver.
Miniport NIC drivers must add the following line to their sources file before building to identify the driver as a miniport.
C_DEFINES=/DNDIS_MINIPORT_DRIVER
For WAN drivers, the include paths should include ndiswan.h as well as ndis.h.
If the NDIS miniport NIC driver supports connections through TAPI, the driver should also include ndistapi.h.