NDIS_STATUS
NdisMRegisterIoPortRange(
OUT PVOID *PortOffset,
IN NDIS_HANDLE MiniportAdapterHandle,
IN UINT InitialPort,
IN UINT NumberOfPorts
);
NdisMRegisterIoPortRange sets up driver access to device I/O ports with the NdisRawReadPortXxx and NdisRawWritePortXxx functions and claims the range of I/O port addresses in the registry for that driver’s NIC.
NdisMRegisterIoPortRange can return one of the following:
A NIC driver calls NdisMRegisterIoPortRange from its MiniportInitialize function. MiniportInitialize must call NdisMSetAttributes or NdisMSetAttributesEx before calling NdisMRegisterIoPortRange.
NdisMRegisterIoPortRange maps a bus-relative device address range that the miniport can use subsequently to access an I/O port range on its NIC by calling the NdisRawXxx functions. A successful call claims the specified range of I/O ports in the registry for the caller’s NIC.
Because the parameters passed to the NdisRawXxx have been mapped, these functions run significantly faster than the corresponding NdisImmediate..PortXxx. After a successful call to NdisMRegisterIoPortRange, a miniport cannot call any of the NdisImmediate..PortXxx functions with either bus-relative addresses or mapped virtual addresses within such an I/O port range.
If its call to NdisMRegisterIoPortRange fails, MiniportInitialize should release all resources it already allocated for its NIC and, then, fail initialization for that NIC.
Drivers of NICs with device registers in the host memory space call NdisMMapIoSpace and, subsequently, the NdisRead/WriteRegisterXxx functions to access the NIC registers.
Callers of NdisMRegisterIoPortRange run at IRQL PASSIVE_LEVEL.
MiniportInitialize, NdisMDeregisterIoPortRange, NdisMMapIoSpace, NdisRawReadPortBufferUchar, NdisRawReadPortBufferUlong, NdisRawReadPortBufferUshort, NdisRawReadPortUchar, NdisRawReadPortUlong, NdisRawReadPortUshort, NdisRawWritePortBufferUchar, NdisRawWritePortBufferUlong, NdisRawWritePortBufferUshort, NdisRawWritePortUchar, NdisRawWritePortUlong, NdisRawWritePortUshort, NdisReadRegisterUchar, NdisReadRegisterUlong, NdisReadRegisterUshort, NdisWriteRegisterUchar, NdisWriteRegisterUlong, NdisWriteRegisterUshort