Physical Slot Number of PCIe card

Hi,
?
I am trying to get actual physical slot number from storport miniport driver by reading the pciexp_slot_capabilities_register but it is returning 0s. I am not sure how Device Manager read the PCI slot Number. Can someone provide a pointer on what I am missing? I tried reading SystemBusIONUmber from port configuration structure but that seems like a virtual slot number.
?
Any help is appreciated.
?
Thanks,
Gurpreet

Why in the world do you want this? The slot number does not correspond
to anything you can use, for instance Dell has changed the physical slot
ordering in the same model (I’ve worked for firms that in the same order
got multiple machines with differing mappings of slot numbers to
physical slots).

Don Burn (MVP, Windows DKD)

Windows Filesystem and Driver Consulting

Website: http://www.windrvr.com

Blog: http://msmvps.com/blogs/WinDrvr

From: Gurpreet Anand [mailto:xxxxx@yahoo.com]
Posted At: Thursday, July 29, 2010 1:37 PM
Posted To: ntdev
Conversation: Physical Slot Number of PCIe card
Subject: Physical Slot Number of PCIe card

Hi,

I am trying to get actual physical slot number from storport miniport
driver by reading the pciexp_slot_capabilities_register but it is
returning 0s. I am not sure how Device Manager read the PCI slot Number.
Can someone provide a pointer on what I am missing? I tried reading
SystemBusIONUmber from port configuration structure but that seems like
a virtual slot number.

Any help is appreciated.

Thanks,

Gurpreet

__________ Information from ESET Smart Security, version of virus
signature database 5324 (20100729) __________

The message was checked by ESET Smart Security.

http://www.eset.com

I had a similar issue in the past. I had 2 identical wireless NICs in a system and I needed to know which was which (because one was attached to external antennas and the other wasn’t).

I thought that bus number and slot number would work, but those numbers seem to be incremented as buses and devices are discovered rather than some hardware based number. If the customer turned devices on or off in the BIOS, those numbers changed.

I wound up using the Device information for the parent device, ie the PCIe root complex device to determine which was which.

Let me know if this would make sense for you and I’ll post some sample code.

Clay

Gurpreet wrote:
I am trying to get actual physical slot number from storport miniport driver by reading the pciexp_slot_capabilities_register but it is returning 0s. I am not sure how Device Manager read the PCI slot Number. Can someone provide a pointer on what I am missing? I tried reading SystemBusIONUmber from port configuration structure but that seems like a virtual slot number. ? Any help is appreciated.

Not possible; the PCIe bridges in the middle, the changes in vendor MB layout, the existence of extender boards (like from Magma) make this not possible – almost like determining the DRAM stick based on the PA provided.

A better solution can be found from “what are you trying to do” … if you’re trying to track a particular card in a machine then having a serial number or similar in an EEPROM on the card that you can read is good (plus that allows you to have a debounce mechanism if you can write to the EEPROM, see an earlier post by me for that). If you’re trying to identify a particular card for an end user (say for hot swapping or replacement) then putting an LED on the board that can be toggled on or off from the driver works nicely, even better controlled from a button in a property page …

Don,
?
Device Manager in Windows is definitely reading it correctly and I dont know how? I want to understand how to display the same information in our GUIs. Customer will like to know which controller is in which slot from GUIs.
Host drivers are reading it from systemBUSIOnumber which seems like a logical slot number and is not matching with that Device Manager is reporting.
?
Thanks,
Gurpreet

— On Thu, 7/29/10, Don Burn wrote:

From: Don Burn
Subject: RE:[ntdev] Physical Slot Number of PCIe card
To: “Windows System Software Devs Interest List”
Date: Thursday, July 29, 2010, 10:58 AM

Why in the world do you want this?? The slot number does not correspond
to anything you can use, for instance Dell has changed the physical slot
ordering in the same model (I’ve worked for firms that in the same order
got multiple machines with differing mappings of slot numbers to
physical slots).

Don Burn (MVP, Windows DKD)

Windows Filesystem and Driver Consulting

Website: http://www.windrvr.com

Blog: http://msmvps.com/blogs/WinDrvr

From: Gurpreet Anand [mailto:xxxxx@yahoo.com]
Posted At: Thursday, July 29, 2010 1:37 PM
Posted To: ntdev
Conversation: Physical Slot Number of PCIe card
Subject: Physical Slot Number of PCIe card

Hi,

I am trying to get actual physical slot number from storport miniport
driver by reading the pciexp_slot_capabilities_register but it is
returning 0s. I am not sure how Device Manager read the PCI slot Number.
Can someone provide a pointer on what I am missing? I tried reading
SystemBusIONUmber from port configuration structure but that seems like
a virtual slot number.

