The
ndis wrapper is designed to allow binary Windows® NDIS miniport network drivers to be used with
NetBSD. The
ndis driver is provided in source code form (
sys/dev/if_ndis) and must be combined with the Windows® driver binary supplied with your network adapter. The
ndis driver uses the ndisapi kernel subsystem to relocate and link the Windows® binary so that it can be used in conjunction with native code. The ndisapi subsystem provides an interface between the NDIS API and the
NetBSD networking infrastructure. The Windows® driver is essentially fooled into thinking it is running on Windows®. Note that this means the
ndis driver is only useful on x86 machines.
To build a functional driver, the user must have a copy of the driver distribution media for his or her card. From this distribution, the user must extract two files: the
.SYS file containing the driver binary code, and its companion
.INF file, which contains the definitions for driver-specific registry keys and other installation data such as device identifiers. These two files are converted into a
ndis_driver_data.h file using the
ndiscvt(8) utility. The resulting file contains a binary image of the driver plus registry key data. The
ndis_driver_data.h is included in several files located in
sys/dev/if_ndis so it is needed to compile an NDIS kernel. When the
ndis driver is loaded, it will create
sysctl(3) nodes for each registry key extracted from the
.INF file.
The
ndis wrapper is designed to support mainly Ethernet and wireless network devices/drivers with PCI bus attachments. It can support many different media types and speeds.
One limitation however, is that there is no consistent way to learn if an Ethernet device is operating in full or half duplex mode. The NDIS API allows for a generic means for determining link state and speed, but not the duplex setting. There may be driver-specific registry keys to control the media setting which can be configured via the
sysctl(8) command.