Previous Next

NdisReadPcmciaAttributeMemory

NdisReadPcmciaAttributeMemory reads bus-relative configuration parameters for a PC Card NIC from attribute memory.

ULONG
  NdisReadPcmciaAttributeMemory(
    IN NDIS_HANDLE  NdisAdapterHandle,
    IN ULONG  Offset,
    IN PVOID  Buffer,
    IN ULONG  Length
    );

Parameters

NdisAdapterHandle
Specifies the handle that NDIS passed as an input parameter to MiniportInitialize.
Offset
Specifies the byte offset from the beginning of attribute memory, excluding odd-numbered bytes, at which to begin reading.
Buffer
Pointer to a caller-allocated buffer into which this function copies the specified number of bytes from PC Card attribute memory.
Length
Specifies the number of even-numbered bytes to read from attribute memory, beginning at Offset.

Return Value

NdisReadPcmciaAttributeMemory returns how many bytes it read from attribute memory. A return value of zero indicates that the read operation failed.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

The driver of a PC Card NIC calls NdisReadPcmciaAttributeMemory to read bus-relative configuration parameters for its NIC from PC Card attribute memory. Such a miniport driver usually calls NdisReadPcmciaAttributeMemory from its MiniportInitialize function. A miniport driver can call NdisReadPcmciaAttributeMemory more than once to read nonoverlapping sections of attribute memory.

Drivers of PC Card NICs should use NdisReadPcmciaAttributeMemory to maintain binary compatibility across Microsoft operating systems that support Win32. Drivers should never attempt to read attribute memory directly from the bus.

PC Card attribute memory contains significant information only in even-numbered bytes. NdisReadPcmciaAttributeMemory therefore treats attribute memory as if it were compacted, with all odd (meaningless) bytes removed. The Offset and Length parameters refer to compacted memory (memory consisting only of even-numbered bytes). For example, to read a 6-byte Ethernet address from attribute memory at an actual offset of 0xFF0, the caller of NdisWritePcmciaAttributeMemory would specify an Offset of 0x7F8 (0xFF0/2) and a Length of 6.

Callers of NdisWritePcmciaAttributeMemory run at IRQL <= DISPATCH.

See Also

MiniportInitialize, NdisWritePcmciaAttributeMemory