NdisMRegisterIoPortRange (Windows CE 5.0)
This function 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.
NDIS_STATUS NdisMRegisterIoPortRange(PVOID* PortOffset,NDIS_HANDLEMiniportAdapterHandle,UINTInitialPort,UINTNumberOfPorts);
Parameters
- PortOffset
[out] Specifies a caller-supplied variable in which this function returns the mapped base virtual address for the specified bus-relative I/O port range specified by InitialPort and NumberOfPorts. - MiniportAdapterHandle
[in] Handle input to the MiniportInitialize function. - InitialPort
[in] Specifies the bus-relative base port address for a range of ports to be mapped. - NumberOfPorts
[in] Specifies the number of ports in the range to be mapped.
Return Values
The following table shows the return values for this function.
Value | Description |
---|---|
NDIS_STATUS_SUCCESS | The specified range of I/O ports was mapped successfully; the value at PortOffset is valid, and the mapped range has been claimed in the registry for the NIC. |
NDIS_STATUS_RESOURCE_CONFLICT | An attempt to claim the I/O port range in the registry has failed, possibly because another driver already claimed the range for its device. This function logs an error if this occurs. |
NDIS_STATUS_RESOURCES | The port range could not be mapped, or NDIS could not allocate resources to check the registry for hardware-resource conflicts. |
NDIS_STATUS_FAILURE | Either the bus type or bus number is out of range, or the specified InitialPort and NumberOfPorts were invalid, possibly not within the I/O port space of the current platform. |
Remarks
An NIC driver calls this function from its MiniportInitialize function. MiniportInitialize must call NdisMSetAttributes or NdisMSetAttributesEx before calling this function.
This function 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.
If its call to this function fails, MiniportInitialize releases all resources that it has already allocated for its NIC, and then fails 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.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.dll.
See Also
MiniportInitialize | NdisMMapIoSpace | NdisMSetAttributes | NdisMSetAttributesEx | NdisMDeregisterIoPortRange | NdisRawReadPortBufferUchar | NdisRawReadPortBufferUlong | NdisRawReadPortBufferUshort | NdisRawReadPortUchar | NdisRawReadPortUlong | NdisRawReadPortUshort | NdisRawWritePortUchar | NdisRawWritePortUlong | NdisRawWritePortUshort
Send Feedback on this topic to the authors