How to get PCI Slot Number in W2K ??

Hi gurus,

Is there any way I get to know the PCI slot number in W2K ?
I am writing a miniport driver for ethernet card and need to know the PCI
slot number on which the ethernet card is placed??

Thanx
Gopikrishna


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Call IoGetDeviceProperty(pdo,DevicePropertyAddress,…); the return value is

(slot << 16) | function

/simgr

-----Original Message-----
From: Gopikrishna Prabhakar Yadappanavar
[mailto:xxxxx@wipro.com]
Sent: Monday, March 19, 2001 1:12 AM
To: NT Developers Interest List
Subject: [ntdev] How to get PCI Slot Number in W2K ??

Hi gurus,

Is there any way I get to know the PCI slot number in W2K ?
I am writing a miniport driver for ethernet card and need to know the PCI
slot number on which the ethernet card is placed??

Thanx
Gopikrishna


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Of course, I missed the fact that this is an NDIS Miniport we are talking
about, so calling any useful routines just isn’t possible…

I don’t know of a way to do this using only Ndis calls; but I’d sure be
interested if anyone else does!

/simgr

-----Original Message-----
From: Graham, Simon [mailto:xxxxx@stratus.com]
Sent: Monday, March 19, 2001 6:59 AM
To: NT Developers Interest List
Subject: [ntdev] RE: How to get PCI Slot Number in W2K ??

Call IoGetDeviceProperty(pdo,DevicePropertyAddress,…); the return value is

(slot << 16) | function

/simgr

-----Original Message-----
From: Gopikrishna Prabhakar Yadappanavar
[mailto:xxxxx@wipro.com]
Sent: Monday, March 19, 2001 1:12 AM
To: NT Developers Interest List
Subject: [ntdev] How to get PCI Slot Number in W2K ??

Hi gurus,

Is there any way I get to know the PCI slot number in W2K ?
I am writing a miniport driver for ethernet card and need to know the PCI
slot number on which the ethernet card is placed??

Thanx
Gopikrishna


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> From: “Graham, Simon”
>
> From: Gopikrishna Prabhakar Yadappanavar
> >
> > Is there any way I get to know the PCI slot number in W2K ?
>
> Call IoGetDeviceProperty(pdo,DevicePropertyAddress,…); the return value is
>
> (slot << 16) | function

No - the value this gives you is ((device << 16) | function). This
is the format which Windows sometimes calls a “PCI address”.

This all depends on what the questioner means by “PCI slot number”
- PCI itself doesn’t have a concept of “slot number”.

Several NDIS routines require a “slot number” which is sometimes
helpfully defined as a “logical slot number”, but is nowhere
properly defined for NDIS that I can see. Equivalent routines
for SCSI miniports, and the NT4 HAL routines, define this ULONG
parameter as a “PCI_SLOT_NUMBER-type value”. This is a ULONG
containing the same information as a “PCI address” but in a
different format. I guess this is what the NDIS routines want.

However, I haven’t yet got to grips with how you’re supposed to
find this information in the Win2k PnP world. My guess as to how
NDIS fits in with PnP W2k is that MiniportInitialize will be
called each time an appropriate device is enumerated, equivalent
to AddDevice being called in a “real” driver. NDIS could know the
Device and Function number at this time; a sensible thing to do
which would be in line with the NDIS interface would be for NDIS
to put this information in the registry in some standard format
where the miniport could retrieve it using the ConfigurationHandle
parameter to MiniportInitialize.

This is all guesswork, as I don’t know much about W2k/PnP drivers
and even less about NDIS miniports. Does anyone know how this
really works?

To summarize my guesses: the NDIS routines are looking for a
PCI_SLOT_NUMBER structure (as a ULONG) when they ask for a “PCI
Slot Number”, and you get this (or the data to create it) from
the registry through your ConfigurationHandle. If anyone can
either correct this or fill in the missing bits, I’ll be grateful.

If the original questioner is looking for some other information,
perhaps the user’s view of a slot number (that is, the number
printed next to the socket on the board), then the
DevicePropertyUINumber parameter to IoGetDeviceProperty() might
be useful, though not to a strict NDIS miniport.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Click this link:
http://support.microsoft.com/support/kb/articles/Q253/2/32.ASP

