This function maps a specified bus-relative range of physical addresses or registers onto a system-space virtual range of addresses.
Header file: | Ndis.h |
Windows CE versions: | 2.0 and later |
NDIS_STATUS NdisMMapIoSpace( OUT PVOID *VirtualAddress,
IN NDIS_HANDLE MiniportAdapterHandle,
IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, IN UINT Length );
NDIS_STATUS_SUCCESS indicates success. One of the following values indicates failure:
This function is called by drivers of NICs that have on-board memory or a bank of device registers appearing in the I/O space of the host. For example, the driver of an NIC that uses PI/O calls this function.
A successful call to this function claims hardware resources in the registry for the driver’s NIC. Consequently, only MiniportInitialize functions call this function.
This function sets the variable at VirtualAddress to NULL if it does not return NDIS_STATUS_SUCCESS.
MiniportInitialize gets the PhysicalAddress value either from the driver’s Parameters registry key or by calling a bus-type-specific NdisXXX configuration function. The specified physical address range must fall within the I/O space of the current platform. It is a programming error to call this function with a host physical memory address.
A miniport must call the reciprocal NdisMUnmapIoSpace function to release its claim on system resources if MiniportInitialize subsequently fails to initialize the NIC, if its NIC is removed from the machine, and/or when the driver is unloading.
A driver that calls this function runs at IRQL PASSIVE_LEVEL.
NdisMUnmapIoSpace, NdisOpenConfiguration, NdisReadPciSlotInformation