Hi,
In my driver, I want to get information about the Pci bus that my device is conntecting to. For example is the bus type PCI or PCIe, PCIe gen1 or PCIe gen 2, PCIe x4 or x8 …
How can I get these information ? Which driver APIs should I use ?
Thanks,
There are no API’s for this stuff, why should you care?
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
“xxxxx@gage-applied.com” wrote in message
news:xxxxx@ntdev:
> Hi,
>
> In my driver, I want to get information about the Pci bus that my device is conntecting to. For example is the bus type PCI or PCIe, PCIe gen1 or PCIe gen 2, PCIe x4 or x8 …
> How can I get these information ? Which driver APIs should I use ?
>
> Thanks,
Just for diagnostic purpose.
If I can have these information, I can show it and tell the customer “Sir,
you can not have such a high transfer rate because your PCIe is Gen 1 !”
So there is no API for this, even in user mode ?
Thanks
“Don Burn” wrote in message news:xxxxx@ntdev…
> There are no API’s for this stuff, why should you care?
>
>
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> “xxxxx@gage-applied.com” wrote in message
> news:xxxxx@ntdev:
>
>> Hi,
>>
>> In my driver, I want to get information about the Pci bus that my device
>> is conntecting to. For example is the bus type PCI or PCIe, PCIe gen1 or
>> PCIe gen 2, PCIe x4 or x8 …
>> How can I get these information ? Which driver APIs should I use ?
>>
>> Thanks,
>
>
On Thu, 26 May 2011 16:35:42 -0400
“Quang Vu” wrote:
> Just for diagnostic purpose.
> If I can have these information, I can show it and tell the customer
> “Sir, you can not have such a high transfer rate because your PCIe is
> Gen 1 !” So there is no API for this, even in user mode ?
This information can certainly be obtained, possibly via DMI, but the
format of the data is stored may be system-specific. For example, PC
Wizard (http://www.cpuid.com/softwares/pc-wizard.html) tells me that my
graphics card is in a PCIe v2.0 slot (port 0) which is x16 and has
2.5GB/s max bandwidth.
–
Bruce Cran
On 26/05/2011 20:23, xxxxx@gage-applied.com wrote:
In my driver, I want to get information about the Pci bus that my device is conntecting to. For example is the bus type PCI or PCIe, PCIe gen1 or PCIe gen 2, PCIe x4 or x8 …
How can I get these information ? Which driver APIs should I use ?
If you happen to be a network device, on Windows Vista and later, look
at NDIS OID_GEN_PCI_DEVICE_CUSTOM_PROPERTIES. Otherwise there are no
simple kernel mode APIs for this. You can read your own device’s PCI
configuration space and discover this information from there. See
“Accessing PCI Device Configuration Space” on MSDN:
http://msdn.microsoft.com/en-us/library/ff536890(v=vs.85).aspx
The WDK has structures to help a little with PCI configuration sapce
parsing. For link speed and width, you’ll need to walk your device’s
capability list looking for a capability with ID ==
PCI_CAPABILITY_ID_PCI_EXPRESS which maps to the PCI_EXPRESS_CAPABILITY
structure. See LinkStatus.bits.LinkSpeed and
LinkStatus.bits.LinkWidth. Use the PCI specification to decode these
register values.
For Windows Vista and later, from user mode, “Device Instance
Properties” look like they could provide what you want. See the
pciprop.h header file in the WDK and :
http://msdn.microsoft.com/en-us/library/ff541334(v=VS.85).aspx
Best regards,
Andrew
–
Andrew Lee Solarflare Communications
mailto:xxxxx@solarflare.com http://www.solarflare.com/