Microsoft Windows CE 3.0  

NdisMMapIoSpace

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function maps a specified bus-relative range of physical addresses or registers onto a system-space virtual range of addresses.

NDIS_STATUS NdisMMapIoSpace(
OUT PVOID *
VirtualAddress
,
IN NDIS_HANDLE
MiniportAdapterHandle
,
IN NDIS_PHYSICAL_ADDRESS
PhysicalAddress
,
IN UINT
Length
);

Parameters

VirtualAddress
Pointer to a caller-supplied variable that is set to the converted virtual address if the call is successful.
MiniportAdapterHandle
Handle input to the MiniportInitializefunction.
PhysicalAddress
Specifies the bus-relative base physical address of the device memory range to be mapped.
Length
Specifies the number of bytes to be mapped.

Return Values

NDIS_STATUS_SUCCESS indicates success. One of the following values indicates failure:

NDIS_STATUS_RESOURCE_CONFLICT
An attempt to claim the device memory range in the registry has failed, possibly because another driver has already claimed the range for its device. This function logs an error if this occurs.
NDIS_STATUS_RESOURCES
The memory could not be mapped or sufficient virtual memory could not be allocated.
NDIS_STATUS_FAILURE
Either the bus type or bus number is out of range, or the specified PhysicalAddressand Lengthare invalid, possibly not within the I/O space of the current platform.

Remarks

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 MiniportInitializefunctions call this function.

This function sets the variable at VirtualAddressto NULL if it does not return NDIS_STATUS_SUCCESS.

MiniportInitializegets the PhysicalAddressvalue either from the driver's Parametersregistry key or by calling a bus-type-specific Ndis XXXconfiguration 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 NdisMUnmapIoSpacefunction to release its claim on system resources if MiniportInitializesubsequently 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.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisMUnmapIoSpace, NdisOpenConfiguration, NdisReadPciSlotInformation



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.