![]() |
Windows NT: PCI InitializationJan 29, 1997 This information is provided "as is", there is no support or guarantee from this WEB site! |
|
| Subject:
PCI initialization In addition to the "regular" things a device driver must do (like create a device object, etc.), here are the "extra" things a driver must do for a PCI device: 1. Find your device with HalGetBusData or HalGetBusDataByOffset. Locate your adapter by scanning the slots looking for your VendorId and DeviceId. 2. Call HalAssignSlotResources to claim the device resources. This will insure that there are no conflicts with the resources specified in the configuration space. Note that the HAL may move your resources, so don't use the values directly from the configuration space (i.e., in PCI_COMMON_CONFIG from HalGetBusData). Instead, used the values returned in the resource list (AllocatedResources in the HalAssignSlotResources call) after mapping them as indicated below: a. Parse the resource list for your resources. The only resources available are those returned in this resource list. This information comes directly from the PCI device's configuration space. b. If the device uses memory ranges, call HalTranslateBusAddress and MmMapIoSpace if required. c. If the device uses I/O ports, call HalTranslateBusAddress and MmMapIoSpace if required. d. If the device supports interrupts, call HalGetInterruptVector and IoConnectInterrupt. |