* A patch against Linus' latest 2.5.63 tree (~144 KBytes)
* PDF for its kerneldoc output (~270 KBytes)
Based on some feedback, "Gadget Zero" now uses BSD-or-GPL licensing for clone-and-modify development, and that little bit of library code (to make USB string descriptors) now uses LGPL(-or-GPL). So product developers who want to tread very cautiously can still wade in this Linux pond.
- Dave
David Brownell wrote:
I've gotten a few requests for more information, so here's an update in three parts:
* A URL, to use for further information:
http://kernel.bkbits.net/~david-b/
* BK repository, currently 2.5.62 plus gadget support:
bk://kernel.bkbits.net/david-b/linux/gadget-2.5
This has the API, and the "Gadget Zero" implementation that I posted last week. Feel free to send me patches. (The code there is slightly updated from what I've posted to this list already.)
* Appended here, the part that makes it all runnable: a USB simulator that currently handles bulk and control traffic: "dummy_hcd.c". It should help to clear up some questions that may come up if you're just reading the API spec and/or gadget zero code.
Pretty much anyone that can configure a kernel to run USB can configure it to use that simulator. One way to use it:
# modprobe usbcore # modprobe dummy_hcd # mount -t usbfs usb /proc/bus/usb # modprobe g_zero # lsusb ... shows root hub and gadget zero high speed configs # cat /proc/bus/usb/devices ... does the same, but omits some string descriptors #
If you've configured the "usbtest" driver, it'll hotplug and bind to that device, and works in the testing harness:
# testusb -a ... runs all the standard regression tests #
Or it "should" work with usb-skeleton, but I've not made time to try.
Interesting things you could do with the code that's there already (possibly with the aid of UML) include:
* Read the code to understand more of how USB gadgets work inside, or how the API components interact.
* Bugfix other parts of the USB stack. I tried changing to the loopback config the other day (not yet usable) and then got an oops out of usbcore when reading the /proc/bus/usb/devices file. (Maybe Oliver's patch can help fix those problems...)
* Provide new gadget drivers. Many of them need nothing beyond control and bulk: networking, storage, HID, and more. They can be tested so long as there's a host-side Linux driver for such gadgets, which will reduce the debug time that needs "real hardware".
* Improve the simulator. It doesn't know about data toggle yet, its emulation of bandwidth constraints is messy (may not even work if HZ < 1000), there's no real support for periodic transactions (though interrupts at period 1 msec may act ok), and it only supports a single device.
* Add drivers for new USB peripheral device controllers. One for the PXA-250 would be particularly good to have; a lot of PDAs will be using that one, and it's got enough endpoints to be interesting.
This framework is still in early stages -- it can/should evolve -- but it's now in an interesting and usable state. ...
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