Any help is appreciated.

Thanks,

Gurpreet

Information from ESET Smart Security, version of virus
signature database 5324 (20100729)


The message was checked by ESET Smart Security.

http://www.eset.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Look at device properties. One of the properties is location information which is how device manager is getting it.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Gurpreet Anand
Sent: Thursday, July 29, 2010 11:11 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Physical Slot Number of PCIe card

Don,

Device Manager in Windows is definitely reading it correctly and I dont know how? I want to understand how to display the same information in our GUIs. Customer will like to know which controller is in which slot from GUIs.
Host drivers are reading it from systemBUSIOnumber which seems like a logical slot number and is not matching with that Device Manager is reporting.

Thanks,
Gurpreet

— On Thu, 7/29/10, Don Burn > wrote:

From: Don Burn >
Subject: RE:[ntdev] Physical Slot Number of PCIe card
To: “Windows System Software Devs Interest List” >
Date: Thursday, July 29, 2010, 10:58 AM
Why in the world do you want this? The slot number does not correspond
to anything you can use, for instance Dell has changed the physical slot
ordering in the same model (I’ve worked for firms that in the same order
got multiple machines with differing mappings of slot numbers to
physical slots).

Don Burn (MVP, Windows DKD)

Windows Filesystem and Driver Consulting

Website: http://www.windrvr.comhttp:</http:>

Blog: http://msmvps.com/blogs/WinDrvr

From: Gurpreet Anand [mailto:xxxxx@yahoo.comhttp:]
Posted At: Thursday, July 29, 2010 1:37 PM
Posted To: ntdev
Conversation: Physical Slot Number of PCIe card
Subject: Physical Slot Number of PCIe card

Hi,

I am trying to get actual physical slot number from storport miniport
driver by reading the pciexp_slot_capabilities_register but it is
returning 0s. I am not sure how Device Manager read the PCI slot Number.
Can someone provide a pointer on what I am missing? I tried reading
SystemBusIONUmber from port configuration structure but that seems like
a virtual slot number.

Any help is appreciated.

Thanks,

Gurpreet

Information from ESET Smart Security, version of virus
signature database 5324 (20100729)


The message was checked by ESET Smart Security.

http://www.eset.comhttp:</http:>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</http:>

If you are thinking the Device Manager is reflecting something that is
related to the ordering of the physical slots on the board you are sadly
mistaken. There is no guarantee of a correlation between the data you
can read from the controller and the slots on the board.

Don Burn (MVP, Windows DKD)

Windows Filesystem and Driver Consulting

Website: http://www.windrvr.com

Blog: http://msmvps.com/blogs/WinDrvr

From: Gurpreet Anand [mailto:xxxxx@yahoo.com]
Posted At: Thursday, July 29, 2010 2:11 PM
Posted To: ntdev
Conversation: Physical Slot Number of PCIe card
Subject: RE:Physical Slot Number of PCIe card

Don,

Device Manager in Windows is definitely reading it correctly and I dont
know how? I want to understand how to display the same information in
our GUIs. Customer will like to know which controller is in which slot
from GUIs.

Host drivers are reading it from systemBUSIOnumber which seems like a
logical slot number and is not matching with that Device Manager is
reporting.

Thanks,

Gurpreet

— On Thu, 7/29/10, Don Burn wrote:

From: Don Burn
Subject: RE:[ntdev] Physical Slot Number of PCIe card
To: “Windows System Software Devs Interest List”

Date: Thursday, July 29, 2010, 10:58 AM

Why in the world do you want this? The slot number does not
correspond
to anything you can use, for instance Dell has changed the
physical slot
ordering in the same model (I’ve worked for firms that in the
same order
got multiple machines with differing mappings of slot numbers to
physical slots).

Don Burn (MVP, Windows DKD)

Windows Filesystem and Driver Consulting

Website: http://www.windrvr.com http:</http:>

Blog: http://msmvps.com/blogs/WinDrvr

From: Gurpreet Anand [mailto:xxxxx@yahoo.com
http:
]
Posted At: Thursday, July 29, 2010 1:37 PM
Posted To: ntdev
Conversation: Physical Slot Number of PCIe card
Subject: Physical Slot Number of PCIe card

Hi,

I am trying to get actual physical slot number from storport
miniport
driver by reading the pciexp_slot_capabilities_register but it
is
returning 0s. I am not sure how Device Manager read the PCI slot
Number.
Can someone provide a pointer on what I am missing? I tried
reading
SystemBusIONUmber from port configuration structure but that
seems like
a virtual slot number.

Any help is appreciated.

Thanks,

Gurpreet

Information from ESET Smart Security, version of
virus
signature database 5324 (20100729)


The message was checked by ESET Smart Security.

http://www.eset.com http:</http:>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars
visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Information from ESET Smart Security, version of virus
signature database 5324 (20100729)


The message was checked by ESET Smart Security.

http://www.eset.com</http:>

Don Burn wrote …
If you are thinking the Device Manager is reflecting something that is related to the ordering of the physical slots on the board you are sadly mistaken. There is no guarantee of a correlation between the data you can read from the controller and the slots on the board.

Don’s correct – the “location” info that is reported in the DeviceManager can actually be set as part of the driver initialization, along with the UI number and Address. The OS builds it from the slot, bus and function number but those numbers have no real correlation to the actual backplane.

I’ve done this dance with four companies so far, and spent considerable [billable, though!] time driving this point home: if you want to be able to specifically identify a particular card for an end user you need to a) put an EEPROM on the board that the driver can talk to and burn that EEPROM with a specific unique serial number and b) put an LED on that board that the driver can toggle on or off. There is just no other way to be able to specifically identify a particular card for an end user, and the HW boys are just going to have to go berserk over that one …

Thanks all for the quick response. You guys saved me lot of my time else I would have been spening cycles on this issue.

— On Thu, 7/29/10, choward@ix.netcom.com wrote:

From: choward@ix.netcom.com
Subject: RE:[ntdev] Physical Slot Number of PCIe card
To: “Windows System Software Devs Interest List”
Date: Thursday, July 29, 2010, 11:27 AM

Don Burn wrote …
If you are thinking the Device Manager is reflecting something that is related to the ordering of the physical slots on the board you are sadly mistaken. There is no guarantee of a correlation between the data you can read from the controller and the slots on the board.


Don’s correct – the “location” info that is reported in the DeviceManager can actually be set as part of the driver initialization, along with the UI number and Address.? The OS builds it from the slot, bus and function number but those numbers have no real correlation to the actual backplane.

I’ve done this dance with four companies so far, and spent considerable [billable, though!] time driving this point home: if you want to be able to specifically identify a particular card for an end user you need to a) put an EEPROM on the board that the driver can talk to and burn that EEPROM with a specific unique serial number and b) put an LED on that board that the driver can toggle on or off.? There is just no other way to be able to specifically identify a particular card for an end user, and the HW boys are just going to have to go berserk over that one …


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

That would then make the numbers in your GUI consistent with the numbers
in Device Manager, which is certainly a step in the right direction and
may be all that you actually want.

If you really want the physical slot number (as printed by the card
socket, or on a label on the outside of the box (though those two are
often different)), then as others have pointed out there’s no way to get
it. If you happen to be using a computer where the number displayed by
Device Manager is the same as whatever you mean by “physical slot
number”, that’s just a coincidence.

Regards,
jjf

Doron Holan wrote:

Look at device properties. One of the properties is location
information which is how device manager is getting it.

*From:* Gurpreet Anand
*Sent:* Thursday, July 29, 2010 11:11 AM

Device Manager in Windows is definitely reading it correctly and I dont
know how? I want to understand how to display the same information in
our GUIs. Customer will like to know which controller is in which slot
from GUIs.

Host drivers are reading it from systemBUSIOnumber which seems like a
logical slot number and is not matching with that Device Manager is
reporting.

— On *Thu, 7/29/10, Don Burn mailto:xxxxx wrote:
>
> Why in the world do you want this? The slot number does not correspond
> to anything you can use, for instance Dell has changed the physical slot
> ordering in the same model (I’ve worked for firms that in the same order
> got multiple machines with differing mappings of slot numbers to
> physical slots).
>
> From: Gurpreet Anand [mailto:xxxxx@yahoo.com
>
> I am trying to get actual physical slot number from storport miniport
> driver by reading the pciexp_slot_capabilities_register but it is
> returning 0s. I am not sure how Device Manager read the PCI slot Number.
> Can someone provide a pointer on what I am missing? I tried reading
> SystemBusIONUmber from port configuration structure but that seems like
> a virtual slot number.
>
> Any help is appreciated.</mailto:xxxxx>

Yup! That’s the ONLY way.

It’s cute when you do it, too…

Peter
OSR

> [quote]

put an LED on that board that the driver can toggle on or off
[/quote]

Yup! That’s the ONLY way.

For Ethernets, the simple way is to detach the cable and see what is the Windows name of the card which sensed this.

For storage, the simple way is to attach a known harddisk to it and look at the Device Manager tree for this harddisk.

After this, yellow sticky pieces of paper help a lot.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com