How to get PCI Bus# user mode

Hi all,

Is there a way to map a PCI-based SCSI Port to its associating PCI Bus location from user mode?
For example, in HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5 (Emulex LP8000 card, driver: elxstor.sys) , I want to know the PCI Bus location of the adapter/controller, like “PCI Bus 3, Device 7, Function 0”

I am familiar with SetupDixxx and the SCSI setup class GUID.

Thanks in advance

PT

use SPDRP_LOCATION_INFORMATION like this:
TCHAR fname[256];
SetupDiGetDeviceRegistryProperty(info, &did, SPDRP_LOCATION_INFORMATION,
NULL, (PBYTE) fname, sizeof(fname), NULL))

where did is SP_DEVINFO_DATA (from SetupDiGetDeviceInterfaceDetail(…)
and info is HDEVINFO info (from SetupDiGetClassDevs(…)

Robin

-----Original Message-----
From: Peter Trinh [mailto:xxxxx@verizon.net]
Sent: Donnerstag, 8. April 2004 17:42
To: Windows System Software Devs Interest List
Subject: [ntdev] How to get PCI Bus# user mode

Hi all,

Is there a way to map a PCI-based SCSI Port to its
associating PCI Bus location from user mode?
For example, in
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5
(Emulex LP8000 card, driver: elxstor.sys) , I want to know
the PCI Bus location of the adapter/controller, like “PCI Bus
3, Device 7, Function 0”

I am familiar with SetupDixxx and the SCSI setup class GUID.

Thanks in advance

PT


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@exgate.tek.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Robin,
Thanks for the suggestion.
But how do I tell SetupDixxx that this is Scsi Port 5, for example, that I am looking for? Could you elaborate?

Thanks

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@exgate.tek.com
Sent: Thursday, April 08, 2004 9:04 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to get PCI Bus# user mode

use SPDRP_LOCATION_INFORMATION like this:
TCHAR fname[256];
SetupDiGetDeviceRegistryProperty(info, &did, SPDRP_LOCATION_INFORMATION,
NULL, (PBYTE) fname, sizeof(fname), NULL))

where did is SP_DEVINFO_DATA (from SetupDiGetDeviceInterfaceDetail(…)
and info is HDEVINFO info (from SetupDiGetClassDevs(…)

Robin

-----Original Message-----
From: Peter Trinh [mailto:xxxxx@verizon.net]
Sent: Donnerstag, 8. April 2004 17:42
To: Windows System Software Devs Interest List
Subject: [ntdev] How to get PCI Bus# user mode

Hi all,

Is there a way to map a PCI-based SCSI Port to its
associating PCI Bus location from user mode?
For example, in
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5
(Emulex LP8000 card, driver: elxstor.sys) , I want to know
the PCI Bus location of the adapter/controller, like “PCI Bus
3, Device 7, Function 0”

I am familiar with SetupDixxx and the SCSI setup class GUID.

Thanks in advance

PT


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@exgate.tek.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@verizon.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Why do you care that it’s port 5 vs. port 4? Obviously you want to
uniquely identify which controller it is, but the port number isn’t the
way to do that as the port number can change across boots.

You can find all the storage port devices using SetupDi to find all
instances of the device interface GUID_DEVINTERFACE_STORAGEPORT (this
will show all port drivers, scsi or not) and query each for the
information. You can reuse the name that SetupDi gives you for the
device interface across reboots to uniquely identify that device (as
long as it isn’t moved - PCI devices don’t have unique IDs that would
allow the system to track devices moving slots).

So what are you actually trying to do?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Trinh
Sent: Thursday, April 08, 2004 9:36 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to get PCI Bus# user mode

Robin,
Thanks for the suggestion.
But how do I tell SetupDixxx that this is Scsi Port 5, for example, that
I am looking for? Could you elaborate?

Thanks

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@exgate.tek.com
Sent: Thursday, April 08, 2004 9:04 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to get PCI Bus# user mode

use SPDRP_LOCATION_INFORMATION like this:
TCHAR fname[256];
SetupDiGetDeviceRegistryProperty(info, &did,
SPDRP_LOCATION_INFORMATION, NULL, (PBYTE) fname, sizeof(fname), NULL))

where did is SP_DEVINFO_DATA (from SetupDiGetDeviceInterfaceDetail(…)
and info is HDEVINFO info (from SetupDiGetClassDevs(…)

Robin

-----Original Message-----
From: Peter Trinh [mailto:xxxxx@verizon.net]
Sent: Donnerstag, 8. April 2004 17:42
To: Windows System Software Devs Interest List
Subject: [ntdev] How to get PCI Bus# user mode

Hi all,

Is there a way to map a PCI-based SCSI Port to its associating PCI Bus

location from user mode?
For example, in
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5 (Emulex LP8000
card, driver: elxstor.sys) , I want to know the PCI Bus location of
the adapter/controller, like “PCI Bus 3, Device 7, Function 0”

I am familiar with SetupDixxx and the SCSI setup class GUID.

Thanks in advance

PT


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@exgate.tek.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@verizon.net To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

It is called DevicePropertyLocationInformation or such.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Peter Trinh”
To: “Windows System Software Devs Interest List”
Sent: Thursday, April 08, 2004 7:42 PM
Subject: [ntdev] How to get PCI Bus# user mode

> Hi all,
>
> Is there a way to map a PCI-based SCSI Port to its associating PCI Bus
location from user mode?
> For example, in HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5
(Emulex LP8000 card, driver: elxstor.sys) , I want to know the PCI Bus location
of the adapter/controller, like “PCI Bus 3, Device 7, Function 0”
>
> I am familiar with SetupDixxx and the SCSI setup class GUID.
>
> Thanks in advance
>
> PT
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Peter,

Our server has so many PCI slots, and our application wants to keep track of what adapter/controller is in what slot so that it can tell the user, in case of hardware failure or hardware removal/insertion between boots, that it detects the change, and smart enough hopefully, it can tell the corresponding slot.

Ultimately, we want to get the PCI Slot#, given PCI Bus#, Device#, Function#.

We can use SetupDi to query all “SCSI and RAID Controllers” devices, and find out the PCI Bus#, Device#, and Function#. I want to know the PCI Slot# as well, but I dont know how.

Thanks
PT

From: “Peter Wieland”
> Date: 2004/04/08 Thu AM 09:53:46 PDT
> To: “Windows System Software Devs Interest List”
> Subject: RE: [ntdev] How to get PCI Bus# user mode
>
> Why do you care that it’s port 5 vs. port 4? Obviously you want to
> uniquely identify which controller it is, but the port number isn’t the
> way to do that as the port number can change across boots.
>
> You can find all the storage port devices using SetupDi to find all
> instances of the device interface GUID_DEVINTERFACE_STORAGEPORT (this
> will show all port drivers, scsi or not) and query each for the
> information. You can reuse the name that SetupDi gives you for the
> device interface across reboots to uniquely identify that device (as
> long as it isn’t moved - PCI devices don’t have unique IDs that would
> allow the system to track devices moving slots).
>
> So what are you actually trying to do?
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Peter Trinh
> Sent: Thursday, April 08, 2004 9:36 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] How to get PCI Bus# user mode
>
> Robin,
> Thanks for the suggestion.
> But how do I tell SetupDixxx that this is Scsi Port 5, for example, that
> I am looking for? Could you elaborate?
>
> Thanks
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of
> xxxxx@exgate.tek.com
> Sent: Thursday, April 08, 2004 9:04 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] How to get PCI Bus# user mode
>
>
> use SPDRP_LOCATION_INFORMATION like this:
> TCHAR fname[256];
> SetupDiGetDeviceRegistryProperty(info, &did,
> SPDRP_LOCATION_INFORMATION, NULL, (PBYTE) fname, sizeof(fname), NULL))
>
> where did is SP_DEVINFO_DATA (from SetupDiGetDeviceInterfaceDetail(…)
> and info is HDEVINFO info (from SetupDiGetClassDevs(…)
>
> Robin
>
> > -----Original Message-----
> > From: Peter Trinh [mailto:xxxxx@verizon.net]
> > Sent: Donnerstag, 8. April 2004 17:42
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] How to get PCI Bus# user mode
> >
> >
> > Hi all,
> >
> > Is there a way to map a PCI-based SCSI Port to its associating PCI Bus
>
> > location from user mode?
> > For example, in
> > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5 (Emulex LP8000
> > card, driver: elxstor.sys) , I want to know the PCI Bus location of
> > the adapter/controller, like “PCI Bus 3, Device 7, Function 0”
> >
> > I am familiar with SetupDixxx and the SCSI setup class GUID.
> >
> > Thanks in advance
> >
> > PT
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@exgate.tek.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@verizon.net To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@verizon.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

If by slot number you mean a physical PCI bus slot, good luck on that. I
think that has been discussed here in this group and I think the consensus
was that given the variation in platforms out there it was not really
feasible to come up with a scheme that would reliably identify a physical
slot.

=====================
Mark Roddy

-----Original Message-----
From: Peter Trinh [mailto:xxxxx@verizon.net]
Sent: Thursday, April 08, 2004 2:17 PM
To: Windows System Software Devs Interest List
Subject: Re: RE: [ntdev] How to get PCI Bus# user mode

Hi Peter,

Our server has so many PCI slots, and our application wants
to keep track of what adapter/controller is in what slot so
that it can tell the user, in case of hardware failure or
hardware removal/insertion between boots, that it detects the
change, and smart enough hopefully, it can tell the
corresponding slot.

Ultimately, we want to get the PCI Slot#, given PCI Bus#,
Device#, Function#.

We can use SetupDi to query all “SCSI and RAID Controllers”
devices, and find out the PCI Bus#, Device#, and Function#. I
want to know the PCI Slot# as well, but I dont know how.

Thanks
PT
>
> From: “Peter Wieland”
> > Date: 2004/04/08 Thu AM 09:53:46 PDT
> > To: “Windows System Software Devs Interest List”
>
> > Subject: RE: [ntdev] How to get PCI Bus# user mode
> >
> > Why do you care that it’s port 5 vs. port 4? Obviously you want to
> > uniquely identify which controller it is, but the port number isn’t
> > the way to do that as the port number can change across boots.
> >
> > You can find all the storage port devices using SetupDi to find all
> > instances of the device interface
> GUID_DEVINTERFACE_STORAGEPORT (this
> > will show all port drivers, scsi or not) and query each for the
> > information. You can reuse the name that SetupDi gives you for the
> > device interface across reboots to uniquely identify that
> device (as
> > long as it isn’t moved - PCI devices don’t have unique IDs
> that would
> > allow the system to track devices moving slots).
> >
> > So what are you actually trying to do?
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Peter Trinh
> > Sent: Thursday, April 08, 2004 9:36 AM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] How to get PCI Bus# user mode
> >
> > Robin,
> > Thanks for the suggestion.
> > But how do I tell SetupDixxx that this is Scsi Port 5, for example,
> > that I am looking for? Could you elaborate?
> >
> > Thanks
> >
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of
> > xxxxx@exgate.tek.com
> > Sent: Thursday, April 08, 2004 9:04 AM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] How to get PCI Bus# user mode
> >
> >
> > use SPDRP_LOCATION_INFORMATION like this:
> > TCHAR fname[256];
> > SetupDiGetDeviceRegistryProperty(info, &did,
> > SPDRP_LOCATION_INFORMATION, NULL, (PBYTE) fname,
> sizeof(fname), NULL))
> >
> > where did is SP_DEVINFO_DATA (from
> > SetupDiGetDeviceInterfaceDetail(…)
> > and info is HDEVINFO info (from SetupDiGetClassDevs(…)
> >
> > Robin
> >
> > > -----Original Message-----
> > > From: Peter Trinh [mailto:xxxxx@verizon.net]
> > > Sent: Donnerstag, 8. April 2004 17:42
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] How to get PCI Bus# user mode
> > >
> > >
> > > Hi all,
> > >
> > > Is there a way to map a PCI-based SCSI Port to its
> associating PCI
> > > Bus
> >
> > > location from user mode?
> > > For example, in
> > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5 (Emulex
> > > LP8000 card, driver: elxstor.sys) , I want to know the PCI Bus
> > > location of the adapter/controller, like “PCI Bus 3,
> Device 7, Function 0”
> > >
> > > I am familiar with SetupDixxx and the SCSI setup class GUID.
> > >
> > > Thanks in advance
> > >
> > > PT
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as:
> xxxxx@exgate.tek.com
> > > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> xxxxx@verizon.net To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@windows.microsoft.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> xxxxx@verizon.net To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>