LWN.net Logo

The USB Gadget driver framework

David Brownell has sent out an announcement regarding the availability of the new USB "gadget" API. The Linux kernel has long had support for USB host controllers - the subsystem which lets the kernel drive attached USB devices. But what if Linux is running inside the device itself? Implementing the USB protocol is a very different job when you're approaching it from the other end of the bus, and the current in-kernel USB implementation will not be particularly helpful.

Thus this announcement. The chosen terminology calls attached devices "gadgets," which need a gadget driver to make them work. (The USB standard, instead, calls gadgets "devices," but reusing the term "device driver" in this context would lead only to confusion). The new gadget implementation supports the NetChip 2280 controller, and comes with a couple of drivers: "gadget zero" (a skeleton example driver) and a network driver. There's also a dummy controller driver, allowing gadget development to be done in the absence of real hardware (and, perhaps, on a more friendly development platform).

The project has reached the point where it needs to get more people involved writing drivers. The substrate is there, so a lot of the hard decisions have been made, but the actual implementation for various hardware controllers and gadget classes is missing. This could be a fun area of development for people who would like to get into kernel programming.


(Log in to post comments)

The USB Gadget driver framework

Posted Apr 3, 2003 17:38 UTC (Thu) by cpeterso (guest, #305) [Link]

I don't think their introduction of USB "gadgets" clears up any confusion. The choice of device driver or gadget driver is arbitrary. You could imagine a gadget driver being either the host computer or USB device. They need to keep searching for clearer names.

The USB Gadget driver framework

Posted Apr 3, 2003 19:30 UTC (Thu) by iabervon (subscriber, #722) [Link]

They chose "gadget driver" primarily because it wasn't the same phrase as "device driver", and everybody knows what a device driver is, since the kernel has tons of them. Personally, I now think they should have kept "device" the same, and changed "driver" to "engine" (or maybe "passenger"), as the bit of the other end of the interaction. That is, the "device engine" would be the bit that makes something the sort of thing that a "device driver" can drive.

The USB Gadget driver framework

Posted Apr 5, 2003 3:49 UTC (Sat) by Peter (guest, #1127) [Link]

I don't think their introduction of USB "gadgets" clears up any confusion.

I don't like it either.

When this question came up on linux-kernel several months ago, quite a few names were suggested. The one I liked was "target". Anyone who has ever configured a SCSI bus will know what a target is and how it is different from a host. And anyone who hasn't configured a SCSI bus probably doesn't need to know the difference. (:

The USB Gadget driver framework

Posted Apr 6, 2003 9:48 UTC (Sun) by bradh (guest, #2274) [Link]

David Brownell wrote it, he gets to call it what he likes.

Gadget is just as arbitrary as "device driver" - you only know what it is
from experience, and that will build.

The USB Gadget driver framework

Posted Apr 10, 2003 6:53 UTC (Thu) by HalfMoon (guest, #3211) [Link]

Actually ... Greg KH is the one who chose that name among the alternatives. I kind of like the "target", or "slave", terminology better myself ...

Linus was the one who insisted they not be called "device" drivers.

"gadget driver," etc.

Posted Apr 5, 2003 3:54 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

Yeah, "target." But also "engine" (or something) instead of "driver." I just don't see what this software does as driving something. target engine.

Copyright © 2003, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds