-
Gadget Driver
-
The lower boundary of this driver implements hardware-neutralUSB functions, using calls to the controller driver.Because such hardware varies widely in capabilities and restrictions,and is used in embedded environments where space is at a premium,the gadget driver is often configured at compile timeto work with endpoints supported by one particular controller.Gadget drivers may be portable to several different controllers,using conditional compilation.(Recent kernels substantially simplify the work involved insupporting new hardware, by autoconfiguringendpoints automatically for many bulk-oriented drivers.)Gadget driver responsibilities include:
-
handling setup requests (ep0 protocol responses)possibly including class-specific functionality
-
returning configuration and string descriptors
-
(re)setting configurations and interfacealtsettings, including enabling and configuring endpoints
-
handling life cycle events, such as managingbindings to hardware,USB suspend/resume, remote wakeup,and disconnection from the USB host.
-
managing IN and OUT transfers on all currentlyenabled endpoints
Such drivers may be modules of proprietary code, althoughthat approach is discouraged in the Linux community.
-