Hi,
I develop a W2k driver which supports several PCI devices.
The PCI devices use different BARs, e.g. one uses only BAR3, another uses
BAR0…2. My driver gets the different raw/translated resources via the
IRP_MN_START_DEVICE Plug and Play IRP.
My problem: I don’t know to which BARs the got Memory and Port resources
belongs to but I need this information absolutely.
I have discovered, that after each Memory and Port resource a
DevicePrivate resource exists in the got resource list. Apparently, the
DevicePrivate.Data[1] value is identical with the BAR number of the
preceding Memory/Port resource - but I dont’ know if this is always true
for all PCI device BAR resources.
Unfortunately, the description in the MSDN Library about the DevicePrivate
member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure says only “Reserved
for system use.”
Have anybody experience with the DevicePrivate member or any further
information?
Thanks
Dieter
You’re not going to be safe if you try to interpret the device private
data. It’s called “private” for a reason and is subject to change.
The resources will be provided in the order they show up in the BARs for
PCI. So the first resource will be BAR0, the next BAR1, etc…
Does that help?
-p
-----Original Message-----
From: xxxxx@men.de [mailto:xxxxx@men.de]
Sent: Monday, February 10, 2003 1:51 AM
To: NT Developers Interest List
Hi,
I develop a W2k driver which supports several PCI devices.
The PCI devices use different BARs, e.g. one uses only BAR3, another
uses BAR0…2. My driver gets the different raw/translated resources via
the IRP_MN_START_DEVICE Plug and Play IRP.
My problem: I don’t know to which BARs the got Memory and Port resources
belongs to but I need this information absolutely.
I have discovered, that after each Memory and Port resource a
DevicePrivate resource exists in the got resource list. Apparently, the
DevicePrivate.Data[1] value is identical with the BAR number of the
preceding Memory/Port resource - but I dont’ know if this is always true
for all PCI device BAR resources.
Unfortunately, the description in the MSDN Library about the
DevicePrivate member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure
says only “Reserved for system use.”
Have anybody experience with the DevicePrivate member or any further
information?
Thanks
Dieter
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
I also noticed the DevicePrivate entries like you did, but did not trust
them.
As Peter mentioned, these are subject to change, which is why they are
called ‘Private’.
Prior to being told by representatives from Microsoft that the entries
are guaranteed to be in order (it’s not specified that way in the DDK
docs, and Walter’s book (1st ed) says to not assume they are in order),
if I had a case where there could be ambiguity of which BAR is which, I
used to send a READ_CONFIG IRP to my own driver to read the BARs
directly from the device and then compare them to the raw resources
handed to the START_DEVICE PNP IRP to determine which one is which.
Perhaps this idea may help you.
I have since submitted a DDK doc bug about the issue.
Jay Talbott
Principal Consulting Engineer
SysPro Consulting, LLC
3519 E. South Fork Drive
Suite 201
Phoenix, AZ 85044
(480) 704-8045
xxxxx@sysproconsulting.com
http://www.sysproconsulting.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@men.de
Sent: Monday, February 10, 2003 2:51 AM
To: NT Developers Interest List
Subject: [ntdev] PCI BAR number & CM_PARTIAL_RESOURCE_DESCRIPTOR
Hi,
I develop a W2k driver which supports several PCI devices.
The PCI devices use different BARs, e.g. one uses only BAR3,
another uses
BAR0…2. My driver gets the different raw/translated resources via the
IRP_MN_START_DEVICE Plug and Play IRP.
My problem: I don’t know to which BARs the got Memory and
Port resources
belongs to but I need this information absolutely.
I have discovered, that after each Memory and Port resource a
DevicePrivate resource exists in the got resource list.
Apparently, the
DevicePrivate.Data[1] value is identical with the BAR number of the
preceding Memory/Port resource - but I dont’ know if this is
always true
for all PCI device BAR resources.
Unfortunately, the description in the MSDN Library about the
DevicePrivate
member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure says
only “Reserved
for system use.”
Have anybody experience with the DevicePrivate member or any further
information?
Thanks
Dieter
You are currently subscribed to ntdev as:
xxxxx@sysproconsulting.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Jay Talbott wrote:
Prior to being told by representatives from Microsoft that the entries
are guaranteed to be in order (it’s not specified that way in the DDK
docs, and Walter’s book (1st ed) says to not assume they are in order),
if I had a case where there could be ambiguity of which BAR is which, I
used to send a READ_CONFIG IRP to my own driver to read the BARs
directly from the device and then compare them to the raw resources
handed to the START_DEVICE PNP IRP to determine which one is which.
Perhaps this idea may help you.
I have since submitted a DDK doc bug about the issue.
Peter W. (or somebody) told us in one of these forums within the last
couple of months that we can count on resources being in BAR order.
(Actually, we’ve now been told *twice*.) My 2d edition says the same
thing as the 1st, but I added an errata entry to my web page to reflect
this needed clarification.
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com