Port resources in the startdevice routine

You should be using the Translated Resources from the CmResourceTypePort to access the Device Registers. Or if you are using the Raw resources, i guess you should be Translating that before using it to access you Device Registers.
----- Original Message -----
From: Monisha Barooah
To: Windows System Software Devs Interest List
Sent: Tuesday, December 13, 2005 10:54 AM
Subject: [ntdev] Port resources in the startdevice routine

Hello Everybody,
This query was relating to the port resources returned by the pnp manager in the start device routine.

The pnp manager provides two sets of driver resources - raw resources and translated resources.

Which of these two port resource types should be used in a driver the device of which is accessed in I/O address space?

Do we need to access the raw resources returned in the ‘CmResourceTypePort’ case statement to access the device registers? or do we need to access device registers through the translated resources returned within the same case statement in the start device routine?

We having been facing an issue with our controller reset not going through consistenly and so doubt this as a problem. The hardware is fine I guess as it works appropriately with the corresponding microsoft driver…

Anyone having any pointers on this.

Thanks,
Monisha.


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

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

You should use the translated resources. The only time you need to look at the raw resources is to correlate what the raw resources were converted into in the translated resource list.

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Monisha Barooah
Sent: Monday, December 12, 2005 9:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Port resources in the startdevice routine

Hello Everybody,
?? This query was relating to the port resources returned by the pnp manager in the start device routine.
?
???The pnp manager?provides two sets of driver resources - raw resources and translated resources.
?
?? Which of these two port resource types should be used in a driver the device of which is accessed in I/O address space?
?
?? Do we need to?access the raw resources returned in the ‘CmResourceTypePort’ case statement to access the device registers? or do we need to access device registers through the translated resources returned within the same case statement in the start device routine?
?
?? We having been facing an issue with our controller reset not going through consistenly and so doubt this as a problem. The hardware is fine I guess as it works appropriately with the corresponding microsoft driver…
?
?? Anyone having any pointers on this.
?
Thanks,
Monisha.
?


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

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

I doubt if this is the right way even though that is the way all the
freeware source codes seem to do it.
This has not been mentioned clearly in the DDK documentation.
In the section “Mapping Bus-Relative Addresses to Virtual Addresses” =
in the
WinXP DDK, it says,
"For a resource in I/O space (CmResourceTypePort, CmResourceTypeInter=
rupt,
CmResourceTypeDma), the driver should use the low-order 32 bits of th=
e
returned physical address to access the device resource, for example,
through the HAL’s read and write READ_REGISTER_ Xxx, WRITE_REGISTER_X=
xxx,
READ_PORT_Xxx, and WRITE_PORT_Xxx routines. "

It does not say, “use the low-order 32 bits of the translated port
resource.”

The problem with our host controller reset not going through seem to =
have
got fixed when we started using the raw port resources rather than th=
e
translated port resources in the start device.

I don’t know if anyone else has faced such issues but surely the DDK
documentation does not clearly say about the same.

Regards,
Monisha.

Subject: RE: Port resources in the startdevice routine

From: “Doron Holan”
> Date: Mon, 12 Dec 2005 22:25:03 -0800
> X-Message-Number: 7
>
> You should use the translated resources. The only time you need to=
look
at the raw resources is to correlate what the raw resources were conv=
erted
into in the translated resource list.
>
> d
>
> ________________________________________
> From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Monisha Baroo=
ah
> Sent: Monday, December 12, 2005 9:24 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Port resources in the startdevice routine
>
> Hello Everybody,
> =A0=A0 This query was relating to the port resources returned by th=
e pnp
manager in the start device routine.
> ?
> =A0=A0=A0The pnp manager=A0provides two sets of driver resources - =
raw resources
and translated resources.
> ?
> =A0=A0 Which of these two port resource types should be used in a d=
river the
device of which is accessed in I/O address space?
> ?
> =A0=A0 Do we need to=A0access the raw resources returned in the
‘CmResourceTypePort’ case statement to access the device registers? o=
r do we
need to access device registers through the translated resources retu=
rned
within the same case statement in the start device routine?
> ?
> =A0=A0 We having been facing an issue with our controller reset not=
going
through consistenly and so doubt this as a problem. The hardware is f=
ine I
guess as it works appropriately with the corresponding microsoft driv=
er…
> ?
> =A0=A0 Anyone having any pointers on this.
> ?
> Thanks,
> Monisha.
> ?
>

The DDK documentation may not be completely consistent or totally unambiguous about the translated vs raw usage but your doubts are at variance with seven years or so of practice. (Plus Doron generally knows what he is talking about.) That leaves us with the uncomfortable reported fact that your translated resources don’t work while the raw resources do. What sort of platform is this? What sort of device connected to which bus pci/isa? Finally what exactly are the specific raw and translated IO resource values returned?

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Monisha Barooah
Sent: Wednesday, December 14, 2005 12:56 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Port resources in the startdevice routine

I doubt if this is the right way even though that is the way
all the freeware source codes seem to do it.
This has not been mentioned clearly in the DDK documentation.
In the section “Mapping Bus-Relative Addresses to Virtual
Addresses” in the WinXP DDK, it says, "For a resource in I/O
space (CmResourceTypePort, CmResourceTypeInterrupt,
CmResourceTypeDma), the driver should use the low-order 32
bits of the returned physical address to access the device
resource, for example, through the HAL’s read and write
READ_REGISTER_ Xxx, WRITE_REGISTER_Xxxx, READ_PORT_Xxx, and
WRITE_PORT_Xxx routines. "

It does not say, “use the low-order 32 bits of the translated
port resource.”

The problem with our host controller reset not going through
seem to have got fixed when we started using the raw port
resources rather than the translated port resources in the
start device.

I don’t know if anyone else has faced such issues but surely
the DDK documentation does not clearly say about the same.

Regards,
Monisha.

Subject: RE: Port resources in the startdevice routine
> From: “Doron Holan”
> > Date: Mon, 12 Dec 2005 22:25:03 -0800
> > X-Message-Number: 7
> >
> > You should use the translated resources. The only time you need to
> > look
> at the raw resources is to correlate what the raw resources
> were converted into in the translated resource list.
> >
> > d
> >
> > ________________________________________
> > From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> Monisha Barooah
> > Sent: Monday, December 12, 2005 9:24 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Port resources in the startdevice routine
> >
> > Hello Everybody,
> > 젨 This query was relating to the port resources returned by the pnp
> manager in the start device routine.
> > ?
> > 젨쟕he pnp manager쟰rovides two sets of driver resources - raw
> resources
> and translated resources.
> > ?
> > 젨 Which of these two port resource types should be used in a driver
> > the
> device of which is accessed in I/O address space?
> > ?
> > 젨 Do we need to쟞ccess the raw resources returned in the
> ‘CmResourceTypePort’ case statement to access the device
> registers? or do we need to access device registers through
> the translated resources returned within the same case
> statement in the start device routine?
> > ?
> > 젨 We having been facing an issue with our controller reset not going
> through consistenly and so doubt this as a problem. The
> hardware is fine I guess as it works appropriately with the
> corresponding microsoft driver…
> > ?
> > 젨 Anyone having any pointers on this.
> > ?
> > Thanks,
> > Monisha.
> > ?
> >
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

I think that you’re seeing an example of a situation where something is
happening intermittently and you’ve incorrectly concluded that a change that
you made affected the situation. I don’t think that using the raw resources
had any effect on the reset behavior.

I say this because, on the vast majority of PCs which almost certainly
includes the one you’re using, the raw and the translated port values will
be exactly the same. So your code, if it’s written correctly, would pick up
exactly the same values from either the raw or the translated fields and
your host controller reset wouldn’t change.

Use the translated resources. Then your driver will work even on the
infintessimally small number of remaining machines for which there is a
difference between raw and translated.


Jake Oshins
Windows Kernel Group

The Virtual Machine Team at Microsoft is hiring. Contact
xxxxx@microsoft.com for more information.

This posting is provided “AS IS” with no warranties, and confers no rights.

“Monisha Barooah” wrote in message
news:xxxxx@ntdev…
I doubt if this is the right way even though that is the way all the
freeware source codes seem to do it.
This has not been mentioned clearly in the DDK documentation.
In the section “Mapping Bus-Relative Addresses to Virtual Addresses” in the
WinXP DDK, it says,
"For a resource in I/O space (CmResourceTypePort, CmResourceTypeInterrupt,
CmResourceTypeDma), the driver should use the low-order 32 bits of the
returned physical address to access the device resource, for example,
through the HAL’s read and write READ_REGISTER_ Xxx, WRITE_REGISTER_Xxxx,
READ_PORT_Xxx, and WRITE_PORT_Xxx routines. "

It does not say, “use the low-order 32 bits of the translated port
resource.”

The problem with our host controller reset not going through seem to have
got fixed when we started using the raw port resources rather than the
translated port resources in the start device.

I don’t know if anyone else has faced such issues but surely the DDK
documentation does not clearly say about the same.

Regards,
Monisha.

Subject: RE: Port resources in the startdevice routine
> From: “Doron Holan”
> Date: Mon, 12 Dec 2005 22:25:03 -0800
> X-Message-Number: 7
>
> You should use the translated resources. The only time you need to look
at the raw resources is to correlate what the raw resources were converted
into in the translated resource list.
>
> d
>
> ________________________________________
> From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Monisha Barooah
> Sent: Monday, December 12, 2005 9:24 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Port resources in the startdevice routine
>
> Hello Everybody,
> This query was relating to the port resources returned by the pnp
manager in the start device routine.
> ?
> The pnp manager provides two sets of driver resources - raw resources
and translated resources.
> ?
> Which of these two port resource types should be used in a driver the
device of which is accessed in I/O address space?
> ?
> Do we need to access the raw resources returned in the
‘CmResourceTypePort’ case statement to access the device registers? or do we
need to access device registers through the translated resources returned
within the same case statement in the start device routine?
> ?
> We having been facing an issue with our controller reset not going
through consistenly and so doubt this as a problem. The hardware is fine I
guess as it works appropriately with the corresponding microsoft driver…
> ?
> Anyone having any pointers on this.
> ?
> Thanks,
> Monisha.
> ?
>

> The pnp manager provides two sets of driver resources - raw resources and
translated resources.

Which of these two port resource types should be used in a driver the
device of which is accessed in I/O address space?

Translated.

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