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.
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" <Ma...@discussions.microsoft.com> wrote in message
news:78C8F156-20CA-4EF5...@microsoft.com...
"Maxim" <Ma...@discussions.microsoft.com> wrote in message
news:78C8F156-20CA-4EF5...@microsoft.com...
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/doxygen/d7/d7c/hal_2halx86_2generic_2pci_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.
On Jun 18, 1:10 pm, DaveH <Da...@discussions.microsoft.com> wrote:
> 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
> (checkhttp://www.reactos.org/generated/doxygen/d7/d7c/hal_2halx86_2generic_...to know how).
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"luchnikov" <maxim....@gmail.com> wrote in message
news:949661a4-763b-4cb4...@m45g2000hsb.googlegroups.com...
Anyway, looks like w/o a filter driver I am SOL. See my other post -
I tried getting PCI config data in STORPORT miniport driver via
StorPortGetBusData, without much luck.
Too bad there isn't some IOCTL you can send to the PCI bus driver to
get this data in Win2K3
System writes address reg
User writes address reg
Systems reads "data"
User reads "data"
Of course the system is not reading what it expects!
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"luchnikov" <maxim....@gmail.com> wrote in message
news:2f157957-f155-4885...@m36g2000hse.googlegroups.com...