Article: Q253232
HOWTO: Get Configuration and Location Information of PCI device

zhongsheng

-----Original Message-----
From: J. J. Farrell [mailto:xxxxx@bcs.org.uk]
Sent: Monday, March 19, 2001 5:16 PM
To: NT Developers Interest List
Subject: [ntdev] RE: How to get PCI Slot Number in W2K ??

From: “Graham, Simon”
>
> From: Gopikrishna Prabhakar Yadappanavar
> >
> > Is there any way I get to know the PCI slot number in W2K ?
>
> Call IoGetDeviceProperty(pdo,DevicePropertyAddress,…); the return value
is
>
> (slot << 16) | function

No - the value this gives you is ((device << 16) | function). This
is the format which Windows sometimes calls a “PCI address”.

This all depends on what the questioner means by “PCI slot number”
- PCI itself doesn’t have a concept of “slot number”.

Several NDIS routines require a “slot number” which is sometimes
helpfully defined as a “logical slot number”, but is nowhere
properly defined for NDIS that I can see. Equivalent routines
for SCSI miniports, and the NT4 HAL routines, define this ULONG
parameter as a “PCI_SLOT_NUMBER-type value”. This is a ULONG
containing the same information as a “PCI address” but in a
different format. I guess this is what the NDIS routines want.

However, I haven’t yet got to grips with how you’re supposed to
find this information in the Win2k PnP world. My guess as to how
NDIS fits in with PnP W2k is that MiniportInitialize will be
called each time an appropriate device is enumerated, equivalent
to AddDevice being called in a “real” driver. NDIS could know the
Device and Function number at this time; a sensible thing to do
which would be in line with the NDIS interface would be for NDIS
to put this information in the registry in some standard format
where the miniport could retrieve it using the ConfigurationHandle
parameter to MiniportInitialize.

This is all guesswork, as I don’t know much about W2k/PnP drivers
and even less about NDIS miniports. Does anyone know how this
really works?

To summarize my guesses: the NDIS routines are looking for a
PCI_SLOT_NUMBER structure (as a ULONG) when they ask for a “PCI
Slot Number”, and you get this (or the data to create it) from
the registry through your ConfigurationHandle. If anyone can
either correct this or fill in the missing bits, I’ll be grateful.

If the original questioner is looking for some other information,
perhaps the user’s view of a slot number (that is, the number
printed next to the socket on the board), then the
DevicePropertyUINumber parameter to IoGetDeviceProperty() might
be useful, though not to a strict NDIS miniport.


You are currently subscribed to ntdev as: xxxxx@exgate.tek.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> From: xxxxx@exgate.tek.com

Click this link:
http://support.microsoft.com/support/kb/articles/Q253/2/32.ASP

Article: Q253232
HOWTO: Get Configuration and Location Information of PCI device

Thanks; that’s basically an extended version of the method
documented in the DDK for getting Device and Function numbers
in W2k drivers. I don’t think this method can be used within
“the rules” from NDIS miniports, which is what the original
questioner needs.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> From: Gopikrishna Prabhakar Yadappanavar

Is there any way I get to know the PCI slot number in W2K ?
I am writing a miniport driver for ethernet card and need to
know the PCI
slot number on which the ethernet card is placed??

Why do you need to know this?

Regards – Andy


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,

----->Why do I need this ?
What I need is basically an instance number (like eth0, eth1 in UNIX
flavours)
I can get it from the registry or through some calls.
But the way I get differs from NT to W2K…
Moreover I am looking for some way of getting instance number which is OS
independent as I am developing drivers on multiple platforms.

Thanx
Gopikrishna

----- Original Message -----
From: Grover, Andrew
To: NT Developers Interest List
Sent: Wednesday, March 21, 2001 6:44 AM
Subject: [ntdev] RE: How to get PCI Slot Number in W2K ??

> > From: Gopikrishna Prabhakar Yadappanavar
> > Is there any way I get to know the PCI slot number in W2K ?
> > I am writing a miniport driver for ethernet card and need to
> > know the PCI
> > slot number on which the ethernet card is placed??
>
> Why do you need to know this?
>
> Regards – Andy
>
>
> —
> You are currently subscribed to ntdev as:
xxxxx@wipro.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com