NdisMapIoSpace

VOID
    NdisMapIoSpace(
        OUT PNDIS_STATUS Status,
        OUT PVOID *VirtualAddress,
        IN NDIS_HANDLE NdisAdapterHandle,
        IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
        IN UINT Length
        );

NdisMapIoSpace maps a physical I/O address into a virtual address for a network interface card that has memory with a physical address in the host I/O space.

Parameters

Status
Points to a caller-supplied variable in which this function returns the status of the mapping operation. Possible values are:

NDIS_STATUS_FAILURE
NDIS_STATUS_RESOURCE_CONFLICT
NDIS_STATUS_SUCCESS

Virtual Address
Points to the caller-supplied variable in which this function returns the mapped virtual base address. If the operating system cannot map the I/O space requested, this function returns NULL.
NdisAdapterHandle
Identifies the handle that the NDIS interface library associates with the network interface card.
PhysicalAddress
Indicates the physical address.
Length
Specifies the size in bytes of the device memory range, starting at the given physical address.

Comments

A NIC driver calls NdisMapIoSpace only during initialization from its DriverEntry or MacAddAdapter function. The NIC driver can then access its NIC’s device memory using the returned virtual address.

When a driver no longer needs the mapping, it calls NdisUnmapIoSpace, usually from its MacUnload or MacShutdown function.
A NIC driver cannot use this function to create a virtual mapping to something other than the device memory for its NIC.

Callers of NdisMapIoSpace run at IRQL PASSIVE_LEVEL.

See Also

MacAddAdapter, MacShutdown, MacUnload, NdisUnmapIoSpace