Compartilhar via


Update Bus-Specific Configuration Space in Your NDIS 6.0 Miniport Driver (Compact 2013)

3/26/2014

To read or write bus configuration space, your miniport driver calls the NdisMGetBusData or NdisMSetBusData function, respectively. These functions replace the NDIS 5.xNdisReadPciSlotInformation and NdisWritePciSlotInformation functions.

The following table shows which API elements have been renamed and/or changed for NDIS 6.0.

NDIS 5.x

NDIS 6.0

NdisReadPciSlotInformation

NdisMGetBusData

NdisWritePciSlotInformation

NdisMSetBusData

To update bus configuration space access functionality for NDIS 6.0

  1. Remove calls to NdisReadPciSlotInformation and NdisWritePciSlotInformation.

  2. Use NdisMGetBusData and NdisMSetBusData to read and write bus configuration space.

The following code example shows how to read the vendor identifier from PCI configuration space by using NdisMGetBusData.

Important

For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.

Status = NdisMGetBusData(
               pMyAdapter->MiniportAdapterHandle,
               PCI_WHICHSPACE_CONFIG,
               FIELD_OFFSET(PCI_COMMON_CONFIG, VendorID),
               &buffer,
               sizeof(buffer));

For more information about how to read and write bus configuration space with NDIS 6.0 functions, see NDIS Hardware Configuration Interface.

See Also

Concepts

Modify Adapter Initialization Functionality for NDIS 6.0