Dear all,
Thank you very much for all of your concerns in my problem !
So, I’d like to summarize the issues that you raise here:
[1] I/O source seems to be fixed address when using
“READ_PORT_BUFFER_ULONG”? which is different from using
“READ_REGISTER_BUFFER_ULONG”.
Solution : Using the loop to read I/O and increase the address source/destination manually.
I will checked this
but in previous time, I read only 1DW so it doesn’t seem the problem.
//------------------
[From Tim Roberts] Are you actually seeing CM_RESOURCE_PORT_MEMORY here?? If so, Igor is right and I owe him an apology, but I’d be curious to know about your
hardware.? I suspect we’ll start seeing this kind of thing again with
Windows 8 on the ARM, but it’s a little soon to know for sure.
Yes, I already checked the Flag and (resource->Flags & CM_RESOURCE_PORT_MEMORY = 0) but (resource->Flags & CM_RESOURCE_PORT_IO = 1)? . This means the IO space should not
be accessed as memory and MmmapIO space should not be used.
My hardware checking includes ( Micro Yukon Ethernet PCIe card) and ( Nvidia VGA card ) .? Both of them includes I/O space. I used “RW-Everything” to check and I can access the I/O space read/write normally.
In Ethernet PCIe , the IO is start from 0xE800 and size = 256 bytes.
I check the command “READ_PORT_BUFFER_ULONG” to read 1DW.
The input is (address = 0xE800) , size = 1DW . But it doesn’t work.
? ?? Actually, I could make the IO access run ( using MmmapIOSpace)? but it’s not normal way of? documents . I’m very confused. If you can confirm this . Please share with
me .
Thank you very much !
Best Regards
HanNguyen
Nguyen Nhat Han
MobiPhone : 0906.739.923
C?ng ty : Cty TNHH Thiet ke Renesas
— On Thu, 7/28/11, Skywing wrote:
From: Skywing
Subject: RE: [ntdev] [About IO access in PCIe]
To: “Windows System Software Devs Interest List”
Date: Thursday, July 28, 2011, 2:16 AM
Have
you used the documentation feedback link to raise this issue?? Doing
that is the best channel to get documentation issues repaired.
- S
-----Original Message-----
From: Joseph M. Newcomer
Sent: Wednesday, July 27, 2011 11:27
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] [About IO access in PCIe]
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, July 27, 2011 2:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] [About IO access in PCIe]
Nhat Han wrote:
>? ???However, when I used “READ_PORT_BUFFER_ULONG” at the I/O address,
> The returning result is not correct ( I check with RW Everything
software).
> # I’m sure that the address of IO area in the command is correct with
> the display in Device Manager ( Resource / IO range)
How large is your I/O region, and how many dwords are you reading?
READ_PORT_BUFFER_ULONG uses incrementing addresses.? That is, if your
I/O port is at 0x4000 and you read 4 dwords, it will read from 0x4000,
then 0x4004, then 0x4008, then 0x400C.? That’s not usually how I/O port
ranges work.? If you need to read 4 dwords from the I/O port at 0x4000,
then you need to use READ_PORT_ULONG in a loop.
Actually, it does not work this way.? READ_REGISTER_BUFFER_ULONG reads from
sequential source addresses and copies to sequential destination addresses.
But READ_PORT_BUFFER_ULONG holds the port address steady and copies to
sequential destination addresses (the goal being, for example, to copy from
a FIFO whose first element is always at a fixed I/O Port address.)? The
documentation is not at all clear on this.
As far as I can tell, the author of the document did a copy-and-paste from
READ_REGISTER_BUFFER_ULONG and didn’t do the correct edits to make it tell
the truth.? The dead giveaway is that we have
-----------------------------
READ_REGISTER_BUFFER_ULONG
Register
Pointer to the register, which must be a mapped range in memory space
READ_PORT_BUFFER_ULONG
Port [in]
Specifies the port address, which must be a mapped memory range in I/O
space.
-----------------------------
Note that the phrase “mapped memory range in I/O space” as shown in the
description under READ_PORT_BUFFER_ULONG make no sense as used.? If it is
memory space, it is mapped; if it is in I/O space, it cannot possibly be a
“mapped memory range”, in fact, I have no idea what that means!? If it had
said “mapped address range in I/O space” it might have been closer to the
truth, although I question the correctness of the word “mapped”.? I think it
should have said
“Specifies the port address, which must be in the I/O space”
The fact that none of the descriptions say that for READ_REGISTER_BUFFER_xxx
both the source and destination are incremented, but for
READ_PORT_BUFFER_xxx, only the destination is incremented, is a horrendous
oversight.
??? ??? ??? ??? ??? joe
—
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
---------------------------------------
Nguyen Nhat Han
MobiPhone : 0906.739.923
C?ng ty : Cty TNHH Thiet ke Renesas
---------------------------------------
— On Thu, 7/28/11, Tim Roberts wrote:
From: Tim Roberts
Subject: Re: [ntdev] [About IO access in PCIe]
To: “Windows System Software Devs Interest List”
Date: Thursday, July 28, 2011, 1:01 AM
Nhat Han wrote:
> In my XP 32 bit PC, I can scan the resource to recognize IO space
> ( resource->Type = CmResourceTypePort) and ( resource->Flags & CM_RESOURCE_PORT_IO == 1 ) . So , as the guidance, I don’t need to use “MmmapIOSpace” to map the I/O to memory .
If that condition is true, then you should not use MmMapIoSpace.
>? ???However, when I used “READ_PORT_BUFFER_ULONG” at the I/O address,
> The returning result is not correct ( I check with RW Everything software).
> # I’m sure that the address of IO area in the command is correct with
> the display in Device Manager ( Resource / IO range)
How large is your I/O region, and how many dwords are you reading?
READ_PORT_BUFFER_ULONG uses incrementing addresses.? That is, if your
I/O port is at 0x4000 and you read 4 dwords, it will read from 0x4000,
then 0x4004, then 0x4008, then 0x400C.? That’s not usually how I/O port
ranges work.? If you need to read 4 dwords from the I/O port at 0x4000,
then you need to use READ_PORT_ULONG in a loop.
> # But when I use “MmmapIOSpace” to map the I/O area to memory and
> using “READ_REGISTER_BUFFER_ULONG” . Then the returning value is correct.
Did you print the address you get from MmMapIoSpace?? Is it actually a
kernel address? Port addresses are small (below 0x10000).
> for (ULONG i = 0; i < nres; ++i, ++resource)
>???{
>???switch (resource->Type)
>? ???{
>???case CmResourceTypePort:
>?
>? ???portbase = resource->u.Port.Start;
>? ???pdx->nports = resource->u.Port.Length;
>?
>? ???pdx->mappedport =
>? ? ? (resource->Flags & CM_RESOURCE_PORT_IO) == 0;
Are you actually seeing CM_RESOURCE_PORT_MEMORY here?? If so, Igor is
right and I owe him an apology, but I’d be curious to know about your
hardware.? <
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
—
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