Storport miniport - reading VPD/PCI config space

Hi all,

I’m using Windows Server 2008 SP2 x86 for my development and testing.
My requirement is to read/write my HBA’s (PCI/PCIe card) VPD & other PCI
config space during run-time. The Storport API for doing this is
StorportGetBusData/StorportSetBusDataByOffset - but the restriction is I can
use this API only in HwStorFindAdapter (& in HwStorAdapterControl -
SetRunningConfig).

Is there a way to memory map PCI config space in storport miniport driver?
so that I can do PCI config-space read/write during runtime!

Also I’ve a couple of observations,

  1. The StorportGetBusdata (pci config read) is working properly in both
    HwStorFindAdapter and in HwStorInitialize (which is not documented).
  2. StorportSetBusDataByOffset (PCI config write) at HwStorFindAdapter is not
    working! The same code in different WDM driver using
    BusInterface->SetBusData works properly! Has anybody tried this?
    Has anybody successful in retrieving VPD using SCSI/Storport APIs? Kindly
    shed some light in this area.

Thanks & Regards,
Gokul T V

Hi all,

Here are the updates from my side,

  • The issue of writing data in PCI config space is the bug in my code - the StorportSetBusDataByOffset API works fine.
  • At the same time, the StorportSetBusDataByOffset (& StorportGetBusData) works well at HwStorInitialize routine too - whereas the document says it will work only at HwStorFindAdapter!

In the debugger I’m seeing the call stack as,

pci!PciBusInterface_SetBusData
storport!RaSetBusData+0x1a
storport!StorPortSetBusDataByOffset+0x24

I assume PciBusInterface_SetBusData is same as BUS_INTERFACE_STANDARD->SetBusData - and the document of BusSetDeviceData (http://msdn.microsoft.com/en-us/library/ff540695(VS.85).aspx) do-not mention any context limitation for using this API.

Is my understanding right? If yes, is this one another storport documentation bug?

Thanks,
Gokul T V