I've dropped the linux-kernel list off this. If someone thinks it should
still be on that list, appologies.
Alan Cox writes:
> Even if not you can hash by page number not low bits so the hash is way
> smaller. You (in most cases) can also write the entry number in the relevant
> tables onto the end of the object in spare space (or in front of it)
>
> Something as trivial as
>
> struct usb_thingy
> {
> u32 thing_id;
> u32 flags;
> struct usb_thingy *next;
> #ifndef __LP64__
> u32 pad
> #endif
> struct usb_controller_goo goo;
> }
The following is from memory since I lost my partially converted OHCI
driver ;( Note also that my understanding of OHCI may be flawed.
Appologies in advance if the following has already been mentioned.
When I looked at the OHCI driver stuff, this is exactly what I did, and
it worked generally fine for tracking the CPU + DMA addresses of items
which the CPU has control over.
When we hand certain `thingy's over to the USB controller (as a linked
list of `thingy's), the USB controller uses the DMA pointers to manipulate
the list. Once it has processed the list, then you get back another
list of `thingy's. My understanding is that the USB controller doesn't
have to complete the requests in any particular order (is that true?),
and therefore your `goo' will be wrong once the USB controller has
processed the `thingy'. IIRC, the USB controllers idea of the "head" of
the processed `thingy's is a DMA address as well.
Therefore the only thing that you have to go on is a DMA address and
nothing else. You can't maintain your own lists.
Again, this is from memory of 2 months ago. Things may have moved on and
this problem doesn't exist, but I doubt that from the discussions that
have been made recently about hash tables.
--
Russell King ([EMAIL PROTECTED]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel