TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

Notices

accessing PCI configuration space

Microsoft Device Drivers


Reply
 
Thread Tools Display Modes
Old 17-06-2008, 08:57 PM   #1
Maxim
Guest
 
Posts: n/a
accessing PCI configuration space

Is there a way to access PCI(E) config space from user mode in Windows 2003+?
I.e., an equivalent of lspci command? Alternatively, does that information
get cached
somewhere (e.g. in the registry) by the OS?

I know a driver can read that information out, but the idea is to get access
to the
information without having to load a driver for a device.

The basic problem I am trying to solve is to determine the width of PCIE link
in the slot that my device is plugged into. The only information I can find
in the registry
is vendor/product PCI IDs and a few other things, but nothing close to a
full dump of
PCI config space.
  Reply With Quote
Old 17-06-2008, 09:55 PM   #2
Maxim
Guest
 
Posts: n/a
RE: accessing PCI configuration space

Btw, I'll also take an answer in a form of an existing freeware application
that does not install a driver
  Reply With Quote
Old 18-06-2008, 04:57 AM   #3
Doron Holan [MSFT]
Guest
 
Posts: n/a
Re: accessing PCI configuration space

starting in vista (and subsequent OS's) the current link speed is exposed
through a DEVPKEY (DEVPKEY_PciDevice_CurrentLinkSpeed in pciprop.h). before
that, you need to figure this out for yourself...


d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Maxim" <Maxim@discussions.microsoft.com> wrote in message
news:78C8F156-20CA-4EF5-9C1A-C8D5A98B8559@microsoft.com...
> Btw, I'll also take an answer in a form of an existing freeware
> application
> that does not install a driver


  Reply With Quote
Old 18-06-2008, 05:54 AM   #4
Calvin Guan
Guest
 
Posts: n/a
Re: accessing PCI configuration space

!pcitree
You don't need a driver, it's free. does that count?

"Maxim" <Maxim@discussions.microsoft.com> wrote in message
news:78C8F156-20CA-4EF5-9C1A-C8D5A98B8559@microsoft.com...
> Btw, I'll also take an answer in a form of an existing freeware
> application
> that does not install a driver



  Reply With Quote
Old 18-06-2008, 09:55 AM   #5
Maxim
Guest
 
Posts: n/a
Re: accessing PCI configuration space

bummer. oh well, thanks anyhow

"Doron Holan [MSFT]" wrote:

> starting in vista (and subsequent OS's) the current link speed is exposed
> through a DEVPKEY (DEVPKEY_PciDevice_CurrentLinkSpeed in pciprop.h). before
> that, you need to figure this out for yourself...


  Reply With Quote
Old 18-06-2008, 07:59 PM   #6
Maxim
Guest
 
Posts: n/a
Re: accessing PCI configuration space

i don't think it does, because it does not provide a dump of PCIE config
space - only prints a few fields that are visible by other means (registry,
device property details, devcon find pci\*, etc). same goes for !devext xxx
PCI

"Calvin Guan" wrote:

> !pcitree
> You don't need a driver, it's free. does that count?
>
> "Maxim" <Maxim@discussions.microsoft.com> wrote in message
> news:78C8F156-20CA-4EF5-9C1A-C8D5A98B8559@microsoft.com...
> > Btw, I'll also take an answer in a form of an existing freeware
> > application
> > that does not install a driver

>
>
>

  Reply With Quote
Old 18-06-2008, 10:58 PM   #7
DaveH
Guest
 
Posts: n/a
Re: accessing PCI configuration space

Maxim, I'm not sure what Doron has suggested is what you're after as the link
speed (as defined by PCI Express spec) currently can only ever be 2.5Gb/s no
matter what the width of the link is.

If you really want to figure out the link width from user mode, you have to
query the Link Status Register (offset 12h of PCI Express Capability
Structure in PCI Config Space) which tells you the negotiated width of the
link (1x, 2x, etc.). To access PCI Config Space you have to use PCI host
bridge I/O ports namely CF8h and CFCh in a way described in PCI spec. In
kernel mode, you can use the deprecated HalGetBusDataByOffset (recommended
method is to create and send an IRP to PCI driver). In user mode, you could
use _inpd, _outpd on above ports in a similar way to HalGetBusDataByOffset
(check
http://www.reactos.org/generated/dox...pci_8c.html#a4 to know how).

That said, I don't think this would be a good approach as accesses to above
registers are not atomic and you might end up with some nasty side effects.

DaveH.


"Doron Holan [MSFT]" wrote:

> starting in vista (and subsequent OS's) the current link speed is exposed
> through a DEVPKEY (DEVPKEY_PciDevice_CurrentLinkSpeed in pciprop.h). before
> that, you need to figure this out for yourself...
>
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Maxim" <Maxim@discussions.microsoft.com> wrote in message
> news:78C8F156-20CA-4EF5-9C1A-C8D5A98B8559@microsoft.com...
> > Btw, I'll also take an answer in a form of an existing freeware
> > application
> > that does not install a driver

>
>

  Reply With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 03:55 AM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional