Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memory Mapped register read/write on USB device

12 views
Skip to first unread message

ravis

unread,
Nov 27, 2009, 6:46:57 AM11/27/09
to
Hi,

Is it possible to access USB device registers through memory mapped
I/
O.


The windows miniport driver for USB WLAN card that I have uses bulk
read/write operations to access USB device's registers, which is very
slow and doesn't take constant time. On the other hand the driver
written for CardBus WLAN card uses memory mapped I/O access CardBus
device register ,which is very fast. I want to access USB registers
in
negligible and constant time (in order of 1/2 microseconds) is there
a
way to do this or can we use memory mapped register I/O on USB
platform?


Thanks in advance.


- Ravi


Maxim S. Shatskih

unread,
Nov 27, 2009, 10:43:59 AM11/27/09
to
> Is it possible to access USB device registers through memory mapped
> I/
> O.

Surely no.

USB bus is driven by the host controller, not by the CPU. It does not have the usual CPU-to-devices notions like "IO ports" or "memory-mapped IO".

You can only access USB by sending commands to the USB HC. Since this is a complicated DMA based device, MS provided the code to program it with the OS, and what you do is just send requests to this MS's code.

There is some hack in the USB HC which intercepts port 0x60 at boot to fully emulate the USB keyboard as PS/2 one, but this is specific to the keyboard (and early boot stages) and is not generic.

> The windows miniport driver for USB WLAN card that I have uses bulk
> read/write operations to access USB device's registers, which is very
> slow

This is not slow, this is normal. Creation of the URB+IRP is neglectable amount of time.

>and doesn't take constant time.

This is normal. Ethernet is not realtime anyway.

> written for CardBus WLAN card uses memory mapped I/O access CardBus
> device register ,which is very fast.

Yes, register access is fast, but the overall data transfer rate should be nearly the same.

>I want to access USB registers

There is no such thing as "USB registers" in the USB WLAN device.

> negligible and constant time (in order of 1/2 microseconds) is there

No ways. More so - I do not think that with Windows and PC, you can guarantee this small latency of hardware access _for any hardware device_.

--
Maxim S. Shatskih
Windows DDK MVP
ma...@storagecraft.com
http://www.storagecraft.com

0 new messages