Freigeben über


Updating Bus-Specific Configuration Space Access for NDIS 6.0

To read or write to the bus configuration space, a miniport driver calls the NdisMGetBusData or NdisMSetBusData function, respectively. These functions replace the NdisReadPciSlotInformation and NdisWritePciSlotInformation functions.

The following code samples show how both NDIS 5.x miniport drivers and NDIS 6.0 miniport drivers read and write to the PCI configuration space.

NDIS 5.x Miniport Drivers

Reading

            ulResult = NdisReadPciSlotInformation(
                           Adapter->AdapterHandle,
                           0,
                           FIELD_OFFSET(PCI_COMMON_CONFIG, Command),
                           &usPciCommand,
                           sizeof(USHORT));

Writing

            ulResult = NdisWritePciSlotInformation(
                           Adapter->AdapterHandle,
                           0,
                           FIELD_OFFSET(PCI_COMMON_CONFIG, Command),
                           &usPciCommand,
                           sizeof(USHORT));

NDIS 6.0 Miniport Drivers

Reading

            ulResult = NdisMGetBusData(
                           Adapter->AdapterHandle,
                           PCI_WHICHSPACE_CONFIG,
                           FIELD_OFFSET(PCI_COMMON_CONFIG, Command),
                           &usPciCommand,
                           sizeof(USHORT) );

Writing

            ulResult = NdisMSetBusData(
                           Adapter->AdapterHandle,
                           PCI_WHICHSPACE_CONFIG,
                           FIELD_OFFSET(PCI_COMMON_CONFIG, Command),
                           &usPciCommand,
                           sizeof(USHORT) );