NdisReadMcaPosInformation

VOID
NdisReadMcaPosInformation(

OUT PNDIS_STATUS Status,
IN NDIS_HANDLE WrapperConfigurationContext,
IN PUINT ChannelNumber,
OUT PNDIS_MCA_POS_DATA McaData
);

NdisReadMcaPosInformation returns bus-relative configuration information for a NIC on an MCA bus.

Parameters

Status

Points to a caller-supplied variable in which this function returns the status of the call as one of the following:

NDIS_STATUS_SUCCESS

The NIC driver can examine the buffered configuration data to determine whether a NIC that it supports has been found and, if so, can use the bus-relative configuration values as parameters to certain NdisXxx initialization functions.

NDIS_STATUS_ADAPTER_NOT_FOUND

A NIC could not be found on an MCA bus in the machine.

NDIS_STATUS_RESOURCES

NDIS could not allocate a buffer to contain the requested MCA configuration information or could not allocate the resources it needs to collect the configuration information.

NDIS_STATUS_FAILURE

This is a default status, returned if the caller supplied an invalid parameter or if POS information is unavailable. For example, if the caller sets the AdapterType to something other than NdisInterfaceMca when the miniport calls NdisMSetAttributes, NdisReadMcaPosInformation returns this status.

WrapperConfigurationContext

Specifies the handle input to MiniportInitialize.

ChannelNumber

Points to a caller-supplied variable in which this function returns the channel number of a NIC on the bus.

McaData

Points to a caller-supplied buffer in which this function returns the requested information, formatted as an NDIS_MCA_POS_DATA structure, if the call is successful.

Comments

NdisReadMcaPosInformation reads data from the POS register of an MCA NIC. The function copies this information into a buffer that the NIC driver provides.

The NDIS_MCA_POS_DATA structure is defined as follows:

typedef struct _NDIS_MCA_POS_DATA {

USHORT AdapterId; //NIC's ID

UCHAR PosData1; // First byte of POS data

UCHAR PosData2;

UCHAR PosData3;

UCHAR PosData4;

} NDIS_MCA_POS_DATA, *PNDIS_MCA_POS_DATA;

A NIC driver can use the returned AdapterId value to determine whether the NIC is its own. If so, the driver can call NdisMRegisterInterrupt to register its MiniportISR function. The driver also might use the returned value at ChannelNumber, for example, in a subsequent call to NdisMRegisterDmaChannel if its NIC is a slave DMA device.

The caller is responsible for freeing the buffer it allocated at McaData with NdisFreeMemory.

Callers of NdisReadMcaPosInformation run at IRQL PASSIVE_LEVEL.

See Also

MiniportInitialize, MiniportISR, NdisFreeMemory, NdisMRegisterDmaChannel, NdisMRegisterInterrupt, NdisMSetAttributes, NdisMSetAttributesEx