sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}(hhparenthuba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget)/translations/zh_CN/driver-api/usb/gadgetmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}(hhhh2ubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/zh_TW/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}(hhhhFubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/it_IT/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}(hhhhZubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ja_JP/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}(hhhhnubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ko_KR/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}(hhhhubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/sp_SP/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hUSB Gadget API for Linuxh]hUSB Gadget API for Linux}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhC/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget.rsthKubh field_list)}(hhh](hfield)}(hhh](h field_name)}(hAuthorh]hAuthor}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(hDavid Brownellh]h paragraph)}(hhh]hDavid Brownell}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hDateh]hDate}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh)}(h20 August 2004 h]h)}(h20 August 2004h]h20 August 2004}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Introductionh]h Introduction}(hj,hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhK ubh)}(hXKThis document presents a Linux-USB "Gadget" kernel mode API, for use within peripherals and other USB devices that embed Linux. It provides an overview of the API structure, and shows how that fits into a system development project. This is the first such API released on Linux to address a number of important problems, including:h]hXOThis document presents a Linux-USB “Gadget” kernel mode API, for use within peripherals and other USB devices that embed Linux. It provides an overview of the API structure, and shows how that fits into a system development project. This is the first such API released on Linux to address a number of important problems, including:}(hj:hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hj'hhubh bullet_list)}(hhh](h list_item)}(hfSupports USB 2.0, for high speed devices which can stream data at several dozen megabytes per second. h]h)}(heSupports USB 2.0, for high speed devices which can stream data at several dozen megabytes per second.h]heSupports USB 2.0, for high speed devices which can stream data at several dozen megabytes per second.}(hjShjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjMubah}(h]h ]h"]h$]h&]uh1jKhjHhhhhhNubjL)}(hHandles devices with dozens of endpoints just as well as ones with just two fixed-function ones. Gadget drivers can be written so they're easy to port to new hardware. h]h)}(hHandles devices with dozens of endpoints just as well as ones with just two fixed-function ones. Gadget drivers can be written so they're easy to port to new hardware.h]hHandles devices with dozens of endpoints just as well as ones with just two fixed-function ones. Gadget drivers can be written so they’re easy to port to new hardware.}(hjkhjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjeubah}(h]h ]h"]h$]h&]uh1jKhjHhhhhhNubjL)}(hFlexible enough to expose more complex USB device capabilities such as multiple configurations, multiple interfaces, composite devices, and alternate interface settings. h]h)}(hFlexible enough to expose more complex USB device capabilities such as multiple configurations, multiple interfaces, composite devices, and alternate interface settings.h]hFlexible enough to expose more complex USB device capabilities such as multiple configurations, multiple interfaces, composite devices, and alternate interface settings.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}ubah}(h]h ]h"]h$]h&]uh1jKhjHhhhhhNubjL)}(hWUSB "On-The-Go" (OTG) support, in conjunction with updates to the Linux-USB host side. h]h)}(hVUSB "On-The-Go" (OTG) support, in conjunction with updates to the Linux-USB host side.h]hZUSB “On-The-Go” (OTG) support, in conjunction with updates to the Linux-USB host side.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jKhjHhhhhhNubjL)}(hSharing data structures and API models with the Linux-USB host side API. This helps the OTG support, and looks forward to more-symmetric frameworks (where the same I/O model is used by both host and device side drivers). h]h)}(hSharing data structures and API models with the Linux-USB host side API. This helps the OTG support, and looks forward to more-symmetric frameworks (where the same I/O model is used by both host and device side drivers).h]hSharing data structures and API models with the Linux-USB host side API. This helps the OTG support, and looks forward to more-symmetric frameworks (where the same I/O model is used by both host and device side drivers).}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jKhjHhhhhhNubjL)}(hMinimalist, so it's easier to support new device controller hardware. I/O processing doesn't imply large demands for memory or CPU resources. h]h)}(hMinimalist, so it's easier to support new device controller hardware. I/O processing doesn't imply large demands for memory or CPU resources.h]hMinimalist, so it’s easier to support new device controller hardware. I/O processing doesn’t imply large demands for memory or CPU resources.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjubah}(h]h ]h"]h$]h&]uh1jKhjHhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1jFhhhKhj'hhubh)}(hXSMost Linux developers will not be able to use this API, since they have USB ``host`` hardware in a PC, workstation, or server. Linux users with embedded systems are more likely to have USB peripheral hardware. To distinguish drivers running inside such hardware from the more familiar Linux "USB device drivers", which are host side proxies for the real USB devices, a different term is used: the drivers inside the peripherals are "USB gadget drivers". In USB protocol interactions, the device driver is the master (or "client driver") and the gadget driver is the slave (or "function driver").h](hLMost Linux developers will not be able to use this API, since they have USB }(hLMost Linux developers will not be able to use this API, since they have USB hjhhhNhNubhliteral)}(h``host``h]hhost}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX hardware in a PC, workstation, or server. Linux users with embedded systems are more likely to have USB peripheral hardware. To distinguish drivers running inside such hardware from the more familiar Linux “USB device drivers”, which are host side proxies for the real USB devices, a different term is used: the drivers inside the peripherals are “USB gadget drivers”. In USB protocol interactions, the device driver is the master (or “client driver”) and the gadget driver is the slave (or “function driver”).}(hX hardware in a PC, workstation, or server. Linux users with embedded systems are more likely to have USB peripheral hardware. To distinguish drivers running inside such hardware from the more familiar Linux "USB device drivers", which are host side proxies for the real USB devices, a different term is used: the drivers inside the peripherals are "USB gadget drivers". In USB protocol interactions, the device driver is the master (or "client driver") and the gadget driver is the slave (or "function driver").hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK(hj'hhubh)}(hXThe gadget API resembles the host side Linux-USB API in that both use queues of request objects to package I/O buffers, and those requests may be submitted or canceled. They share common definitions for the standard USB *Chapter 9* messages, structures, and constants. Also, both APIs bind and unbind drivers to devices. The APIs differ in detail, since the host side's current URB framework exposes a number of implementation details and assumptions that are inappropriate for a gadget API. While the model for control transfers and configuration management is necessarily different (one side is a hardware-neutral master, the other is a hardware-aware slave), the endpoint I/0 API used here should also be usable for an overhead-reduced host side API.h](hThe gadget API resembles the host side Linux-USB API in that both use queues of request objects to package I/O buffers, and those requests may be submitted or canceled. They share common definitions for the standard USB }(hThe gadget API resembles the host side Linux-USB API in that both use queues of request objects to package I/O buffers, and those requests may be submitted or canceled. They share common definitions for the standard USB hj hhhNhNubhemphasis)}(h *Chapter 9*h]h Chapter 9}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhX  messages, structures, and constants. Also, both APIs bind and unbind drivers to devices. The APIs differ in detail, since the host side’s current URB framework exposes a number of implementation details and assumptions that are inappropriate for a gadget API. While the model for control transfers and configuration management is necessarily different (one side is a hardware-neutral master, the other is a hardware-aware slave), the endpoint I/0 API used here should also be usable for an overhead-reduced host side API.}(hX  messages, structures, and constants. Also, both APIs bind and unbind drivers to devices. The APIs differ in detail, since the host side's current URB framework exposes a number of implementation details and assumptions that are inappropriate for a gadget API. While the model for control transfers and configuration management is necessarily different (one side is a hardware-neutral master, the other is a hardware-aware slave), the endpoint I/0 API used here should also be usable for an overhead-reduced host side API.hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK2hj'hhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hStructure of Gadget Driversh]hStructure of Gadget Drivers}(hj:hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hhhhhK?ubh)}(hX'A system running inside a USB peripheral normally has at least three layers inside the kernel to handle USB protocol processing, and may have additional layers in user space code. The ``gadget`` API is used by the middle layer to interact with the lowest level (which directly handles hardware).h](hA system running inside a USB peripheral normally has at least three layers inside the kernel to handle USB protocol processing, and may have additional layers in user space code. The }(hA system running inside a USB peripheral normally has at least three layers inside the kernel to handle USB protocol processing, and may have additional layers in user space code. The hjFhhhNhNubj)}(h ``gadget``h]hgadget}(hhhjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjFubhe API is used by the middle layer to interact with the lowest level (which directly handles hardware).}(he API is used by the middle layer to interact with the lowest level (which directly handles hardware).hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKAhj5hhubh)}(h/In Linux, from the bottom up, these layers are:h]h/In Linux, from the bottom up, these layers are:}(hjjhjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhj5hhubhdefinition_list)}(hhh](hdefinition_list_item)}(hX*USB Controller Driver* This is the lowest software level. It is the only layer that talks to hardware, through registers, fifos, dma, irqs, and the like. The ```` API abstracts the peripheral controller endpoint hardware. That hardware is exposed through endpoint objects, which accept streams of IN/OUT buffers, and through callbacks that interact with gadget drivers. Since normal USB devices only have one upstream port, they only have one of these drivers. The controller driver can support any number of different gadget drivers, but only one of them can be used at a time. Examples of such controller hardware include the PCI-based NetChip 2280 USB 2.0 high speed controller, the SA-11x0 or PXA-25x UDC (found within many PDAs), and a variety of other products. h](hterm)}(h*USB Controller Driver*h]j)}(hjh]hUSB Controller Driver}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKVhj}ubh definition)}(hhh](h)}(hX?This is the lowest software level. It is the only layer that talks to hardware, through registers, fifos, dma, irqs, and the like. The ```` API abstracts the peripheral controller endpoint hardware. That hardware is exposed through endpoint objects, which accept streams of IN/OUT buffers, and through callbacks that interact with gadget drivers. Since normal USB devices only have one upstream port, they only have one of these drivers. The controller driver can support any number of different gadget drivers, but only one of them can be used at a time.h](hThis is the lowest software level. It is the only layer that talks to hardware, through registers, fifos, dma, irqs, and the like. The }(hThis is the lowest software level. It is the only layer that talks to hardware, through registers, fifos, dma, irqs, and the like. The hjhhhNhNubj)}(h````h]h}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX API abstracts the peripheral controller endpoint hardware. That hardware is exposed through endpoint objects, which accept streams of IN/OUT buffers, and through callbacks that interact with gadget drivers. Since normal USB devices only have one upstream port, they only have one of these drivers. The controller driver can support any number of different gadget drivers, but only one of them can be used at a time.}(hX API abstracts the peripheral controller endpoint hardware. That hardware is exposed through endpoint objects, which accept streams of IN/OUT buffers, and through callbacks that interact with gadget drivers. Since normal USB devices only have one upstream port, they only have one of these drivers. The controller driver can support any number of different gadget drivers, but only one of them can be used at a time.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKJhjubh)}(hExamples of such controller hardware include the PCI-based NetChip 2280 USB 2.0 high speed controller, the SA-11x0 or PXA-25x UDC (found within many PDAs), and a variety of other products.h]hExamples of such controller hardware include the PCI-based NetChip 2280 USB 2.0 high speed controller, the SA-11x0 or PXA-25x UDC (found within many PDAs), and a variety of other products.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjubeh}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1j{hhhKVhjxubj|)}(hX*Gadget Driver* The lower boundary of this driver implements hardware-neutral USB 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 time to 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 in supporting new hardware, by *autoconfiguring* endpoints 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 interface altsettings, including enabling and configuring endpoints - handling life cycle events, such as managing bindings to hardware, USB suspend/resume, remote wakeup, and disconnection from the USB host. - managing IN and OUT transfers on all currently enabled endpoints Such drivers may be modules of proprietary code, although that approach is discouraged in the Linux community. h](j)}(h*Gadget Driver*h]j)}(hjh]h Gadget Driver}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKthjubj)}(hhh](h)}(hXThe lower boundary of this driver implements hardware-neutral USB 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 time to 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 in supporting new hardware, by *autoconfiguring* endpoints automatically for many bulk-oriented drivers.) Gadget driver responsibilities include:h](hX(The lower boundary of this driver implements hardware-neutral USB 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 time to 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 in supporting new hardware, by }(hX(The lower boundary of this driver implements hardware-neutral USB 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 time to 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 in supporting new hardware, by hjhhhNhNubj)}(h*autoconfiguring*h]hautoconfiguring}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubha endpoints automatically for many bulk-oriented drivers.) Gadget driver responsibilities include:}(ha endpoints automatically for many bulk-oriented drivers.) Gadget driver responsibilities include:hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKYhjubjG)}(hhh](jL)}(hahandling setup requests (ep0 protocol responses) possibly including class-specific functionality h]h)}(h`handling setup requests (ep0 protocol responses) possibly including class-specific functionalityh]h`handling setup requests (ep0 protocol responses) possibly including class-specific functionality}(hj$hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(h/returning configuration and string descriptors h]h)}(h.returning configuration and string descriptorsh]h.returning configuration and string descriptors}(hj<hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhj6ubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hc(re)setting configurations and interface altsettings, including enabling and configuring endpoints h]h)}(hb(re)setting configurations and interface altsettings, including enabling and configuring endpointsh]hb(re)setting configurations and interface altsettings, including enabling and configuring endpoints}(hjThjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjNubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hhandling life cycle events, such as managing bindings to hardware, USB suspend/resume, remote wakeup, and disconnection from the USB host. h]h)}(hhandling life cycle events, such as managing bindings to hardware, USB suspend/resume, remote wakeup, and disconnection from the USB host.h]hhandling life cycle events, such as managing bindings to hardware, USB suspend/resume, remote wakeup, and disconnection from the USB host.}(hjlhjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjfubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hAmanaging IN and OUT transfers on all currently enabled endpoints h]h)}(h@managing IN and OUT transfers on all currently enabled endpointsh]h@managing IN and OUT transfers on all currently enabled endpoints}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhj~ubah}(h]h ]h"]h$]h&]uh1jKhjubeh}(h]h ]h"]h$]h&]jjuh1jFhhhKehjubh)}(hnSuch drivers may be modules of proprietary code, although that approach is discouraged in the Linux community.h]hnSuch drivers may be modules of proprietary code, although that approach is discouraged in the Linux community.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKthjxhhubj|)}(hX*Upper Level* Most gadget drivers have an upper boundary that connects to some Linux driver or framework in Linux. Through that boundary flows the data which the gadget driver produces and/or consumes through protocol transfers over USB. Examples include: - user mode code, using generic (gadgetfs) or application specific files in ``/dev`` - networking subsystem (for network gadgets, like the CDC Ethernet Model gadget driver) - data capture drivers, perhaps video4Linux or a scanner driver; or test and measurement hardware. - input subsystem (for HID gadgets) - sound subsystem (for audio gadgets) - file system (for PTP gadgets) - block i/o subsystem (for usb-storage gadgets) - ... and more h](j)}(h *Upper Level*h]j)}(hjh]h Upper Level}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh](h)}(hMost gadget drivers have an upper boundary that connects to some Linux driver or framework in Linux. Through that boundary flows the data which the gadget driver produces and/or consumes through protocol transfers over USB. Examples include:h]hMost gadget drivers have an upper boundary that connects to some Linux driver or framework in Linux. Through that boundary flows the data which the gadget driver produces and/or consumes through protocol transfers over USB. Examples include:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubjG)}(hhh](jL)}(hSuser mode code, using generic (gadgetfs) or application specific files in ``/dev`` h]h)}(hRuser mode code, using generic (gadgetfs) or application specific files in ``/dev``h](hJuser mode code, using generic (gadgetfs) or application specific files in }(hJuser mode code, using generic (gadgetfs) or application specific files in hjhhhNhNubj)}(h``/dev``h]h/dev}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhK|hjubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hVnetworking subsystem (for network gadgets, like the CDC Ethernet Model gadget driver) h]h)}(hUnetworking subsystem (for network gadgets, like the CDC Ethernet Model gadget driver)h]hUnetworking subsystem (for network gadgets, like the CDC Ethernet Model gadget driver)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hadata capture drivers, perhaps video4Linux or a scanner driver; or test and measurement hardware. h]h)}(h`data capture drivers, perhaps video4Linux or a scanner driver; or test and measurement hardware.h]h`data capture drivers, perhaps video4Linux or a scanner driver; or test and measurement hardware.}(hj*hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj$ubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(h"input subsystem (for HID gadgets) h]h)}(h!input subsystem (for HID gadgets)h]h!input subsystem (for HID gadgets)}(hjBhj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj<ubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(h$sound subsystem (for audio gadgets) h]h)}(h#sound subsystem (for audio gadgets)h]h#sound subsystem (for audio gadgets)}(hjZhjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjTubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hfile system (for PTP gadgets) h]h)}(hfile system (for PTP gadgets)h]hfile system (for PTP gadgets)}(hjrhjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjlubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(h.block i/o subsystem (for usb-storage gadgets) h]h)}(h-block i/o subsystem (for usb-storage gadgets)h]h-block i/o subsystem (for usb-storage gadgets)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(h ... and more h]h)}(h ... and moreh]h ... and more}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jKhjubeh}(h]h ]h"]h$]h&]jjuh1jFhhhK|hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjxhhubj|)}(hX*Additional Layers* Other layers may exist. These could include kernel layers, such as network protocol stacks, as well as user mode applications building on standard POSIX system call APIs such as ``open()``, ``close()``, ``read()`` and ``write()``. On newer systems, POSIX Async I/O calls may be an option. Such user mode code will not necessarily be subject to the GNU General Public License (GPL). h](j)}(h*Additional Layers*h]j)}(hjh]hAdditional Layers}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hX}Other layers may exist. These could include kernel layers, such as network protocol stacks, as well as user mode applications building on standard POSIX system call APIs such as ``open()``, ``close()``, ``read()`` and ``write()``. On newer systems, POSIX Async I/O calls may be an option. Such user mode code will not necessarily be subject to the GNU General Public License (GPL).h](hOther layers may exist. These could include kernel layers, such as network protocol stacks, as well as user mode applications building on standard POSIX system call APIs such as }(hOther layers may exist. These could include kernel layers, such as network protocol stacks, as well as user mode applications building on standard POSIX system call APIs such as hjhhhNhNubj)}(h ``open()``h]hopen()}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(h, hjhhhNhNubj)}(h ``close()``h]hclose()}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(h, hjhhhNhNubj)}(h ``read()``h]hread()}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(h and hjhhhNhNubj)}(h ``write()``h]hwrite()}(hhhj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. On newer systems, POSIX Async I/O calls may be an option. Such user mode code will not necessarily be subject to the GNU General Public License (GPL).}(h. On newer systems, POSIX Async I/O calls may be an option. Such user mode code will not necessarily be subject to the GNU General Public License (GPL).hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjxhhubeh}(h]h ]h"]h$]h&]uh1jvhj5hhhhhNubh)}(hXoOTG-capable systems will also need to include a standard Linux-USB host side stack, with ``usbcore``, one or more *Host Controller Drivers* (HCDs), *USB Device Drivers* to support the OTG "Targeted Peripheral List", and so forth. There will also be an *OTG Controller Driver*, which is visible to gadget and device driver developers only indirectly. That helps the host and device side USB controllers implement the two new OTG protocols (HNP and SRP). Roles switch (host to peripheral, or vice versa) using HNP during USB suspend processing, and SRP can be viewed as a more battery-friendly kind of device wakeup protocol.h](hYOTG-capable systems will also need to include a standard Linux-USB host side stack, with }(hYOTG-capable systems will also need to include a standard Linux-USB host side stack, with hjQhhhNhNubj)}(h ``usbcore``h]husbcore}(hhhjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh, one or more }(h, one or more hjQhhhNhNubj)}(h*Host Controller Drivers*h]hHost Controller Drivers}(hhhjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh (HCDs), }(h (HCDs), hjQhhhNhNubj)}(h*USB Device Drivers*h]hUSB Device Drivers}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubhX to support the OTG “Targeted Peripheral List”, and so forth. There will also be an }(hT to support the OTG "Targeted Peripheral List", and so forth. There will also be an hjQhhhNhNubj)}(h*OTG Controller Driver*h]hOTG Controller Driver}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubhX\, which is visible to gadget and device driver developers only indirectly. That helps the host and device side USB controllers implement the two new OTG protocols (HNP and SRP). Roles switch (host to peripheral, or vice versa) using HNP during USB suspend processing, and SRP can be viewed as a more battery-friendly kind of device wakeup protocol.}(hX\, which is visible to gadget and device driver developers only indirectly. That helps the host and device side USB controllers implement the two new OTG protocols (HNP and SRP). Roles switch (host to peripheral, or vice versa) using HNP during USB suspend processing, and SRP can be viewed as a more battery-friendly kind of device wakeup protocol.hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubh)}(hXOver time, reusable utilities are evolving to help make some gadget driver tasks simpler. For example, building configuration descriptors from vectors of descriptors for the configurations interfaces and endpoints is now automated, and many drivers now use autoconfiguration to choose hardware endpoints and initialize their descriptors. A potential example of particular interest is code implementing standard USB-IF protocols for HID, networking, storage, or audio classes. Some developers are interested in KDB or KGDB hooks, to let target hardware be remotely debugged. Most such USB protocol code doesn't need to be hardware-specific, any more than network protocols like X11, HTTP, or NFS are. Such gadget-side interface drivers should eventually be combined, to implement composite devices.h]hXOver time, reusable utilities are evolving to help make some gadget driver tasks simpler. For example, building configuration descriptors from vectors of descriptors for the configurations interfaces and endpoints is now automated, and many drivers now use autoconfiguration to choose hardware endpoints and initialize their descriptors. A potential example of particular interest is code implementing standard USB-IF protocols for HID, networking, storage, or audio classes. Some developers are interested in KDB or KGDB hooks, to let target hardware be remotely debugged. Most such USB protocol code doesn’t need to be hardware-specific, any more than network protocols like X11, HTTP, or NFS are. Such gadget-side interface drivers should eventually be combined, to implement composite devices.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubeh}(h]structure-of-gadget-driversah ]h"]structure of gadget driversah$]h&]uh1hhhhhhhhK?ubh)}(hhh](h)}(hKernel Mode Gadget APIh]hKernel Mode Gadget API}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXGadget drivers declare themselves through a struct :c:type:`usb_gadget_driver`, which is responsible for most parts of enumeration for a struct usb_gadget. The response to a set_configuration usually involves enabling one or more of the struct usb_ep objects exposed by the gadget, and submitting one or more struct usb_request buffers to transfer data. Understand those four data types, and their operations, and you will understand how this API works.h](h3Gadget drivers declare themselves through a struct }(h3Gadget drivers declare themselves through a struct hjhhhNhNubh)}(h:c:type:`usb_gadget_driver`h]j)}(hjh]husb_gadget_driver}(hhhjhhhNhNubah}(h]h ](xrefcc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocdriver-api/usb/gadget refdomainjreftypetype refexplicitrefwarn reftargetusb_gadget_driveruh1hhhhKhjubhXw, which is responsible for most parts of enumeration for a struct usb_gadget. The response to a set_configuration usually involves enabling one or more of the struct usb_ep objects exposed by the gadget, and submitting one or more struct usb_request buffers to transfer data. Understand those four data types, and their operations, and you will understand how this API works.}(hXw, which is responsible for most parts of enumeration for a struct usb_gadget. The response to a set_configuration usually involves enabling one or more of the struct usb_ep objects exposed by the gadget, and submitting one or more struct usb_request buffers to transfer data. Understand those four data types, and their operations, and you will understand how this API works.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubhnote)}(hX;Other than the "Chapter 9" data types, most of the significant data types and functions are described here. However, some relevant information is likely omitted from what you are reading. One example of such information is endpoint autoconfiguration. You'll have to read the header file, and use example source code (such as that for "Gadget Zero"), to fully understand the API. The part of the API implementing some basic driver capabilities is specific to the version of the Linux kernel that's in use. The 2.6 and upper kernel versions include a *driver model* framework that has no analogue on earlier kernels; so those parts of the gadget API are not fully portable. (They are implemented on 2.4 kernels, but in a different way.) The driver model state is another part of this API that is ignored by the kerneldoc tools.h](h)}(hkOther than the "Chapter 9" data types, most of the significant data types and functions are described here.h]hoOther than the “Chapter 9” data types, most of the significant data types and functions are described here.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hXHowever, some relevant information is likely omitted from what you are reading. One example of such information is endpoint autoconfiguration. You'll have to read the header file, and use example source code (such as that for "Gadget Zero"), to fully understand the API.h]hXHowever, some relevant information is likely omitted from what you are reading. One example of such information is endpoint autoconfiguration. You’ll have to read the header file, and use example source code (such as that for “Gadget Zero”), to fully understand the API.}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hXThe part of the API implementing some basic driver capabilities is specific to the version of the Linux kernel that's in use. The 2.6 and upper kernel versions include a *driver model* framework that has no analogue on earlier kernels; so those parts of the gadget API are not fully portable. (They are implemented on 2.4 kernels, but in a different way.) The driver model state is another part of this API that is ignored by the kerneldoc tools.h](hThe part of the API implementing some basic driver capabilities is specific to the version of the Linux kernel that’s in use. The 2.6 and upper kernel versions include a }(hThe part of the API implementing some basic driver capabilities is specific to the version of the Linux kernel that's in use. The 2.6 and upper kernel versions include a hj,hhhNhNubj)}(h*driver model*h]h driver model}(hhhj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubhX framework that has no analogue on earlier kernels; so those parts of the gadget API are not fully portable. (They are implemented on 2.4 kernels, but in a different way.) The driver model state is another part of this API that is ignored by the kerneldoc tools.}(hX framework that has no analogue on earlier kernels; so those parts of the gadget API are not fully portable. (They are implemented on 2.4 kernels, but in a different way.) The driver model state is another part of this API that is ignored by the kerneldoc tools.hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubeh}(h]h ]h"]h$]h&]uh1j hjhhhhhNubh)}(hX The core API does not expose every possible hardware feature, only the most widely available ones. There are significant hardware features, such as device-to-device DMA (without temporary storage in a memory buffer) that would be added using hardware-specific APIs.h]hX The core API does not expose every possible hardware feature, only the most widely available ones. There are significant hardware features, such as device-to-device DMA (without temporary storage in a memory buffer) that would be added using hardware-specific APIs.}(hjVhjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXGThis API allows drivers to use conditional compilation to handle endpoint capabilities of different hardware, but doesn't require that. Hardware tends to have arbitrary restrictions, relating to transfer types, addressing, packet sizes, buffering, and availability. As a rule, such differences only matter for "endpoint zero" logic that handles device configuration and management. The API supports limited run-time detection of capabilities, through naming conventions for endpoints. Many drivers will be able to at least partially autoconfigure themselves. In particular, driver init sections will often have endpoint autoconfiguration logic that scans the hardware's list of endpoints to find ones matching the driver requirements (relying on those conventions), to eliminate some of the most common reasons for conditional compilation.h]hXOThis API allows drivers to use conditional compilation to handle endpoint capabilities of different hardware, but doesn’t require that. Hardware tends to have arbitrary restrictions, relating to transfer types, addressing, packet sizes, buffering, and availability. As a rule, such differences only matter for “endpoint zero” logic that handles device configuration and management. The API supports limited run-time detection of capabilities, through naming conventions for endpoints. Many drivers will be able to at least partially autoconfigure themselves. In particular, driver init sections will often have endpoint autoconfiguration logic that scans the hardware’s list of endpoints to find ones matching the driver requirements (relying on those conventions), to eliminate some of the most common reasons for conditional compilation.}(hjdhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXLike the Linux-USB host side API, this API exposes the "chunky" nature of USB messages: I/O requests are in terms of one or more "packets", and packet boundaries are visible to drivers. Compared to RS-232 serial protocols, USB resembles synchronous protocols like HDLC (N bytes per frame, multipoint addressing, host as the primary station and devices as secondary stations) more than asynchronous ones (tty style: 8 data bits per frame, no parity, one stop bit). So for example the controller drivers won't buffer two single byte writes into a single two-byte USB IN packet, although gadget drivers may do so when they implement protocols where packet boundaries (and "short packets") are not significant.h]hXLike the Linux-USB host side API, this API exposes the “chunky” nature of USB messages: I/O requests are in terms of one or more “packets”, and packet boundaries are visible to drivers. Compared to RS-232 serial protocols, USB resembles synchronous protocols like HDLC (N bytes per frame, multipoint addressing, host as the primary station and devices as secondary stations) more than asynchronous ones (tty style: 8 data bits per frame, no parity, one stop bit). So for example the controller drivers won’t buffer two single byte writes into a single two-byte USB IN packet, although gadget drivers may do so when they implement protocols where packet boundaries (and “short packets”) are not significant.}(hjrhjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hDriver Life Cycleh]hDriver Life Cycle}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~hhhhhKubh)}(hGadget drivers make endpoint I/O requests to hardware without needing to know many details of the hardware, but driver setup/configuration code needs to handle some differences. Use the API like this:h]hGadget drivers make endpoint I/O requests to hardware without needing to know many details of the hardware, but driver setup/configuration code needs to handle some differences. Use the API like this:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj~hhubhenumerated_list)}(hhh](jL)}(hXRegister a driver for the particular device side usb controller hardware, such as the net2280 on PCI (USB 2.0), sa11x0 or pxa25x as found in Linux PDAs, and so on. At this point the device is logically in the USB ch9 initial state (``attached``), drawing no power and not usable (since it does not yet support enumeration). Any host should not see the device, since it's not activated the data line pullup used by the host to detect a device, even if VBUS power is available. h]h)}(hXRegister a driver for the particular device side usb controller hardware, such as the net2280 on PCI (USB 2.0), sa11x0 or pxa25x as found in Linux PDAs, and so on. At this point the device is logically in the USB ch9 initial state (``attached``), drawing no power and not usable (since it does not yet support enumeration). Any host should not see the device, since it's not activated the data line pullup used by the host to detect a device, even if VBUS power is available.h](hRegister a driver for the particular device side usb controller hardware, such as the net2280 on PCI (USB 2.0), sa11x0 or pxa25x as found in Linux PDAs, and so on. At this point the device is logically in the USB ch9 initial state (}(hRegister a driver for the particular device side usb controller hardware, such as the net2280 on PCI (USB 2.0), sa11x0 or pxa25x as found in Linux PDAs, and so on. At this point the device is logically in the USB ch9 initial state (hjhhhNhNubj)}(h ``attached``h]hattached}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh), drawing no power and not usable (since it does not yet support enumeration). Any host should not see the device, since it’s not activated the data line pullup used by the host to detect a device, even if VBUS power is available.}(h), drawing no power and not usable (since it does not yet support enumeration). Any host should not see the device, since it's not activated the data line pullup used by the host to detect a device, even if VBUS power is available.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hRegister a gadget driver that implements some higher level device function. That will then bind() to a :c:type:`usb_gadget`, which activates the data line pullup sometime after detecting VBUS. h]h)}(hRegister a gadget driver that implements some higher level device function. That will then bind() to a :c:type:`usb_gadget`, which activates the data line pullup sometime after detecting VBUS.h](hgRegister a gadget driver that implements some higher level device function. That will then bind() to a }(hgRegister a gadget driver that implements some higher level device function. That will then bind() to a hjhhhNhNubh)}(h:c:type:`usb_gadget`h]j)}(hjh]h usb_gadget}(hhhjhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnj usb_gadgetuh1hhhhKhjubhE, which activates the data line pullup sometime after detecting VBUS.}(hE, which activates the data line pullup sometime after detecting VBUS.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hXThe hardware driver can now start enumerating. The steps it handles are to accept USB ``power`` and ``set_address`` requests. Other steps are handled by the gadget driver. If the gadget driver module is unloaded before the host starts to enumerate, steps before step 7 are skipped. h]h)}(hXThe hardware driver can now start enumerating. The steps it handles are to accept USB ``power`` and ``set_address`` requests. Other steps are handled by the gadget driver. If the gadget driver module is unloaded before the host starts to enumerate, steps before step 7 are skipped.h](hVThe hardware driver can now start enumerating. The steps it handles are to accept USB }(hVThe hardware driver can now start enumerating. The steps it handles are to accept USB hjhhhNhNubj)}(h ``power``h]hpower}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(h and hjhhhNhNubj)}(h``set_address``h]h set_address}(hhhj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh requests. Other steps are handled by the gadget driver. If the gadget driver module is unloaded before the host starts to enumerate, steps before step 7 are skipped.}(h requests. Other steps are handled by the gadget driver. If the gadget driver module is unloaded before the host starts to enumerate, steps before step 7 are skipped.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hXPThe gadget driver's ``setup()`` call returns usb descriptors, based both on what the bus interface hardware provides and on the functionality being implemented. That can involve alternate settings or configurations, unless the hardware prevents such operation. For OTG devices, each configuration descriptor includes an OTG descriptor. h]h)}(hXOThe gadget driver's ``setup()`` call returns usb descriptors, based both on what the bus interface hardware provides and on the functionality being implemented. That can involve alternate settings or configurations, unless the hardware prevents such operation. For OTG devices, each configuration descriptor includes an OTG descriptor.h](hThe gadget driver’s }(hThe gadget driver's hjNhhhNhNubj)}(h ``setup()``h]hsetup()}(hhhjWhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubhX0 call returns usb descriptors, based both on what the bus interface hardware provides and on the functionality being implemented. That can involve alternate settings or configurations, unless the hardware prevents such operation. For OTG devices, each configuration descriptor includes an OTG descriptor.}(hX0 call returns usb descriptors, based both on what the bus interface hardware provides and on the functionality being implemented. That can involve alternate settings or configurations, unless the hardware prevents such operation. For OTG devices, each configuration descriptor includes an OTG descriptor.hjNhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjJubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hX)The gadget driver handles the last step of enumeration, when the USB host issues a ``set_configuration`` call. It enables all endpoints used in that configuration, with all interfaces in their default settings. That involves using a list of the hardware's endpoints, enabling each endpoint according to its descriptor. It may also involve using ``usb_gadget_vbus_draw`` to let more power be drawn from VBUS, as allowed by that configuration. For OTG devices, setting a configuration may also involve reporting HNP capabilities through a user interface. h]h)}(hX(The gadget driver handles the last step of enumeration, when the USB host issues a ``set_configuration`` call. It enables all endpoints used in that configuration, with all interfaces in their default settings. That involves using a list of the hardware's endpoints, enabling each endpoint according to its descriptor. It may also involve using ``usb_gadget_vbus_draw`` to let more power be drawn from VBUS, as allowed by that configuration. For OTG devices, setting a configuration may also involve reporting HNP capabilities through a user interface.h](hSThe gadget driver handles the last step of enumeration, when the USB host issues a }(hSThe gadget driver handles the last step of enumeration, when the USB host issues a hjzhhhNhNubj)}(h``set_configuration``h]hset_configuration}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjzubh call. It enables all endpoints used in that configuration, with all interfaces in their default settings. That involves using a list of the hardware’s endpoints, enabling each endpoint according to its descriptor. It may also involve using }(h call. It enables all endpoints used in that configuration, with all interfaces in their default settings. That involves using a list of the hardware's endpoints, enabling each endpoint according to its descriptor. It may also involve using hjzhhhNhNubj)}(h``usb_gadget_vbus_draw``h]husb_gadget_vbus_draw}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjzubh to let more power be drawn from VBUS, as allowed by that configuration. For OTG devices, setting a configuration may also involve reporting HNP capabilities through a user interface.}(h to let more power be drawn from VBUS, as allowed by that configuration. For OTG devices, setting a configuration may also involve reporting HNP capabilities through a user interface.hjzhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjvubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hXgDo real work and perform data transfers, possibly involving changes to interface settings or switching to new configurations, until the device is disconnect()ed from the host. Queue any number of transfer requests to each endpoint. It may be suspended and resumed several times before being disconnected. On disconnect, the drivers go back to step 3 (above). h]h)}(hXfDo real work and perform data transfers, possibly involving changes to interface settings or switching to new configurations, until the device is disconnect()ed from the host. Queue any number of transfer requests to each endpoint. It may be suspended and resumed several times before being disconnected. On disconnect, the drivers go back to step 3 (above).h]hXfDo real work and perform data transfers, possibly involving changes to interface settings or switching to new configurations, until the device is disconnect()ed from the host. Queue any number of transfer requests to each endpoint. It may be suspended and resumed several times before being disconnected. On disconnect, the drivers go back to step 3 (above).}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hWhen the gadget driver module is being unloaded, the driver unbind() callback is issued. That lets the controller driver be unloaded. h]h)}(hWhen the gadget driver module is being unloaded, the driver unbind() callback is issued. That lets the controller driver be unloaded.h]hWhen the gadget driver module is being unloaded, the driver unbind() callback is issued. That lets the controller driver be unloaded.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhj~hhhhhKubh)}(hXDrivers will normally be arranged so that just loading the gadget driver module (or statically linking it into a Linux kernel) allows the peripheral device to be enumerated, but some drivers will defer enumeration until some higher level component (like a user mode daemon) enables it. Note that at this lowest level there are no policies about how ep0 configuration logic is implemented, except that it should obey USB specifications. Such issues are in the domain of gadget drivers, including knowing about implementation constraints imposed by some USB controllers or understanding that composite devices might happen to be built by integrating reusable components.h]hXDrivers will normally be arranged so that just loading the gadget driver module (or statically linking it into a Linux kernel) allows the peripheral device to be enumerated, but some drivers will defer enumeration until some higher level component (like a user mode daemon) enables it. Note that at this lowest level there are no policies about how ep0 configuration logic is implemented, except that it should obey USB specifications. Such issues are in the domain of gadget drivers, including knowing about implementation constraints imposed by some USB controllers or understanding that composite devices might happen to be built by integrating reusable components.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~hhubh)}(hXNote that the lifecycle above can be slightly different for OTG devices. Other than providing an additional OTG descriptor in each configuration, only the HNP-related differences are particularly visible to driver code. They involve reporting requirements during the ``SET_CONFIGURATION`` request, and the option to invoke HNP during some suspend callbacks. Also, SRP changes the semantics of ``usb_gadget_wakeup`` slightly.h](hX Note that the lifecycle above can be slightly different for OTG devices. Other than providing an additional OTG descriptor in each configuration, only the HNP-related differences are particularly visible to driver code. They involve reporting requirements during the }(hX Note that the lifecycle above can be slightly different for OTG devices. Other than providing an additional OTG descriptor in each configuration, only the HNP-related differences are particularly visible to driver code. They involve reporting requirements during the hjhhhNhNubj)}(h``SET_CONFIGURATION``h]hSET_CONFIGURATION}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhi request, and the option to invoke HNP during some suspend callbacks. Also, SRP changes the semantics of }(hi request, and the option to invoke HNP during some suspend callbacks. Also, SRP changes the semantics of hjhhhNhNubj)}(h``usb_gadget_wakeup``h]husb_gadget_wakeup}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh slightly.}(h slightly.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM(hj~hhubeh}(h]driver-life-cycleah ]h"]driver life cycleah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h%USB 2.0 Chapter 9 Types and Constantsh]h%USB 2.0 Chapter 9 Types and Constants}(hj@hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;hhhhhM0ubh)}(hGadget drivers rely on common USB structures and constants defined in the :ref:`linux/usb/ch9.h ` header file, which is standard in Linux 2.6+ kernels. These are the same types and constants used by host side drivers (and usbcore).h](hJGadget drivers rely on common USB structures and constants defined in the }(hJGadget drivers rely on common USB structures and constants defined in the hjLhhhNhNubh)}(h%:ref:`linux/usb/ch9.h `h]hinline)}(hjWh]hlinux/usb/ch9.h}(hhhj[hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jYhjUubah}(h]h ]h"]h$]h&]refdocj refdomainjereftyperef refexplicitrefwarnj usb_chapter9uh1hhhhM2hjLubh header file, which is standard in Linux 2.6+ kernels. These are the same types and constants used by host side drivers (and usbcore).}(h header file, which is standard in Linux 2.6+ kernels. These are the same types and constants used by host side drivers (and usbcore).hjLhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM2hj;hhubeh}(h]%usb-2-0-chapter-9-types-and-constantsah ]h"]%usb 2.0 chapter 9 types and constantsah$]h&]uh1hhjhhhhhM0ubh)}(hhh](h)}(hCore Objects and Methodsh]hCore Objects and Methods}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM8ubh)}(hThese are declared in ````, and are used by gadget drivers to interact with USB peripheral controller drivers.h](hThese are declared in }(hThese are declared in hjhhhNhNubj)}(h````h]h}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhT, and are used by gadget drivers to interact with USB peripheral controller drivers.}(hT, and are used by gadget drivers to interact with USB peripheral controller drivers.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM:hjhhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleusb_request (C struct) c.usb_requesthNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(h usb_requesth]hdesc_signature_line)}(hstruct usb_requesth](hdesc_sig_keyword)}(hstructh]hstruct}(hhhjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK#ubhdesc_sig_space)}(h h]h }(hhhjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhK#ubh desc_name)}(h usb_requesth]h desc_sig_name)}(hjh]h usb_request}(hhhj hhhNhNubah}(h]h ]nah"]h$]h&]uh1j hj ubah}(h]h ](sig-namedescnameeh"]h$]h&] xml:spacepreserveuh1j hjhhhjhK#ubeh}(h]h ]h"]h$]h&]j j! add_permalinkuh1jsphinx_line_type declaratorhjhhhjhK#ubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multilineuh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjhhubh desc_content)}(hhh]h)}(hdescribes one i/o requesth]hdescribes one i/o request}(hj< hj: hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK"hj7 hhubah}(h]h ]h"]h$]h&]uh1j5 hjhhhjhK#ubeh}(h]h ](jstructeh"]h$]h&]domainjobjtypejR desctypejR noindexuh1jhhhjhNhNubh container)}(hX **Definition**:: struct usb_request { void *buf; unsigned length; dma_addr_t dma; struct scatterlist *sg; unsigned num_sgs; unsigned num_mapped_sgs; unsigned stream_id:16; unsigned is_last:1; unsigned no_interrupt:1; unsigned zero:1; unsigned short_not_ok:1; unsigned dma_mapped:1; unsigned sg_was_mapped:1; void (*complete)(struct usb_ep *ep, struct usb_request *req); void *context; struct list_head list; unsigned frame_number; int status; unsigned actual; }; **Members** ``buf`` Buffer used for data. Always provide this; some controllers only use PIO, or don't use DMA for some endpoints. ``length`` Length of that data ``dma`` DMA address corresponding to 'buf'. If you don't set this field, and the usb controller needs one, it is responsible for mapping and unmapping the buffer. ``sg`` a scatterlist for SG-capable controllers. ``num_sgs`` number of SG entries ``num_mapped_sgs`` number of SG entries mapped to DMA (internal) ``stream_id`` The stream id, when USB3.0 bulk streams are being used ``is_last`` Indicates if this is the last request of a stream_id before switching to a different stream (required for DWC3 controllers). ``no_interrupt`` If true, hints that no completion irq is needed. Helpful sometimes with deep request queues that are handled directly by DMA controllers. ``zero`` If true, when writing data, makes the last packet be "short" by adding a zero length packet as needed; ``short_not_ok`` When reading data, makes short packets be treated as errors (queue stops advancing till cleanup). ``dma_mapped`` Indicates if request has been mapped to DMA (internal) ``sg_was_mapped`` Set if the scatterlist has been mapped before the request ``complete`` Function called when request completes, so this request and its buffer may be re-used. The function will always be called with interrupts disabled, and it must not sleep. Reads terminate with a short packet, or when the buffer fills, whichever comes first. When writes terminate, some data bytes will usually still be in flight (often in a hardware fifo). Errors (for reads or writes) stop the queue from advancing until the completion function returns, so that any transfers invalidated by the error may first be dequeued. ``context`` For use by the completion callback ``list`` For use by the gadget driver. ``frame_number`` Reports the interval number in (micro)frame in which the isochronous transfer was transmitted or received. ``status`` Reports completion code, zero or a negative errno. Normally, faults block the transfer queue from advancing until the completion callback returns. Code "-ESHUTDOWN" indicates completion caused by device disconnect, or when the driver disabled the endpoint. ``actual`` Reports bytes transferred to/from the buffer. For reads (OUT transfers) this may be less than the requested length. If the short_not_ok flag is set, short reads are treated as errors even when status otherwise indicates successful completion. Note that for writes (IN transfers) some data bytes may still reside in a device-side FIFO when the request is reported as complete.h](h)}(h**Definition**::h](hstrong)}(h**Definition**h]h Definition}(hhhjf hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj` ubh:}(h:hj` hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK&hj\ ubh literal_block)}(hXstruct usb_request { void *buf; unsigned length; dma_addr_t dma; struct scatterlist *sg; unsigned num_sgs; unsigned num_mapped_sgs; unsigned stream_id:16; unsigned is_last:1; unsigned no_interrupt:1; unsigned zero:1; unsigned short_not_ok:1; unsigned dma_mapped:1; unsigned sg_was_mapped:1; void (*complete)(struct usb_ep *ep, struct usb_request *req); void *context; struct list_head list; unsigned frame_number; int status; unsigned actual; };h]hXstruct usb_request { void *buf; unsigned length; dma_addr_t dma; struct scatterlist *sg; unsigned num_sgs; unsigned num_mapped_sgs; unsigned stream_id:16; unsigned is_last:1; unsigned no_interrupt:1; unsigned zero:1; unsigned short_not_ok:1; unsigned dma_mapped:1; unsigned sg_was_mapped:1; void (*complete)(struct usb_ep *ep, struct usb_request *req); void *context; struct list_head list; unsigned frame_number; int status; unsigned actual; };}(hhhj ubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK(hj\ ubh)}(h **Members**h]je )}(hj h]hMembers}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK>hj\ ubjw)}(hhh](j|)}(hx``buf`` Buffer used for data. Always provide this; some controllers only use PIO, or don't use DMA for some endpoints. h](j)}(h``buf``h]j)}(hj h]hbuf}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK%hj ubj)}(hhh]h)}(hoBuffer used for data. Always provide this; some controllers only use PIO, or don't use DMA for some endpoints.h]hqBuffer used for data. Always provide this; some controllers only use PIO, or don’t use DMA for some endpoints.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK$hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK%hj ubj|)}(h``length`` Length of that data h](j)}(h ``length``h]j)}(hj h]hlength}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK,hj ubj)}(hhh]h)}(hLength of that datah]hLength of that data}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK,hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK,hj ubj|)}(h``dma`` DMA address corresponding to 'buf'. If you don't set this field, and the usb controller needs one, it is responsible for mapping and unmapping the buffer. h](j)}(h``dma``h]j)}(hj% h]hdma}(hhhj' hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj# ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK(hj ubj)}(hhh]h)}(hDMA address corresponding to 'buf'. If you don't set this field, and the usb controller needs one, it is responsible for mapping and unmapping the buffer.h]hDMA address corresponding to ‘buf’. If you don’t set this field, and the usb controller needs one, it is responsible for mapping and unmapping the buffer.}(hj@ hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK&hj; ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj: hK(hj ubj|)}(h1``sg`` a scatterlist for SG-capable controllers. h](j)}(h``sg``h]j)}(hj_ h]hsg}(hhhja hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj] ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK)hjY ubj)}(hhh]h)}(h)a scatterlist for SG-capable controllers.h]h)a scatterlist for SG-capable controllers.}(hjz hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjt hK)hju ubah}(h]h ]h"]h$]h&]uh1jhjY ubeh}(h]h ]h"]h$]h&]uh1j{hjt hK)hj ubj|)}(h!``num_sgs`` number of SG entries h](j)}(h ``num_sgs``h]j)}(hj h]hnum_sgs}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK*hj ubj)}(hhh]h)}(hnumber of SG entriesh]hnumber of SG entries}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK*hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK*hj ubj|)}(hA``num_mapped_sgs`` number of SG entries mapped to DMA (internal) h](j)}(h``num_mapped_sgs``h]j)}(hj h]hnum_mapped_sgs}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK+hj ubj)}(hhh]h)}(h-number of SG entries mapped to DMA (internal)h]h-number of SG entries mapped to DMA (internal)}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK+hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK+hj ubj|)}(hE``stream_id`` The stream id, when USB3.0 bulk streams are being used h](j)}(h ``stream_id``h]j)}(hj h]h stream_id}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK-hj ubj)}(hhh]h)}(h6The stream id, when USB3.0 bulk streams are being usedh]h6The stream id, when USB3.0 bulk streams are being used}(hj% hj# hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK-hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK-hj ubj|)}(h``is_last`` Indicates if this is the last request of a stream_id before switching to a different stream (required for DWC3 controllers). h](j)}(h ``is_last``h]j)}(hjC h]his_last}(hhhjE hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK/hj= ubj)}(hhh]h)}(h|Indicates if this is the last request of a stream_id before switching to a different stream (required for DWC3 controllers).h]h|Indicates if this is the last request of a stream_id before switching to a different stream (required for DWC3 controllers).}(hj^ hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK.hjY ubah}(h]h ]h"]h$]h&]uh1jhj= ubeh}(h]h ]h"]h$]h&]uh1j{hjX hK/hj ubj|)}(h``no_interrupt`` If true, hints that no completion irq is needed. Helpful sometimes with deep request queues that are handled directly by DMA controllers. h](j)}(h``no_interrupt``h]j)}(hj} h]h no_interrupt}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj{ ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK2hjw ubj)}(hhh]h)}(hIf true, hints that no completion irq is needed. Helpful sometimes with deep request queues that are handled directly by DMA controllers.h]hIf true, hints that no completion irq is needed. Helpful sometimes with deep request queues that are handled directly by DMA controllers.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK0hj ubah}(h]h ]h"]h$]h&]uh1jhjw ubeh}(h]h ]h"]h$]h&]uh1j{hj hK2hj ubj|)}(hp``zero`` If true, when writing data, makes the last packet be "short" by adding a zero length packet as needed; h](j)}(h``zero``h]j)}(hj h]hzero}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK4hj ubj)}(hhh]h)}(hfIf true, when writing data, makes the last packet be "short" by adding a zero length packet as needed;h]hjIf true, when writing data, makes the last packet be “short” by adding a zero length packet as needed;}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK3hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK4hj ubj|)}(hs``short_not_ok`` When reading data, makes short packets be treated as errors (queue stops advancing till cleanup). h](j)}(h``short_not_ok``h]j)}(hj h]h short_not_ok}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK6hj ubj)}(hhh]h)}(haWhen reading data, makes short packets be treated as errors (queue stops advancing till cleanup).h]haWhen reading data, makes short packets be treated as errors (queue stops advancing till cleanup).}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK5hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hK6hj ubj|)}(hF``dma_mapped`` Indicates if request has been mapped to DMA (internal) h](j)}(h``dma_mapped``h]j)}(hj+ h]h dma_mapped}(hhhj- hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj) ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK7hj% ubj)}(hhh]h)}(h6Indicates if request has been mapped to DMA (internal)h]h6Indicates if request has been mapped to DMA (internal)}(hjF hjD hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@ hK7hjA ubah}(h]h ]h"]h$]h&]uh1jhj% ubeh}(h]h ]h"]h$]h&]uh1j{hj@ hK7hj ubj|)}(hL``sg_was_mapped`` Set if the scatterlist has been mapped before the request h](j)}(h``sg_was_mapped``h]j)}(hjd h]h sg_was_mapped}(hhhjf hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjb ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK8hj^ ubj)}(hhh]h)}(h9Set if the scatterlist has been mapped before the requesth]h9Set if the scatterlist has been mapped before the request}(hj hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjy hK8hjz ubah}(h]h ]h"]h$]h&]uh1jhj^ ubeh}(h]h ]h"]h$]h&]uh1j{hjy hK8hj ubj|)}(hX``complete`` Function called when request completes, so this request and its buffer may be re-used. The function will always be called with interrupts disabled, and it must not sleep. Reads terminate with a short packet, or when the buffer fills, whichever comes first. When writes terminate, some data bytes will usually still be in flight (often in a hardware fifo). Errors (for reads or writes) stop the queue from advancing until the completion function returns, so that any transfers invalidated by the error may first be dequeued. h](j)}(h ``complete``h]j)}(hj h]hcomplete}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKAhj ubj)}(hhh]h)}(hX Function called when request completes, so this request and its buffer may be re-used. The function will always be called with interrupts disabled, and it must not sleep. Reads terminate with a short packet, or when the buffer fills, whichever comes first. When writes terminate, some data bytes will usually still be in flight (often in a hardware fifo). Errors (for reads or writes) stop the queue from advancing until the completion function returns, so that any transfers invalidated by the error may first be dequeued.h]hX Function called when request completes, so this request and its buffer may be re-used. The function will always be called with interrupts disabled, and it must not sleep. Reads terminate with a short packet, or when the buffer fills, whichever comes first. When writes terminate, some data bytes will usually still be in flight (often in a hardware fifo). Errors (for reads or writes) stop the queue from advancing until the completion function returns, so that any transfers invalidated by the error may first be dequeued.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK9hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hKAhj ubj|)}(h/``context`` For use by the completion callback h](j)}(h ``context``h]j)}(hj h]hcontext}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKBhj ubj)}(hhh]h)}(h"For use by the completion callbackh]h"For use by the completion callback}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKBhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hKBhj ubj|)}(h'``list`` For use by the gadget driver. h](j)}(h``list``h]j)}(hj h]hlist}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKChj ubj)}(hhh]h)}(hFor use by the gadget driver.h]hFor use by the gadget driver.}(hj+ hj) hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj% hKChj& ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj% hKChj ubj|)}(h|``frame_number`` Reports the interval number in (micro)frame in which the isochronous transfer was transmitted or received. h](j)}(h``frame_number``h]j)}(hjI h]h frame_number}(hhhjK hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjG ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKEhjC ubj)}(hhh]h)}(hjReports the interval number in (micro)frame in which the isochronous transfer was transmitted or received.h]hjReports the interval number in (micro)frame in which the isochronous transfer was transmitted or received.}(hjd hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKDhj_ ubah}(h]h ]h"]h$]h&]uh1jhjC ubeh}(h]h ]h"]h$]h&]uh1j{hj^ hKEhj ubj|)}(hX ``status`` Reports completion code, zero or a negative errno. Normally, faults block the transfer queue from advancing until the completion callback returns. Code "-ESHUTDOWN" indicates completion caused by device disconnect, or when the driver disabled the endpoint. h](j)}(h ``status``h]j)}(hj h]hstatus}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKJhj} ubj)}(hhh]h)}(hXReports completion code, zero or a negative errno. Normally, faults block the transfer queue from advancing until the completion callback returns. Code "-ESHUTDOWN" indicates completion caused by device disconnect, or when the driver disabled the endpoint.h]hXReports completion code, zero or a negative errno. Normally, faults block the transfer queue from advancing until the completion callback returns. Code “-ESHUTDOWN” indicates completion caused by device disconnect, or when the driver disabled the endpoint.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKFhj ubah}(h]h ]h"]h$]h&]uh1jhj} ubeh}(h]h ]h"]h$]h&]uh1j{hj hKJhj ubj|)}(hX``actual`` Reports bytes transferred to/from the buffer. For reads (OUT transfers) this may be less than the requested length. If the short_not_ok flag is set, short reads are treated as errors even when status otherwise indicates successful completion. Note that for writes (IN transfers) some data bytes may still reside in a device-side FIFO when the request is reported as complete.h](j)}(h ``actual``h]j)}(hj h]hactual}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKPhj ubj)}(hhh]h)}(hXyReports bytes transferred to/from the buffer. For reads (OUT transfers) this may be less than the requested length. If the short_not_ok flag is set, short reads are treated as errors even when status otherwise indicates successful completion. Note that for writes (IN transfers) some data bytes may still reside in a device-side FIFO when the request is reported as complete.h]hXyReports bytes transferred to/from the buffer. For reads (OUT transfers) this may be less than the requested length. If the short_not_ok flag is set, short reads are treated as errors even when status otherwise indicates successful completion. Note that for writes (IN transfers) some data bytes may still reside in a device-side FIFO when the request is reported as complete.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj hKPhj ubeh}(h]h ]h"]h$]h&]uh1jvhj\ ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubh)}(h**Description**h]je )}(hjh]h Description}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKThjhhubh)}(hThese are allocated/freed through the endpoint they're used with. The hardware's driver can add extra per-request data to the memory it returns, which often avoids separate memory allocations (potential failures), later when the request is queued.h]hThese are allocated/freed through the endpoint they’re used with. The hardware’s driver can add extra per-request data to the memory it returns, which often avoids separate memory allocations (potential failures), later when the request is queued.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKRhjhhubh)}(hXARequest flags affect request handling, such as whether a zero length packet is written (the "zero" flag), whether a short read should be treated as an error (blocking request queue advance, the "short_not_ok" flag), or hinting that an interrupt is not required (the "no_interrupt" flag, for use with deep request queues).h]hXMRequest flags affect request handling, such as whether a zero length packet is written (the “zero” flag), whether a short read should be treated as an error (blocking request queue advance, the “short_not_ok” flag), or hinting that an interrupt is not required (the “no_interrupt” flag, for use with deep request queues).}(hj'hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKWhjhhubh)}(hBulk endpoints can use any size buffers, and can also be used for interrupt transfers. interrupt-only endpoints can be much less functional.h]hBulk endpoints can use any size buffers, and can also be used for interrupt transfers. interrupt-only endpoints can be much less functional.}(hj6hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK]hjhhubh)}(h**NOTE**h]je )}(hjEh]hNOTE}(hhhjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjCubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK`hjhhubh)}(hnthis is analogous to 'struct urb' on the host side, except that it's thinner and promotes more pre-allocation.h]htthis is analogous to ‘struct urb’ on the host side, except that it’s thinner and promotes more pre-allocation.}(hj]hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK`hjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep_caps (C struct) c.usb_ep_capshNtauh1jhjhhhNhNubj)}(hhh](j)}(h usb_ep_capsh]j)}(hstruct usb_ep_capsh](j)}(hjh]hstruct}(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKubj )}(h usb_ep_capsh]j )}(hj}h]h usb_ep_caps}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjhhhjhKubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj{hhhjhKubah}(h]jvah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKfhjxhhubj6 )}(hhh]h)}(h!endpoint capabilities descriptionh]h!endpoint capabilities description}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjhhubah}(h]h ]h"]h$]h&]uh1j5 hjxhhhjhKubeh}(h]h ](jstructeh"]h$]h&]jV jjW jjX jjY uh1jhhhjhNhNubj[ )}(hX&**Definition**:: struct usb_ep_caps { unsigned type_control:1; unsigned type_iso:1; unsigned type_bulk:1; unsigned type_int:1; unsigned dir_in:1; unsigned dir_out:1; }; **Members** ``type_control`` Endpoint supports control type (reserved for ep0). ``type_iso`` Endpoint supports isochronous transfers. ``type_bulk`` Endpoint supports bulk transfers. ``type_int`` Endpoint supports interrupt transfers. ``dir_in`` Endpoint supports IN direction. ``dir_out`` Endpoint supports OUT direction.h](h)}(h**Definition**::h](je )}(h**Definition**h]h Definition}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubh:}(hjx hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj )}(hstruct usb_ep_caps { unsigned type_control:1; unsigned type_iso:1; unsigned type_bulk:1; unsigned type_int:1; unsigned dir_in:1; unsigned dir_out:1; };h]hstruct usb_ep_caps { unsigned type_control:1; unsigned type_iso:1; unsigned type_bulk:1; unsigned type_int:1; unsigned dir_in:1; unsigned dir_out:1; };}(hhhjubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubh)}(h **Members**h]je )}(hjh]hMembers}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubjw)}(hhh](j|)}(hD``type_control`` Endpoint supports control type (reserved for ep0). h](j)}(h``type_control``h]j)}(hj3h]h type_control}(hhhj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj-ubj)}(hhh]h)}(h2Endpoint supports control type (reserved for ep0).h]h2Endpoint supports control type (reserved for ep0).}(hjNhjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjHhKhjIubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1j{hjHhKhj*ubj|)}(h6``type_iso`` Endpoint supports isochronous transfers. h](j)}(h ``type_iso``h]j)}(hjlh]htype_iso}(hhhjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjfubj)}(hhh]h)}(h(Endpoint supports isochronous transfers.h]h(Endpoint supports isochronous transfers.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjfubeh}(h]h ]h"]h$]h&]uh1j{hjhKhj*ubj|)}(h0``type_bulk`` Endpoint supports bulk transfers. h](j)}(h ``type_bulk``h]j)}(hjh]h type_bulk}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h!Endpoint supports bulk transfers.h]h!Endpoint supports bulk transfers.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhj*ubj|)}(h4``type_int`` Endpoint supports interrupt transfers. h](j)}(h ``type_int``h]j)}(hjh]htype_int}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h&Endpoint supports interrupt transfers.h]h&Endpoint supports interrupt transfers.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhj*ubj|)}(h+``dir_in`` Endpoint supports IN direction. h](j)}(h ``dir_in``h]j)}(hjh]hdir_in}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(hEndpoint supports IN direction.h]hEndpoint supports IN direction.}(hj2hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,hKhj-ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hj,hKhj*ubj|)}(h,``dir_out`` Endpoint supports OUT direction.h](j)}(h ``dir_out``h]j)}(hjPh]hdir_out}(hhhjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjJubj)}(hhh]h)}(h Endpoint supports OUT direction.h]h Endpoint supports OUT direction.}(hjkhjihhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjfubah}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1j{hjehKhj*ubeh}(h]h ]h"]h$]h&]uh1jvhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep (C struct)c.usb_ephNtauh1jhjhhhNhNubj)}(hhh](j)}(husb_eph]j)}(h struct usb_eph](j)}(hjh]hstruct}(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKubj )}(husb_eph]j )}(hjh]husb_ep}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjhhhjhKubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjhhhjhKubah}(h]jah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjhhubj6 )}(hhh]h)}(h*device side representation of USB endpointh]h*device side representation of USB endpoint}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjhhubah}(h]h ]h"]h$]h&]uh1j5 hjhhhjhKubeh}(h]h ](jstructeh"]h$]h&]jV jjW jjX jjY uh1jhhhjhNhNubj[ )}(hX**Definition**:: struct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; struct list_head ep_list; struct usb_ep_caps caps; bool claimed; bool enabled; unsigned maxpacket:16; unsigned maxpacket_limit:16; unsigned max_streams:16; unsigned mult:2; unsigned maxburst:5; u8 address; const struct usb_endpoint_descriptor *desc; const struct usb_ss_ep_comp_descriptor *comp_desc; }; **Members** ``driver_data`` for use by the gadget driver. ``name`` identifier for the endpoint, such as "ep-a" or "ep9in-bulk" ``ops`` Function pointers used to access hardware-specific operations. ``ep_list`` the gadget's ep_list holds all of its endpoints ``caps`` The structure describing types and directions supported by endpoint. ``claimed`` True if this endpoint is claimed by a function. ``enabled`` The current endpoint enabled/disabled state. ``maxpacket`` The maximum packet size used on this endpoint. The initial value can sometimes be reduced (hardware allowing), according to the endpoint descriptor used to configure the endpoint. ``maxpacket_limit`` The maximum packet size value which can be handled by this endpoint. It's set once by UDC driver when endpoint is initialized, and should not be changed. Should not be confused with maxpacket. ``max_streams`` The maximum number of streams supported by this EP (0 - 16, actual number is 2^n) ``mult`` multiplier, 'mult' value for SS Isoc EPs ``maxburst`` the maximum number of bursts supported by this EP (for usb3) ``address`` used to identify the endpoint when finding descriptor that matches connection speed ``desc`` endpoint descriptor. This pointer is set before the endpoint is enabled and remains valid until the endpoint is disabled. ``comp_desc`` In case of SuperSpeed support, this is the endpoint companion descriptor that is used to configure the endpointh](h)}(h**Definition**::h](je )}(h**Definition**h]h Definition}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj ubh:}(hjx hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj ubj )}(hXstruct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; struct list_head ep_list; struct usb_ep_caps caps; bool claimed; bool enabled; unsigned maxpacket:16; unsigned maxpacket_limit:16; unsigned max_streams:16; unsigned mult:2; unsigned maxburst:5; u8 address; const struct usb_endpoint_descriptor *desc; const struct usb_ss_ep_comp_descriptor *comp_desc; };h]hXstruct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; struct list_head ep_list; struct usb_ep_caps caps; bool claimed; bool enabled; unsigned maxpacket:16; unsigned maxpacket_limit:16; unsigned max_streams:16; unsigned mult:2; unsigned maxburst:5; u8 address; const struct usb_endpoint_descriptor *desc; const struct usb_ss_ep_comp_descriptor *comp_desc; };}(hhhj*ubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj ubh)}(h **Members**h]je )}(hj;h]hMembers}(hhhj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj9ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj ubjw)}(hhh](j|)}(h.``driver_data`` for use by the gadget driver. h](j)}(h``driver_data``h]j)}(hjZh]h driver_data}(hhhj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjTubj)}(hhh]h)}(hfor use by the gadget driver.h]hfor use by the gadget driver.}(hjuhjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohKhjpubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1j{hjohKhjQubj|)}(hE``name`` identifier for the endpoint, such as "ep-a" or "ep9in-bulk" h](j)}(h``name``h]j)}(hjh]hname}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h;identifier for the endpoint, such as "ep-a" or "ep9in-bulk"h]hCidentifier for the endpoint, such as “ep-a” or “ep9in-bulk”}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(hG``ops`` Function pointers used to access hardware-specific operations. h](j)}(h``ops``h]j)}(hjh]hops}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h>Function pointers used to access hardware-specific operations.h]h>Function pointers used to access hardware-specific operations.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(h<``ep_list`` the gadget's ep_list holds all of its endpoints h](j)}(h ``ep_list``h]j)}(hjh]hep_list}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h/the gadget's ep_list holds all of its endpointsh]h1the gadget’s ep_list holds all of its endpoints}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(hN``caps`` The structure describing types and directions supported by endpoint. h](j)}(h``caps``h]j)}(hj>h]hcaps}(hhhj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj8ubj)}(hhh]h)}(hDThe structure describing types and directions supported by endpoint.h]hDThe structure describing types and directions supported by endpoint.}(hjYhjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShKhjTubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1j{hjShKhjQubj|)}(h<``claimed`` True if this endpoint is claimed by a function. h](j)}(h ``claimed``h]j)}(hjwh]hclaimed}(hhhjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjqubj)}(hhh]h)}(h/True if this endpoint is claimed by a function.h]h/True if this endpoint is claimed by a function.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(h9``enabled`` The current endpoint enabled/disabled state. h](j)}(h ``enabled``h]j)}(hjh]henabled}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h,The current endpoint enabled/disabled state.h]h,The current endpoint enabled/disabled state.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(h``maxpacket`` The maximum packet size used on this endpoint. The initial value can sometimes be reduced (hardware allowing), according to the endpoint descriptor used to configure the endpoint. h](j)}(h ``maxpacket``h]j)}(hjh]h maxpacket}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(hThe maximum packet size used on this endpoint. The initial value can sometimes be reduced (hardware allowing), according to the endpoint descriptor used to configure the endpoint.h]hThe maximum packet size used on this endpoint. The initial value can sometimes be reduced (hardware allowing), according to the endpoint descriptor used to configure the endpoint.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(h``maxpacket_limit`` The maximum packet size value which can be handled by this endpoint. It's set once by UDC driver when endpoint is initialized, and should not be changed. Should not be confused with maxpacket. h](j)}(h``maxpacket_limit``h]j)}(hj#h]hmaxpacket_limit}(hhhj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(hThe maximum packet size value which can be handled by this endpoint. It's set once by UDC driver when endpoint is initialized, and should not be changed. Should not be confused with maxpacket.h]hThe maximum packet size value which can be handled by this endpoint. It’s set once by UDC driver when endpoint is initialized, and should not be changed. Should not be confused with maxpacket.}(hj>hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj9ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hj8hKhjQubj|)}(hb``max_streams`` The maximum number of streams supported by this EP (0 - 16, actual number is 2^n) h](j)}(h``max_streams``h]j)}(hj]h]h max_streams}(hhhj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjWubj)}(hhh]h)}(hQThe maximum number of streams supported by this EP (0 - 16, actual number is 2^n)h]hQThe maximum number of streams supported by this EP (0 - 16, actual number is 2^n)}(hjxhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjsubah}(h]h ]h"]h$]h&]uh1jhjWubeh}(h]h ]h"]h$]h&]uh1j{hjrhKhjQubj|)}(h2``mult`` multiplier, 'mult' value for SS Isoc EPs h](j)}(h``mult``h]j)}(hjh]hmult}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h(multiplier, 'mult' value for SS Isoc EPsh]h,multiplier, ‘mult’ value for SS Isoc EPs}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhKhjQubj|)}(hJ``maxburst`` the maximum number of bursts supported by this EP (for usb3) h](j)}(h ``maxburst``h]j)}(hjh]hmaxburst}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(hep_list. the control endpoint (gadget->ep0) is not in that list, and is accessed only in response to a driver setup() callback.h]hthe bus controller driver lists all the general purpose endpoints in gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, and is accessed only in response to a driver setup() callback.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_gadget (C struct) c.usb_gadgethNtauh1jhjhhhNhNubj)}(hhh](j)}(h usb_gadgeth]j)}(hstruct usb_gadgeth](j)}(hjh]hstruct}(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMTubj)}(h h]h }(hhhj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhj hMTubj )}(h usb_gadgeth]j )}(hjh]h usb_gadget}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjhhhj hMTubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjhhhj hMTubah}(h]jah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjhhubj6 )}(hhh]h)}(hrepresents a usb deviceh]hrepresents a usb device}(hjBhj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMShj=hhubah}(h]h ]h"]h$]h&]uh1j5 hjhhhj hMTubeh}(h]h ](jstructeh"]h$]h&]jV jjW jXjX jXjY uh1jhhhjhNhNubj[ )}(hX#**Definition**:: struct usb_gadget { struct work_struct work; struct usb_udc *udc; const struct usb_gadget_ops *ops; struct usb_ep *ep0; struct list_head ep_list; enum usb_device_speed speed; enum usb_device_speed max_speed; enum usb_ssp_rate ssp_rate; enum usb_ssp_rate max_ssp_rate; enum usb_device_state state; const char *name; struct device dev; unsigned isoch_delay; unsigned out_epnum; unsigned in_epnum; unsigned mA; struct usb_otg_caps *otg_caps; unsigned sg_supported:1; unsigned is_otg:1; unsigned is_a_peripheral:1; unsigned b_hnp_enable:1; unsigned a_hnp_support:1; unsigned a_alt_hnp_support:1; unsigned hnp_polling_support:1; unsigned host_request_flag:1; unsigned quirk_ep_out_aligned_size:1; unsigned quirk_altset_not_supp:1; unsigned quirk_stall_not_supp:1; unsigned quirk_zlp_not_supp:1; unsigned quirk_avoids_skb_reserve:1; unsigned is_selfpowered:1; unsigned deactivated:1; unsigned connected:1; unsigned lpm_capable:1; unsigned wakeup_capable:1; unsigned wakeup_armed:1; int irq; int id_number; }; **Members** ``work`` (internal use) Workqueue to be used for sysfs_notify() ``udc`` struct usb_udc pointer for this gadget ``ops`` Function pointers used to access hardware-specific operations. ``ep0`` Endpoint zero, used when reading or writing responses to driver setup() requests ``ep_list`` List of other endpoints supported by the device. ``speed`` Speed of current connection to USB host. ``max_speed`` Maximal speed the UDC can handle. UDC must support this and all slower speeds. ``ssp_rate`` Current connected SuperSpeed Plus signaling rate and lane count. ``max_ssp_rate`` Maximum SuperSpeed Plus signaling rate and lane count the UDC can handle. The UDC must support this and all slower speeds and lower number of lanes. ``state`` the state we are now (attached, suspended, configured, etc) ``name`` Identifies the controller hardware type. Used in diagnostics and sometimes configuration. ``dev`` Driver model state for this abstract device. ``isoch_delay`` value from Set Isoch Delay request. Only valid on SS/SSP ``out_epnum`` last used out ep number ``in_epnum`` last used in ep number ``mA`` last set mA value ``otg_caps`` OTG capabilities of this gadget. ``sg_supported`` true if we can handle scatter-gather ``is_otg`` True if the USB device port uses a Mini-AB jack, so that the gadget driver must provide a USB OTG descriptor. ``is_a_peripheral`` False unless is_otg, the "A" end of a USB cable is in the Mini-AB jack, and HNP has been used to switch roles so that the "A" device currently acts as A-Peripheral, not A-Host. ``b_hnp_enable`` OTG device feature flag, indicating that the A-Host enabled HNP support. ``a_hnp_support`` OTG device feature flag, indicating that the A-Host supports HNP at this port. ``a_alt_hnp_support`` OTG device feature flag, indicating that the A-Host only supports HNP on a different root port. ``hnp_polling_support`` OTG device feature flag, indicating if the OTG device in peripheral mode can support HNP polling. ``host_request_flag`` OTG device feature flag, indicating if A-Peripheral or B-Peripheral wants to take host role. ``quirk_ep_out_aligned_size`` epout requires buffer size to be aligned to MaxPacketSize. ``quirk_altset_not_supp`` UDC controller doesn't support alt settings. ``quirk_stall_not_supp`` UDC controller doesn't support stalling. ``quirk_zlp_not_supp`` UDC controller doesn't support ZLP. ``quirk_avoids_skb_reserve`` udc/platform wants to avoid skb_reserve() in u_ether.c to improve performance. ``is_selfpowered`` if the gadget is self-powered. ``deactivated`` True if gadget is deactivated - in deactivated state it cannot be connected. ``connected`` True if gadget is connected. ``lpm_capable`` If the gadget max_speed is FULL or HIGH, this flag indicates that it supports LPM as per the LPM ECN & errata. ``wakeup_capable`` True if gadget is capable of sending remote wakeup. ``wakeup_armed`` True if gadget is armed by the host for remote wakeup. ``irq`` the interrupt number for device controller. ``id_number`` a unique ID number for ensuring that gadget names are distincth](h)}(h**Definition**::h](je )}(h**Definition**h]h Definition}(hhhjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj`ubh:}(hjx hj`hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMWhj\ubj )}(hX2struct usb_gadget { struct work_struct work; struct usb_udc *udc; const struct usb_gadget_ops *ops; struct usb_ep *ep0; struct list_head ep_list; enum usb_device_speed speed; enum usb_device_speed max_speed; enum usb_ssp_rate ssp_rate; enum usb_ssp_rate max_ssp_rate; enum usb_device_state state; const char *name; struct device dev; unsigned isoch_delay; unsigned out_epnum; unsigned in_epnum; unsigned mA; struct usb_otg_caps *otg_caps; unsigned sg_supported:1; unsigned is_otg:1; unsigned is_a_peripheral:1; unsigned b_hnp_enable:1; unsigned a_hnp_support:1; unsigned a_alt_hnp_support:1; unsigned hnp_polling_support:1; unsigned host_request_flag:1; unsigned quirk_ep_out_aligned_size:1; unsigned quirk_altset_not_supp:1; unsigned quirk_stall_not_supp:1; unsigned quirk_zlp_not_supp:1; unsigned quirk_avoids_skb_reserve:1; unsigned is_selfpowered:1; unsigned deactivated:1; unsigned connected:1; unsigned lpm_capable:1; unsigned wakeup_capable:1; unsigned wakeup_armed:1; int irq; int id_number; };h]hX2struct usb_gadget { struct work_struct work; struct usb_udc *udc; const struct usb_gadget_ops *ops; struct usb_ep *ep0; struct list_head ep_list; enum usb_device_speed speed; enum usb_device_speed max_speed; enum usb_ssp_rate ssp_rate; enum usb_ssp_rate max_ssp_rate; enum usb_device_state state; const char *name; struct device dev; unsigned isoch_delay; unsigned out_epnum; unsigned in_epnum; unsigned mA; struct usb_otg_caps *otg_caps; unsigned sg_supported:1; unsigned is_otg:1; unsigned is_a_peripheral:1; unsigned b_hnp_enable:1; unsigned a_hnp_support:1; unsigned a_alt_hnp_support:1; unsigned hnp_polling_support:1; unsigned host_request_flag:1; unsigned quirk_ep_out_aligned_size:1; unsigned quirk_altset_not_supp:1; unsigned quirk_stall_not_supp:1; unsigned quirk_zlp_not_supp:1; unsigned quirk_avoids_skb_reserve:1; unsigned is_selfpowered:1; unsigned deactivated:1; unsigned connected:1; unsigned lpm_capable:1; unsigned wakeup_capable:1; unsigned wakeup_armed:1; int irq; int id_number; };}(hhhj}ubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMYhj\ubh)}(h **Members**h]je )}(hjh]hMembers}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj\ubjw)}(hhh](j|)}(h@``work`` (internal use) Workqueue to be used for sysfs_notify() h](j)}(h``work``h]j)}(hjh]hwork}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMUhjubj)}(hhh]h)}(h6(internal use) Workqueue to be used for sysfs_notify()h]h6(internal use) Workqueue to be used for sysfs_notify()}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMUhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMUhjubj|)}(h/``udc`` struct usb_udc pointer for this gadget h](j)}(h``udc``h]j)}(hjh]hudc}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMVhjubj)}(hhh]h)}(h&struct usb_udc pointer for this gadgeth]h&struct usb_udc pointer for this gadget}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMVhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMVhjubj|)}(hG``ops`` Function pointers used to access hardware-specific operations. h](j)}(h``ops``h]j)}(hjh]hops}(hhhj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMWhjubj)}(hhh]h)}(h>Function pointers used to access hardware-specific operations.h]h>Function pointers used to access hardware-specific operations.}(hj:hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4hMWhj5ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hj4hMWhjubj|)}(hY``ep0`` Endpoint zero, used when reading or writing responses to driver setup() requests h](j)}(h``ep0``h]j)}(hjXh]hep0}(hhhjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjVubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMYhjRubj)}(hhh]h)}(hPEndpoint zero, used when reading or writing responses to driver setup() requestsh]hPEndpoint zero, used when reading or writing responses to driver setup() requests}(hjshjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMXhjnubah}(h]h ]h"]h$]h&]uh1jhjRubeh}(h]h ]h"]h$]h&]uh1j{hjmhMYhjubj|)}(h=``ep_list`` List of other endpoints supported by the device. h](j)}(h ``ep_list``h]j)}(hjh]hep_list}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMZhjubj)}(hhh]h)}(h0List of other endpoints supported by the device.h]h0List of other endpoints supported by the device.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMZhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMZhjubj|)}(h3``speed`` Speed of current connection to USB host. h](j)}(h ``speed``h]j)}(hjh]hspeed}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM[hjubj)}(hhh]h)}(h(Speed of current connection to USB host.h]h(Speed of current connection to USB host.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM[hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhM[hjubj|)}(h^``max_speed`` Maximal speed the UDC can handle. UDC must support this and all slower speeds. h](j)}(h ``max_speed``h]j)}(hjh]h max_speed}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM]hjubj)}(hhh]h)}(hOMaximal speed the UDC can handle. UDC must support this and all slower speeds.h]hOMaximal speed the UDC can handle. UDC must support this and all slower speeds.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM\hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhM]hjubj|)}(hN``ssp_rate`` Current connected SuperSpeed Plus signaling rate and lane count. h](j)}(h ``ssp_rate``h]j)}(hj>h]hssp_rate}(hhhj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM^hj8ubj)}(hhh]h)}(h@Current connected SuperSpeed Plus signaling rate and lane count.h]h@Current connected SuperSpeed Plus signaling rate and lane count.}(hjYhjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShM^hjTubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1j{hjShM^hjubj|)}(h``max_ssp_rate`` Maximum SuperSpeed Plus signaling rate and lane count the UDC can handle. The UDC must support this and all slower speeds and lower number of lanes. h](j)}(h``max_ssp_rate``h]j)}(hjwh]h max_ssp_rate}(hhhjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMahjqubj)}(hhh]h)}(hMaximum SuperSpeed Plus signaling rate and lane count the UDC can handle. The UDC must support this and all slower speeds and lower number of lanes.h]hMaximum SuperSpeed Plus signaling rate and lane count the UDC can handle. The UDC must support this and all slower speeds and lower number of lanes.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM_hjubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1j{hjhMahjubj|)}(hF``state`` the state we are now (attached, suspended, configured, etc) h](j)}(h ``state``h]j)}(hjh]hstate}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMbhjubj)}(hhh]h)}(h;the state we are now (attached, suspended, configured, etc)h]h;the state we are now (attached, suspended, configured, etc)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMbhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMbhjubj|)}(hd``name`` Identifies the controller hardware type. Used in diagnostics and sometimes configuration. h](j)}(h``name``h]j)}(hjh]hname}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMdhjubj)}(hhh]h)}(hZIdentifies the controller hardware type. Used in diagnostics and sometimes configuration.h]hZIdentifies the controller hardware type. Used in diagnostics and sometimes configuration.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMchjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMdhjubj|)}(h5``dev`` Driver model state for this abstract device. h](j)}(h``dev``h]j)}(hj$h]hdev}(hhhj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMehjubj)}(hhh]h)}(h,Driver model state for this abstract device.h]h,Driver model state for this abstract device.}(hj?hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hMehj:ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hj9hMehjubj|)}(hI``isoch_delay`` value from Set Isoch Delay request. Only valid on SS/SSP h](j)}(h``isoch_delay``h]j)}(hj]h]h isoch_delay}(hhhj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMfhjWubj)}(hhh]h)}(h8value from Set Isoch Delay request. Only valid on SS/SSPh]h8value from Set Isoch Delay request. Only valid on SS/SSP}(hjxhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrhMfhjsubah}(h]h ]h"]h$]h&]uh1jhjWubeh}(h]h ]h"]h$]h&]uh1j{hjrhMfhjubj|)}(h&``out_epnum`` last used out ep number h](j)}(h ``out_epnum``h]j)}(hjh]h out_epnum}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMghjubj)}(hhh]h)}(hlast used out ep numberh]hlast used out ep number}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMghjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMghjubj|)}(h$``in_epnum`` last used in ep number h](j)}(h ``in_epnum``h]j)}(hjh]hin_epnum}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhhjubj)}(hhh]h)}(hlast used in ep numberh]hlast used in ep number}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMhhjubj|)}(h``mA`` last set mA value h](j)}(h``mA``h]j)}(hjh]hmA}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMihjubj)}(hhh]h)}(hlast set mA valueh]hlast set mA value}(hj#hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMihjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMihjubj|)}(h.``otg_caps`` OTG capabilities of this gadget. h](j)}(h ``otg_caps``h]j)}(hjAh]hotg_caps}(hhhjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMjhj;ubj)}(hhh]h)}(h OTG capabilities of this gadget.h]h OTG capabilities of this gadget.}(hj\hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhMjhjWubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1j{hjVhMjhjubj|)}(h6``sg_supported`` true if we can handle scatter-gather h](j)}(h``sg_supported``h]j)}(hjzh]h sg_supported}(hhhj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMkhjtubj)}(hhh]h)}(h$true if we can handle scatter-gatherh]h$true if we can handle scatter-gather}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMkhjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1j{hjhMkhjubj|)}(hy``is_otg`` True if the USB device port uses a Mini-AB jack, so that the gadget driver must provide a USB OTG descriptor. h](j)}(h ``is_otg``h]j)}(hjh]his_otg}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMmhjubj)}(hhh]h)}(hmTrue if the USB device port uses a Mini-AB jack, so that the gadget driver must provide a USB OTG descriptor.h]hmTrue if the USB device port uses a Mini-AB jack, so that the gadget driver must provide a USB OTG descriptor.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMlhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMmhjubj|)}(h``is_a_peripheral`` False unless is_otg, the "A" end of a USB cable is in the Mini-AB jack, and HNP has been used to switch roles so that the "A" device currently acts as A-Peripheral, not A-Host. h](j)}(h``is_a_peripheral``h]j)}(hjh]his_a_peripheral}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMphjubj)}(hhh]h)}(hFalse unless is_otg, the "A" end of a USB cable is in the Mini-AB jack, and HNP has been used to switch roles so that the "A" device currently acts as A-Peripheral, not A-Host.h]hFalse unless is_otg, the “A” end of a USB cable is in the Mini-AB jack, and HNP has been used to switch roles so that the “A” device currently acts as A-Peripheral, not A-Host.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMnhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMphjubj|)}(hZ``b_hnp_enable`` OTG device feature flag, indicating that the A-Host enabled HNP support. h](j)}(h``b_hnp_enable``h]j)}(hj'h]h b_hnp_enable}(hhhj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMvhj!ubj)}(hhh]h)}(hHOTG device feature flag, indicating that the A-Host enabled HNP support.h]hHOTG device feature flag, indicating that the A-Host enabled HNP support.}(hjBhj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMuhj=ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1j{hj<hMvhjubj|)}(ha``a_hnp_support`` OTG device feature flag, indicating that the A-Host supports HNP at this port. h](j)}(h``a_hnp_support``h]j)}(hjah]h a_hnp_support}(hhhjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMrhj[ubj)}(hhh]h)}(hNOTG device feature flag, indicating that the A-Host supports HNP at this port.h]hNOTG device feature flag, indicating that the A-Host supports HNP at this port.}(hj|hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMqhjwubah}(h]h ]h"]h$]h&]uh1jhj[ubeh}(h]h ]h"]h$]h&]uh1j{hjvhMrhjubj|)}(hv``a_alt_hnp_support`` OTG device feature flag, indicating that the A-Host only supports HNP on a different root port. h](j)}(h``a_alt_hnp_support``h]j)}(hjh]ha_alt_hnp_support}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMthjubj)}(hhh]h)}(h_OTG device feature flag, indicating that the A-Host only supports HNP on a different root port.h]h_OTG device feature flag, indicating that the A-Host only supports HNP on a different root port.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMshjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMthjubj|)}(hz``hnp_polling_support`` OTG device feature flag, indicating if the OTG device in peripheral mode can support HNP polling. h](j)}(h``hnp_polling_support``h]j)}(hjh]hhnp_polling_support}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMxhjubj)}(hhh]h)}(haOTG device feature flag, indicating if the OTG device in peripheral mode can support HNP polling.h]haOTG device feature flag, indicating if the OTG device in peripheral mode can support HNP polling.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMwhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMxhjubj|)}(hs``host_request_flag`` OTG device feature flag, indicating if A-Peripheral or B-Peripheral wants to take host role. h](j)}(h``host_request_flag``h]j)}(hjh]hhost_request_flag}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMzhj ubj)}(hhh]h)}(h\OTG device feature flag, indicating if A-Peripheral or B-Peripheral wants to take host role.h]h\OTG device feature flag, indicating if A-Peripheral or B-Peripheral wants to take host role.}(hj*hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMyhj%ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj$hMzhjubj|)}(hY``quirk_ep_out_aligned_size`` epout requires buffer size to be aligned to MaxPacketSize. h](j)}(h``quirk_ep_out_aligned_size``h]j)}(hjIh]hquirk_ep_out_aligned_size}(hhhjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM|hjCubj)}(hhh]h)}(h:epout requires buffer size to be aligned to MaxPacketSize.h]h:epout requires buffer size to be aligned to MaxPacketSize.}(hjdhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM{hj_ubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1j{hj^hM|hjubj|)}(hG``quirk_altset_not_supp`` UDC controller doesn't support alt settings. h](j)}(h``quirk_altset_not_supp``h]j)}(hjh]hquirk_altset_not_supp}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM}hj}ubj)}(hhh]h)}(h,UDC controller doesn't support alt settings.h]h.UDC controller doesn’t support alt settings.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM}hjubah}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1j{hjhM}hjubj|)}(hB``quirk_stall_not_supp`` UDC controller doesn't support stalling. h](j)}(h``quirk_stall_not_supp``h]j)}(hjh]hquirk_stall_not_supp}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM~hjubj)}(hhh]h)}(h(UDC controller doesn't support stalling.h]h*UDC controller doesn’t support stalling.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM~hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhM~hjubj|)}(h;``quirk_zlp_not_supp`` UDC controller doesn't support ZLP. h](j)}(h``quirk_zlp_not_supp``h]j)}(hjh]hquirk_zlp_not_supp}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(h#UDC controller doesn't support ZLP.h]h%UDC controller doesn’t support ZLP.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hj hMhjubj|)}(hl``quirk_avoids_skb_reserve`` udc/platform wants to avoid skb_reserve() in u_ether.c to improve performance. h](j)}(h``quirk_avoids_skb_reserve``h]j)}(hj.h]hquirk_avoids_skb_reserve}(hhhj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(ubj)}(hhh]h)}(hNudc/platform wants to avoid skb_reserve() in u_ether.c to improve performance.h]hNudc/platform wants to avoid skb_reserve() in u_ether.c to improve performance.}(hjIhjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjDubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1j{hjChMhjubj|)}(h2``is_selfpowered`` if the gadget is self-powered. h](j)}(h``is_selfpowered``h]j)}(hjhh]his_selfpowered}(hhhjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjfubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjbubj)}(hhh]h)}(hif the gadget is self-powered.h]hif the gadget is self-powered.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj}hMhj~ubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1j{hj}hMhjubj|)}(h]``deactivated`` True if gadget is deactivated - in deactivated state it cannot be connected. h](j)}(h``deactivated``h]j)}(hjh]h deactivated}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(hLTrue if gadget is deactivated - in deactivated state it cannot be connected.h]hLTrue if gadget is deactivated - in deactivated state it cannot be connected.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMhjubj|)}(h+``connected`` True if gadget is connected. h](j)}(h ``connected``h]j)}(hjh]h connected}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(hTrue if gadget is connected.h]hTrue if gadget is connected.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMhjubj|)}(h``lpm_capable`` If the gadget max_speed is FULL or HIGH, this flag indicates that it supports LPM as per the LPM ECN & errata. h](j)}(h``lpm_capable``h]j)}(hjh]h lpm_capable}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(hnIf the gadget max_speed is FULL or HIGH, this flag indicates that it supports LPM as per the LPM ECN & errata.h]hnIf the gadget max_speed is FULL or HIGH, this flag indicates that it supports LPM as per the LPM ECN & errata.}(hj/hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj*ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hj)hMhjubj|)}(hG``wakeup_capable`` True if gadget is capable of sending remote wakeup. h](j)}(h``wakeup_capable``h]j)}(hjNh]hwakeup_capable}(hhhjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjLubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjHubj)}(hhh]h)}(h3True if gadget is capable of sending remote wakeup.h]h3True if gadget is capable of sending remote wakeup.}(hjihjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhjchMhjdubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1j{hjchMhjubj|)}(hH``wakeup_armed`` True if gadget is armed by the host for remote wakeup. h](j)}(h``wakeup_armed``h]j)}(hjh]h wakeup_armed}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(h6True if gadget is armed by the host for remote wakeup.h]h6True if gadget is armed by the host for remote wakeup.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMhjubj|)}(h4``irq`` the interrupt number for device controller. h](j)}(h``irq``h]j)}(hjh]hirq}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(h+the interrupt number for device controller.h]h+the interrupt number for device controller.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMhjubj|)}(hL``id_number`` a unique ID number for ensuring that gadget names are distincth](j)}(h ``id_number``h]j)}(hjh]h id_number}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(h>a unique ID number for ensuring that gadget names are distincth]h>a unique ID number for ensuring that gadget names are distinct}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhMhjubeh}(h]h ]h"]h$]h&]uh1jvhj\ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubh)}(h**Description**h]je )}(hj<h]h Description}(hhhj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj:ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXGadgets have a mostly-portable "gadget driver" implementing device functions, handling all usb configurations and interfaces. Gadget drivers talk to hardware-specific code indirectly, through ops vectors. That insulates the gadget driver from hardware details, and packages the hardware endpoints through generic i/o queues. The "usb_gadget" and "usb_ep" interfaces provide that insulation from the hardware.h]hXGadgets have a mostly-portable “gadget driver” implementing device functions, handling all usb configurations and interfaces. Gadget drivers talk to hardware-specific code indirectly, through ops vectors. That insulates the gadget driver from hardware details, and packages the hardware endpoints through generic i/o queues. The “usb_gadget” and “usb_ep” interfaces provide that insulation from the hardware.}(hjThjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXExcept for the driver data, all fields in this structure are read-only to the gadget driver. That driver data is part of the "driver model" infrastructure in 2.6 (and later) kernels, and for earlier systems is grouped in a similar structure that's not known to the rest of the kernel.h]hX#Except for the driver data, all fields in this structure are read-only to the gadget driver. That driver data is part of the “driver model” infrastructure in 2.6 (and later) kernels, and for earlier systems is grouped in a similar structure that’s not known to the rest of the kernel.}(hjchjahhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXValues of the three OTG device feature flags are updated before the setup() call corresponding to USB_REQ_SET_CONFIGURATION, and before driver suspend() calls. They are valid only when is_otg, and when the device is acting as a B-Peripheral (so is_a_peripheral is false).h]hXValues of the three OTG device feature flags are updated before the setup() call corresponding to USB_REQ_SET_CONFIGURATION, and before driver suspend() calls. They are valid only when is_otg, and when the device is acting as a B-Peripheral (so is_a_peripheral is false).}(hjrhjphhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep_align (C function)c.usb_ep_alignhNtauh1jhjhhhNhNubj)}(hhh](j)}(h3size_t usb_ep_align (struct usb_ep *ep, size_t len)h]j)}(h2size_t usb_ep_align(struct usb_ep *ep, size_t len)h](h)}(hhh]j )}(hsize_th]hsize_t}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}j usb_ep_alignsbc.usb_ep_alignasbuh1hhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj )}(h usb_ep_alignh]j )}(hjh]h usb_ep_align}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjhhhjhMubhdesc_parameterlist)}(h(struct usb_ep *ep, size_t len)h](hdesc_parameter)}(hstruct usb_ep *eph](j)}(hjh]hstruct}(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j )}(husb_eph]husb_ep}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]jc.usb_ep_alignasbuh1hhjubj)}(h h]h }(hhhj2hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(h*h]h*}(hhhjBhhhNhNubah}(h]h ]pah"]h$]h&]uh1j@hjubj )}(heph]hep}(hhhjQhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjubj)}(h size_t lenh](h)}(hhh]j )}(hsize_th]hsize_t}(hhhjmhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjomodnameN classnameNjj)}j]jc.usb_ep_alignasbuh1hhjfubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfubj )}(hlenh]hlen}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjfubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjubeh}(h]h ]h"]h$]h&]j j! uh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjhhhjhMubah}(h]jah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubj6 )}(hhh]h)}(h.returns **len** aligned to ep's maxpacketsize.h](hreturns }(hreturns hjhhhNhNubje )}(h**len**h]hlen}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubh! aligned to ep’s maxpacketsize.}(h aligned to ep's maxpacketsize.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubah}(h]h ]h"]h$]h&]uh1j5 hjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jjX jjY uh1jhhhjhNhNubj[ )}(hX**Parameters** ``struct usb_ep *ep`` the endpoint whose maxpacketsize is used to align **len** ``size_t len`` buffer size's length to align to **ep**'s maxpacketsize **Description** This helper is used to align buffer's size to an ep's maxpacketsize.h](h)}(h**Parameters**h]je )}(hjh]h Parameters}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubjw)}(hhh](j|)}(hP``struct usb_ep *ep`` the endpoint whose maxpacketsize is used to align **len** h](j)}(h``struct usb_ep *ep``h]j)}(hj h]hstruct usb_ep *ep}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj ubj)}(hhh]h)}(h9the endpoint whose maxpacketsize is used to align **len**h](h2the endpoint whose maxpacketsize is used to align }(h2the endpoint whose maxpacketsize is used to align hj2 hhhNhNubje )}(h**len**h]hlen}(hhhj; hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj2 ubeh}(h]h ]h"]h$]h&]uh1hhj. hMhj/ ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j{hj. hMhj ubj|)}(hG``size_t len`` buffer size's length to align to **ep**'s maxpacketsize h](j)}(h``size_t len``h]j)}(hja h]h size_t len}(hhhjc hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj[ ubj)}(hhh]h)}(h7buffer size's length to align to **ep**'s maxpacketsizeh](h#buffer size’s length to align to }(h!buffer size's length to align to hjz hhhNhNubje )}(h**ep**h]hep}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjz ubh’s maxpacketsize}(h's maxpacketsizehjz hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjv hMhjw ubah}(h]h ]h"]h$]h&]uh1jhj[ ubeh}(h]h ]h"]h$]h&]uh1j{hjv hMhj ubeh}(h]h ]h"]h$]h&]uh1jvhjubh)}(h**Description**h]je )}(hj h]h Description}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubh)}(hDThis helper is used to align buffer's size to an ep's maxpacketsize.h]hHThis helper is used to align buffer’s size to an ep’s maxpacketsize.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep_align_maybe (C function)c.usb_ep_align_maybehNtauh1jhjhhhNhNubj)}(hhh](j)}(hOsize_t usb_ep_align_maybe (struct usb_gadget *g, struct usb_ep *ep, size_t len)h]j)}(hNsize_t usb_ep_align_maybe(struct usb_gadget *g, struct usb_ep *ep, size_t len)h](h)}(hhh]j )}(hsize_th]hsize_t}(hhhj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj modnameN classnameNjj)}j]j)}jusb_ep_align_maybesbc.usb_ep_align_maybeasbuh1hhj hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj!hMubj )}(husb_ep_align_maybeh]j )}(hj!h]husb_ep_align_maybe}(hhhj,!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj(!ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj hhhj!hMubj)}(h5(struct usb_gadget *g, struct usb_ep *ep, size_t len)h](j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhjG!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjC!ubj)}(h h]h }(hhhjT!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjC!ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhje!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjb!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjg!modnameN classnameNjj)}j]j!c.usb_ep_align_maybeasbuh1hhjC!ubj)}(h h]h }(hhhj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjC!ubjA)}(hjDh]h*}(hhhj!hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjC!ubj )}(hgh]hg}(hhhj!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjC!ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj?!ubj)}(hstruct usb_ep *eph](j)}(hjh]hstruct}(hhhj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(h h]h }(hhhj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubh)}(hhh]j )}(husb_eph]husb_ep}(hhhj!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj!modnameN classnameNjj)}j]j!c.usb_ep_align_maybeasbuh1hhj!ubj)}(h h]h }(hhhj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubjA)}(hjDh]h*}(hhhj"hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj!ubj )}(heph]hep}(hhhj"hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj!ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj?!ubj)}(h size_t lenh](h)}(hhh]j )}(hsize_th]hsize_t}(hhhj*"hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj'"ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj,"modnameN classnameNjj)}j]j!c.usb_ep_align_maybeasbuh1hhj#"ubj)}(h h]h }(hhhjH"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#"ubj )}(hlenh]hlen}(hhhjV"hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj#"ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj?!ubeh}(h]h ]h"]h$]h&]j j! uh1jhj hhhj!hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj hhhj!hMubah}(h]j ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj hhubj6 )}(hhh]h)}(hrreturns **len** aligned to ep's maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise returns len.h](hreturns }(hreturns hj"hhhNhNubje )}(h**len**h]hlen}(hhhj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj"ubhe aligned to ep’s maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise returns len.}(hc aligned to ep's maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise returns len.hj"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj~"hhubah}(h]h ]h"]h$]h&]uh1j5 hj hhhj!hMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j"jX j"jY uh1jhhhjhNhNubj[ )}(hXq**Parameters** ``struct usb_gadget *g`` controller to check for quirk ``struct usb_ep *ep`` the endpoint whose maxpacketsize is used to align **len** ``size_t len`` buffer size's length to align to **ep**'s maxpacketsize **Description** This helper is used in case it's required for any reason to check and maybe align buffer's size to an ep's maxpacketsize.h](h)}(h**Parameters**h]je )}(hj"h]h Parameters}(hhhj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj"ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj"ubjw)}(hhh](j|)}(h7``struct usb_gadget *g`` controller to check for quirk h](j)}(h``struct usb_gadget *g``h]j)}(hj"h]hstruct usb_gadget *g}(hhhj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj"ubj)}(hhh]h)}(hcontroller to check for quirkh]hcontroller to check for quirk}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hMhj"ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1j{hj"hMhj"ubj|)}(hP``struct usb_ep *ep`` the endpoint whose maxpacketsize is used to align **len** h](j)}(h``struct usb_ep *ep``h]j)}(hj#h]hstruct usb_ep *ep}(hhhj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj #ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj #ubj)}(hhh]h)}(h9the endpoint whose maxpacketsize is used to align **len**h](h2the endpoint whose maxpacketsize is used to align }(h2the endpoint whose maxpacketsize is used to align hj(#hhhNhNubje )}(h**len**h]hlen}(hhhj1#hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj(#ubeh}(h]h ]h"]h$]h&]uh1hhj$#hMhj%#ubah}(h]h ]h"]h$]h&]uh1jhj #ubeh}(h]h ]h"]h$]h&]uh1j{hj$#hMhj"ubj|)}(hG``size_t len`` buffer size's length to align to **ep**'s maxpacketsize h](j)}(h``size_t len``h]j)}(hjW#h]h size_t len}(hhhjY#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjU#ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjQ#ubj)}(hhh]h)}(h7buffer size's length to align to **ep**'s maxpacketsizeh](h#buffer size’s length to align to }(h!buffer size's length to align to hjp#hhhNhNubje )}(h**ep**h]hep}(hhhjy#hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjp#ubh’s maxpacketsize}(h's maxpacketsizehjp#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjl#hMhjm#ubah}(h]h ]h"]h$]h&]uh1jhjQ#ubeh}(h]h ]h"]h$]h&]uh1j{hjl#hMhj"ubeh}(h]h ]h"]h$]h&]uh1jvhj"ubh)}(h**Description**h]je )}(hj#h]h Description}(hhhj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj#ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj"ubh)}(hyThis helper is used in case it's required for any reason to check and maybe align buffer's size to an ep's maxpacketsize.h]hThis helper is used in case it’s required for any reason to check and maybe align buffer’s size to an ep’s maxpacketsize.}(hj#hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj"ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j'gadget_is_altset_supported (C function)c.gadget_is_altset_supportedhNtauh1jhjhhhNhNubj)}(hhh](j)}(h5int gadget_is_altset_supported (struct usb_gadget *g)h]j)}(h4int gadget_is_altset_supported(struct usb_gadget *g)h](hdesc_sig_keyword_type)}(hinth]hint}(hhhj#hhhNhNubah}(h]h ]ktah"]h$]h&]uh1j#hj#hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#hhhj#hMubj )}(hgadget_is_altset_supportedh]j )}(hgadget_is_altset_supportedh]hgadget_is_altset_supported}(hhhj$hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj $ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj#hhhj#hMubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj+$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'$ubj)}(h h]h }(hhhj8$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'$ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhjI$hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjF$ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjK$modnameN classnameNjj)}j]j)}jj$sbc.gadget_is_altset_supportedasbuh1hhj'$ubj)}(h h]h }(hhhji$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'$ubjA)}(hjDh]h*}(hhhjw$hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj'$ubj )}(hj!h]hg}(hhhj$hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj'$ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj#$ubah}(h]h ]h"]h$]h&]j j! uh1jhj#hhhj#hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj#hhhj#hMubah}(h]j#ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj#hhubj6 )}(hhh]h)}(h1return true iff the hardware supports altsettingsh]h1return true iff the hardware supports altsettings}(hj$hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj$hhubah}(h]h ]h"]h$]h&]uh1j5 hj#hhhj#hMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j$jX j$jY uh1jhhhjhNhNubj[ )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]je )}(hj$h]h Parameters}(hhhj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj$ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj$ubjw)}(hhh]j|)}(h6``struct usb_gadget *g`` controller to check for quirkh](j)}(h``struct usb_gadget *g``h]j)}(hj$h]hstruct usb_gadget *g}(hhhj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj$ubj)}(hhh]h)}(hcontroller to check for quirkh]hcontroller to check for quirk}(hj %hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj%ubah}(h]h ]h"]h$]h&]uh1jhj$ubeh}(h]h ]h"]h$]h&]uh1j{hj%hMhj$ubah}(h]h ]h"]h$]h&]uh1jvhj$ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&gadget_is_stall_supported (C function)c.gadget_is_stall_supportedhNtauh1jhjhhhNhNubj)}(hhh](j)}(h4int gadget_is_stall_supported (struct usb_gadget *g)h]j)}(h3int gadget_is_stall_supported(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhjI%hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjE%hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhjX%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjE%hhhjW%hMubj )}(hgadget_is_stall_supportedh]j )}(hgadget_is_stall_supportedh]hgadget_is_stall_supported}(hhhjj%hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjf%ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjE%hhhjW%hMubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj%ubj)}(h h]h }(hhhj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj%ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhj%hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj%ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj%modnameN classnameNjj)}j]j)}jjl%sbc.gadget_is_stall_supportedasbuh1hhj%ubj)}(h h]h }(hhhj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj%ubjA)}(hjDh]h*}(hhhj%hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj%ubj )}(hj!h]hg}(hhhj%hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj%ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj~%ubah}(h]h ]h"]h$]h&]j j! uh1jhjE%hhhjW%hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjA%hhhjW%hMubah}(h]j<%ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj>%hhubj6 )}(hhh]h)}(h.return true iff the hardware supports stallingh]h.return true iff the hardware supports stalling}(hj &hj &hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj&hhubah}(h]h ]h"]h$]h&]uh1j5 hj>%hhhjW%hMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j!&jX j!&jY uh1jhhhjhNhNubj[ )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]je )}(hj+&h]h Parameters}(hhhj-&hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj)&ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj%&ubjw)}(hhh]j|)}(h6``struct usb_gadget *g`` controller to check for quirkh](j)}(h``struct usb_gadget *g``h]j)}(hjJ&h]hstruct usb_gadget *g}(hhhjL&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjH&ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjD&ubj)}(hhh]h)}(hcontroller to check for quirkh]hcontroller to check for quirk}(hje&hjc&hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`&ubah}(h]h ]h"]h$]h&]uh1jhjD&ubeh}(h]h ]h"]h$]h&]uh1j{hj_&hMhjA&ubah}(h]h ]h"]h$]h&]uh1jvhj%&ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$gadget_is_zlp_supported (C function)c.gadget_is_zlp_supportedhNtauh1jhjhhhNhNubj)}(hhh](j)}(h2int gadget_is_zlp_supported (struct usb_gadget *g)h]j)}(h1int gadget_is_zlp_supported(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhj&hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj&hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM"ubj)}(h h]h }(hhhj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&hhhj&hM"ubj )}(hgadget_is_zlp_supportedh]j )}(hgadget_is_zlp_supportedh]hgadget_is_zlp_supported}(hhhj&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj&ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj&hhhj&hM"ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubj)}(h h]h }(hhhj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhj&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj&ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj'modnameN classnameNjj)}j]j)}jj&sbc.gadget_is_zlp_supportedasbuh1hhj&ubj)}(h h]h }(hhhj'hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubjA)}(hjDh]h*}(hhhj-'hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj&ubj )}(hj!h]hg}(hhhj:'hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj&ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj&ubah}(h]h ]h"]h$]h&]j j! uh1jhj&hhhj&hM"ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj&hhhj&hM"ubah}(h]j&ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM$hj&hhubj6 )}(hhh]h)}(h)return true iff the hardware supports zlph]h)return true iff the hardware supports zlp}(hjf'hjd'hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM!hja'hhubah}(h]h ]h"]h$]h&]uh1j5 hj&hhhj&hM"ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j|'jX j|'jY uh1jhhhjhNhNubj[ )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]je )}(hj'h]h Parameters}(hhhj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj'ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM%hj'ubjw)}(hhh]j|)}(h6``struct usb_gadget *g`` controller to check for quirkh](j)}(h``struct usb_gadget *g``h]j)}(hj'h]hstruct usb_gadget *g}(hhhj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM'hj'ubj)}(hhh]h)}(hcontroller to check for quirkh]hcontroller to check for quirk}(hj'hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM"hj'ubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1j{hj'hM'hj'ubah}(h]h ]h"]h$]h&]uh1jvhj'ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&gadget_avoids_skb_reserve (C function)c.gadget_avoids_skb_reservehNtauh1jhjhhhNhNubj)}(hhh](j)}(h4int gadget_avoids_skb_reserve (struct usb_gadget *g)h]j)}(h3int gadget_avoids_skb_reserve(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhj'hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj'hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM+ubj)}(h h]h }(hhhj(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'hhhj (hM+ubj )}(hgadget_avoids_skb_reserveh]j )}(hgadget_avoids_skb_reserveh]hgadget_avoids_skb_reserve}(hhhj (hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj(ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj'hhhj (hM+ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj<(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8(ubj)}(h h]h }(hhhjI(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8(ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhjZ(hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjW(ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj\(modnameN classnameNjj)}j]j)}jj"(sbc.gadget_avoids_skb_reserveasbuh1hhj8(ubj)}(h h]h }(hhhjz(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8(ubjA)}(hjDh]h*}(hhhj(hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj8(ubj )}(hj!h]hg}(hhhj(hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj8(ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj4(ubah}(h]h ]h"]h$]h&]j j! uh1jhj'hhhj (hM+ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj'hhhj (hM+ubah}(h]j'ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM.hj'hhubj6 )}(hhh]h)}(hTreturn true iff the hardware would like to avoid skb_reserve to improve performance.h]hTreturn true iff the hardware would like to avoid skb_reserve to improve performance.}(hj(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM*hj(hhubah}(h]h ]h"]h$]h&]uh1j5 hj'hhhj (hM+ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j(jX j(jY uh1jhhhjhNhNubj[ )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]je )}(hj(h]h Parameters}(hhhj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj(ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM.hj(ubjw)}(hhh]j|)}(h6``struct usb_gadget *g`` controller to check for quirkh](j)}(h``struct usb_gadget *g``h]j)}(hj)h]hstruct usb_gadget *g}(hhhj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM0hj(ubj)}(hhh]h)}(hcontroller to check for quirkh]hcontroller to check for quirk}(hj)hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM,hj)ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1j{hj)hM0hj(ubah}(h]h ]h"]h$]h&]uh1jvhj(ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j gadget_is_dualspeed (C function)c.gadget_is_dualspeedhNtauh1jhjhhhNhNubj)}(hhh](j)}(h.int gadget_is_dualspeed (struct usb_gadget *g)h]j)}(h-int gadget_is_dualspeed(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhjZ)hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjV)hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM5ubj)}(h h]h }(hhhji)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV)hhhjh)hM5ubj )}(hgadget_is_dualspeedh]j )}(hgadget_is_dualspeedh]hgadget_is_dualspeed}(hhhj{)hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjw)ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjV)hhhjh)hM5ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj)ubj)}(h h]h }(hhhj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj)ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhj)hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj)ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj)modnameN classnameNjj)}j]j)}jj})sbc.gadget_is_dualspeedasbuh1hhj)ubj)}(h h]h }(hhhj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj)ubjA)}(hjDh]h*}(hhhj)hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj)ubj )}(hj!h]hg}(hhhj)hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj)ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj)ubah}(h]h ]h"]h$]h&]j j! uh1jhjV)hhhjh)hM5ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjR)hhhjh)hM5ubah}(h]jM)ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM7hjO)hhubj6 )}(hhh]h)}(h/return true iff the hardware handles high speedh]h/return true iff the hardware handles high speed}(hj*hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM4hj*hhubah}(h]h ]h"]h$]h&]uh1j5 hjO)hhhjh)hM5ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j2*jX j2*jY uh1jhhhjhNhNubj[ )}(hb**Parameters** ``struct usb_gadget *g`` controller that might support both high and full speedsh](h)}(h**Parameters**h]je )}(hj<*h]h Parameters}(hhhj>*hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj:*ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM8hj6*ubjw)}(hhh]j|)}(hP``struct usb_gadget *g`` controller that might support both high and full speedsh](j)}(h``struct usb_gadget *g``h]j)}(hj[*h]hstruct usb_gadget *g}(hhhj]*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjY*ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM:hjU*ubj)}(hhh]h)}(h7controller that might support both high and full speedsh]h7controller that might support both high and full speeds}(hjv*hjt*hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM5hjq*ubah}(h]h ]h"]h$]h&]uh1jhjU*ubeh}(h]h ]h"]h$]h&]uh1j{hjp*hM:hjR*ubah}(h]h ]h"]h$]h&]uh1jvhj6*ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!gadget_is_superspeed (C function)c.gadget_is_superspeedhNtauh1jhjhhhNhNubj)}(hhh](j)}(h/int gadget_is_superspeed (struct usb_gadget *g)h]j)}(h.int gadget_is_superspeed(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhj*hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj*hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM>ubj)}(h h]h }(hhhj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*hhhj*hM>ubj )}(hgadget_is_superspeedh]j )}(hgadget_is_superspeedh]hgadget_is_superspeed}(hhhj*hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj*ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj*hhhj*hM>ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj)}(h h]h }(hhhj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhj+hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj +ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj+modnameN classnameNjj)}j]j)}jj*sbc.gadget_is_superspeedasbuh1hhj*ubj)}(h h]h }(hhhj0+hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubjA)}(hjDh]h*}(hhhj>+hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj*ubj )}(hj!h]hg}(hhhjK+hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj*ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj*ubah}(h]h ]h"]h$]h&]j j! uh1jhj*hhhj*hM>ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj*hhhj*hM>ubah}(h]j*ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM@hj*hhubj6 )}(hhh]h)}(h.return true if the hardware handles superspeedh]h.return true if the hardware handles superspeed}(hjw+hju+hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM=hjr+hhubah}(h]h ]h"]h$]h&]uh1j5 hj*hhhj*hM>ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j+jX j+jY uh1jhhhjhNhNubj[ )}(hS**Parameters** ``struct usb_gadget *g`` controller that might support superspeedh](h)}(h**Parameters**h]je )}(hj+h]h Parameters}(hhhj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj+ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMAhj+ubjw)}(hhh]j|)}(hA``struct usb_gadget *g`` controller that might support superspeedh](j)}(h``struct usb_gadget *g``h]j)}(hj+h]hstruct usb_gadget *g}(hhhj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMChj+ubj)}(hhh]h)}(h(controller that might support superspeedh]h(controller that might support superspeed}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM>hj+ubah}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1j{hj+hMChj+ubah}(h]h ]h"]h$]h&]uh1jvhj+ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&gadget_is_superspeed_plus (C function)c.gadget_is_superspeed_plushNtauh1jhjhhhNhNubj)}(hhh](j)}(h4int gadget_is_superspeed_plus (struct usb_gadget *g)h]j)}(h3int gadget_is_superspeed_plus(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhj,hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj ,hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMGubj)}(h h]h }(hhhj,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ,hhhj,hMGubj )}(hgadget_is_superspeed_plush]j )}(hgadget_is_superspeed_plush]hgadget_is_superspeed_plus}(hhhj1,hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj-,ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj ,hhhj,hMGubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhjM,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjI,ubj)}(h h]h }(hhhjZ,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjI,ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhjk,hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjh,ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjm,modnameN classnameNjj)}j]j)}jj3,sbc.gadget_is_superspeed_plusasbuh1hhjI,ubj)}(h h]h }(hhhj,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjI,ubjA)}(hjDh]h*}(hhhj,hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjI,ubj )}(hj!h]hg}(hhhj,hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjI,ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjE,ubah}(h]h ]h"]h$]h&]j j! uh1jhj ,hhhj,hMGubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj,hhhj,hMGubah}(h]j,ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMJhj,hhubj6 )}(hhh]h)}(h3return true if the hardware handles superspeed plush]h3return true if the hardware handles superspeed plus}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMFhj,hhubah}(h]h ]h"]h$]h&]uh1j5 hj,hhhj,hMGubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j,jX j,jY uh1jhhhjhNhNubj[ )}(hX**Parameters** ``struct usb_gadget *g`` controller that might support superspeed plush](h)}(h**Parameters**h]je )}(hj,h]h Parameters}(hhhj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj,ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMJhj,ubjw)}(hhh]j|)}(hF``struct usb_gadget *g`` controller that might support superspeed plush](j)}(h``struct usb_gadget *g``h]j)}(hj-h]hstruct usb_gadget *g}(hhhj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMLhj -ubj)}(hhh]h)}(h-controller that might support superspeed plush]h-controller that might support superspeed plus}(hj,-hj*-hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMHhj'-ubah}(h]h ]h"]h$]h&]uh1jhj -ubeh}(h]h ]h"]h$]h&]uh1j{hj&-hMLhj-ubah}(h]h ]h"]h$]h&]uh1jvhj,ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jgadget_is_otg (C function)c.gadget_is_otghNtauh1jhjhhhNhNubj)}(hhh](j)}(h(int gadget_is_otg (struct usb_gadget *g)h]j)}(h'int gadget_is_otg(struct usb_gadget *g)h](j#)}(hinth]hint}(hhhjk-hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjg-hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMQubj)}(h h]h }(hhhjz-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjg-hhhjy-hMQubj )}(h gadget_is_otgh]j )}(h gadget_is_otgh]h gadget_is_otg}(hhhj-hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj-ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjg-hhhjy-hMQubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj-ubj)}(h h]h }(hhhj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj-ubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhj-hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj-ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj-modnameN classnameNjj)}j]j)}jj-sbc.gadget_is_otgasbuh1hhj-ubj)}(h h]h }(hhhj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj-ubjA)}(hjDh]h*}(hhhj-hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj-ubj )}(hj!h]hg}(hhhj.hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj-ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj-ubah}(h]h ]h"]h$]h&]j j! uh1jhjg-hhhjy-hMQubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjc-hhhjy-hMQubah}(h]j^-ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMVhj`-hhubj6 )}(hhh]h)}(h)return true iff the hardware is OTG-readyh]h)return true iff the hardware is OTG-ready}(hj-.hj+.hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMPhj(.hhubah}(h]h ]h"]h$]h&]uh1j5 hj`-hhhjy-hMQubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jC.jX jC.jY uh1jhhhjhNhNubj[ )}(h**Parameters** ``struct usb_gadget *g`` controller that might have a Mini-AB connector **Description** This is a runtime test, since kernels with a USB-OTG stack sometimes run on boards which only have a Mini-B (or Mini-A) connector.h](h)}(h**Parameters**h]je )}(hjM.h]h Parameters}(hhhjO.hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjK.ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMThjG.ubjw)}(hhh]j|)}(hH``struct usb_gadget *g`` controller that might have a Mini-AB connector h](j)}(h``struct usb_gadget *g``h]j)}(hjl.h]hstruct usb_gadget *g}(hhhjn.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjj.ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMQhjf.ubj)}(hhh]h)}(h.controller that might have a Mini-AB connectorh]h.controller that might have a Mini-AB connector}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hMQhj.ubah}(h]h ]h"]h$]h&]uh1jhjf.ubeh}(h]h ]h"]h$]h&]uh1j{hj.hMQhjc.ubah}(h]h ]h"]h$]h&]uh1jvhjG.ubh)}(h**Description**h]je )}(hj.h]h Description}(hhhj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj.ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMShjG.ubh)}(hThis is a runtime test, since kernels with a USB-OTG stack sometimes run on boards which only have a Mini-B (or Mini-A) connector.h]hThis is a runtime test, since kernels with a USB-OTG stack sometimes run on boards which only have a Mini-B (or Mini-A) connector.}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMShjG.ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_gadget_driver (C struct)c.usb_gadget_driverhNtauh1jhjhhhNhNubj)}(hhh](j)}(husb_gadget_driverh]j)}(hstruct usb_gadget_driverh](j)}(hjh]hstruct}(hhhj.hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhj.hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.hhhj.hMubj )}(husb_gadget_driverh]j )}(hj.h]husb_gadget_driver}(hhhj /hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj/ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj.hhhj.hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj.hhhj.hMubah}(h]j.ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMYhj.hhubj6 )}(hhh]h)}(hdriver for usb gadget devicesh]hdriver for usb gadget devices}(hj1/hj//hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj,/hhubah}(h]h ]h"]h$]h&]uh1j5 hj.hhhj.hMubeh}(h]h ](jstructeh"]h$]h&]jV jjW jG/jX jG/jY uh1jhhhjhNhNubj[ )}(hXh**Definition**:: struct usb_gadget_driver { char *function; enum usb_device_speed max_speed; int (*bind)(struct usb_gadget *gadget, struct usb_gadget_driver *driver); void (*unbind)(struct usb_gadget *); int (*setup)(struct usb_gadget *, const struct usb_ctrlrequest *); void (*disconnect)(struct usb_gadget *); void (*suspend)(struct usb_gadget *); void (*resume)(struct usb_gadget *); void (*reset)(struct usb_gadget *); struct device_driver driver; char *udc_name; unsigned match_existing_only:1; bool is_bound:1; }; **Members** ``function`` String describing the gadget's function ``max_speed`` Highest speed the driver handles. ``bind`` the driver's bind callback ``unbind`` Invoked when the driver is unbound from a gadget, usually from rmmod (after a disconnect is reported). Called in a context that permits sleeping. ``setup`` Invoked for ep0 control requests that aren't handled by the hardware level driver. Most calls must be handled by the gadget driver, including descriptor and configuration management. The 16 bit members of the setup data are in USB byte order. Called in_interrupt; this may not sleep. Driver queues a response to ep0, or returns negative to stall. ``disconnect`` Invoked after all transfers have been stopped, when the host is disconnected. May be called in_interrupt; this may not sleep. Some devices can't detect disconnect, so this might not be called except as part of controller shutdown. ``suspend`` Invoked on USB suspend. May be called in_interrupt. ``resume`` Invoked on USB resume. May be called in_interrupt. ``reset`` Invoked on USB bus reset. It is mandatory for all gadget drivers and should be called in_interrupt. ``driver`` Driver model state for this driver. ``udc_name`` A name of UDC this driver should be bound to. If udc_name is NULL, this driver will be bound to any available UDC. ``match_existing_only`` If udc is not found, return an error and fail the driver registration ``is_bound`` Allow a driver to be bound to only one gadgeth](h)}(h**Definition**::h](je )}(h**Definition**h]h Definition}(hhhjS/hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjO/ubh:}(hjx hjO/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjK/ubj )}(hX/struct usb_gadget_driver { char *function; enum usb_device_speed max_speed; int (*bind)(struct usb_gadget *gadget, struct usb_gadget_driver *driver); void (*unbind)(struct usb_gadget *); int (*setup)(struct usb_gadget *, const struct usb_ctrlrequest *); void (*disconnect)(struct usb_gadget *); void (*suspend)(struct usb_gadget *); void (*resume)(struct usb_gadget *); void (*reset)(struct usb_gadget *); struct device_driver driver; char *udc_name; unsigned match_existing_only:1; bool is_bound:1; };h]hX/struct usb_gadget_driver { char *function; enum usb_device_speed max_speed; int (*bind)(struct usb_gadget *gadget, struct usb_gadget_driver *driver); void (*unbind)(struct usb_gadget *); int (*setup)(struct usb_gadget *, const struct usb_ctrlrequest *); void (*disconnect)(struct usb_gadget *); void (*suspend)(struct usb_gadget *); void (*resume)(struct usb_gadget *); void (*reset)(struct usb_gadget *); struct device_driver driver; char *udc_name; unsigned match_existing_only:1; bool is_bound:1; };}(hhhjl/ubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjK/ubh)}(h **Members**h]je )}(hj}/h]hMembers}(hhhj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj{/ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjK/ubjw)}(hhh](j|)}(h5``function`` String describing the gadget's function h](j)}(h ``function``h]j)}(hj/h]hfunction}(hhhj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj/ubj)}(hhh]h)}(h'String describing the gadget's functionh]h)String describing the gadget’s function}(hj/hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/hMhj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1j{hj/hMhj/ubj|)}(h0``max_speed`` Highest speed the driver handles. h](j)}(h ``max_speed``h]j)}(hj/h]h max_speed}(hhhj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj/ubj)}(hhh]h)}(h!Highest speed the driver handles.h]h!Highest speed the driver handles.}(hj/hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/hMhj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1j{hj/hMhj/ubj|)}(h$``bind`` the driver's bind callback h](j)}(h``bind``h]j)}(hj0h]hbind}(hhhj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj 0ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj0ubj)}(hhh]h)}(hthe driver's bind callbackh]hthe driver’s bind callback}(hj)0hj'0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#0hMhj$0ubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1j{hj#0hMhj/ubj|)}(h``unbind`` Invoked when the driver is unbound from a gadget, usually from rmmod (after a disconnect is reported). Called in a context that permits sleeping. h](j)}(h ``unbind``h]j)}(hjG0h]hunbind}(hhhjI0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjE0ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjA0ubj)}(hhh]h)}(hInvoked when the driver is unbound from a gadget, usually from rmmod (after a disconnect is reported). Called in a context that permits sleeping.h]hInvoked when the driver is unbound from a gadget, usually from rmmod (after a disconnect is reported). Called in a context that permits sleeping.}(hjb0hj`0hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj]0ubah}(h]h ]h"]h$]h&]uh1jhjA0ubeh}(h]h ]h"]h$]h&]uh1j{hj\0hMhj/ubj|)}(hXg``setup`` Invoked for ep0 control requests that aren't handled by the hardware level driver. Most calls must be handled by the gadget driver, including descriptor and configuration management. The 16 bit members of the setup data are in USB byte order. Called in_interrupt; this may not sleep. Driver queues a response to ep0, or returns negative to stall. h](j)}(h ``setup``h]j)}(hj0h]hsetup}(hhhj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj{0ubj)}(hhh]h)}(hX\Invoked for ep0 control requests that aren't handled by the hardware level driver. Most calls must be handled by the gadget driver, including descriptor and configuration management. The 16 bit members of the setup data are in USB byte order. Called in_interrupt; this may not sleep. Driver queues a response to ep0, or returns negative to stall.h]hX^Invoked for ep0 control requests that aren’t handled by the hardware level driver. Most calls must be handled by the gadget driver, including descriptor and configuration management. The 16 bit members of the setup data are in USB byte order. Called in_interrupt; this may not sleep. Driver queues a response to ep0, or returns negative to stall.}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj0ubah}(h]h ]h"]h$]h&]uh1jhj{0ubeh}(h]h ]h"]h$]h&]uh1j{hj0hMhj/ubj|)}(h``disconnect`` Invoked after all transfers have been stopped, when the host is disconnected. May be called in_interrupt; this may not sleep. Some devices can't detect disconnect, so this might not be called except as part of controller shutdown. h](j)}(h``disconnect``h]j)}(hj0h]h disconnect}(hhhj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj0ubj)}(hhh]h)}(hInvoked after all transfers have been stopped, when the host is disconnected. May be called in_interrupt; this may not sleep. Some devices can't detect disconnect, so this might not be called except as part of controller shutdown.h]hInvoked after all transfers have been stopped, when the host is disconnected. May be called in_interrupt; this may not sleep. Some devices can’t detect disconnect, so this might not be called except as part of controller shutdown.}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj0ubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1j{hj0hMhj/ubj|)}(hA``suspend`` Invoked on USB suspend. May be called in_interrupt. h](j)}(h ``suspend``h]j)}(hj0h]hsuspend}(hhhj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj0ubj)}(hhh]h)}(h4Invoked on USB suspend. May be called in_interrupt.h]h4Invoked on USB suspend. May be called in_interrupt.}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj 1hMhj 1ubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1j{hj 1hMhj/ubj|)}(h?``resume`` Invoked on USB resume. May be called in_interrupt. h](j)}(h ``resume``h]j)}(hj.1h]hresume}(hhhj01hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,1ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(1ubj)}(hhh]h)}(h3Invoked on USB resume. May be called in_interrupt.h]h3Invoked on USB resume. May be called in_interrupt.}(hjI1hjG1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjC1hMhjD1ubah}(h]h ]h"]h$]h&]uh1jhj(1ubeh}(h]h ]h"]h$]h&]uh1j{hjC1hMhj/ubj|)}(hn``reset`` Invoked on USB bus reset. It is mandatory for all gadget drivers and should be called in_interrupt. h](j)}(h ``reset``h]j)}(hjg1h]hreset}(hhhji1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje1ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhja1ubj)}(hhh]h)}(hcInvoked on USB bus reset. It is mandatory for all gadget drivers and should be called in_interrupt.h]hcInvoked on USB bus reset. It is mandatory for all gadget drivers and should be called in_interrupt.}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj}1ubah}(h]h ]h"]h$]h&]uh1jhja1ubeh}(h]h ]h"]h$]h&]uh1j{hj|1hMhj/ubj|)}(h/``driver`` Driver model state for this driver. h](j)}(h ``driver``h]j)}(hj1h]hdriver}(hhhj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj1ubj)}(hhh]h)}(h#Driver model state for this driver.h]h#Driver model state for this driver.}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1hMhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1j{hj1hMhj/ubj|)}(h``udc_name`` A name of UDC this driver should be bound to. If udc_name is NULL, this driver will be bound to any available UDC. h](j)}(h ``udc_name``h]j)}(hj1h]hudc_name}(hhhj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj1ubj)}(hhh]h)}(hrA name of UDC this driver should be bound to. If udc_name is NULL, this driver will be bound to any available UDC.h]hrA name of UDC this driver should be bound to. If udc_name is NULL, this driver will be bound to any available UDC.}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1j{hj1hMhj/ubj|)}(h^``match_existing_only`` If udc is not found, return an error and fail the driver registration h](j)}(h``match_existing_only``h]j)}(hj2h]hmatch_existing_only}(hhhj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj2ubj)}(hhh]h)}(hEIf udc is not found, return an error and fail the driver registrationh]hEIf udc is not found, return an error and fail the driver registration}(hj/2hj-2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj*2ubah}(h]h ]h"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]uh1j{hj)2hMhj/ubj|)}(h:``is_bound`` Allow a driver to be bound to only one gadgeth](j)}(h ``is_bound``h]j)}(hjN2h]his_bound}(hhhjP2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjL2ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjH2ubj)}(hhh]h)}(h-Allow a driver to be bound to only one gadgeth]h-Allow a driver to be bound to only one gadget}(hji2hjg2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjd2ubah}(h]h ]h"]h$]h&]uh1jhjH2ubeh}(h]h ]h"]h$]h&]uh1j{hjc2hMhj/ubeh}(h]h ]h"]h$]h&]uh1jvhjK/ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubh)}(h**Description**h]je )}(hj2h]h Description}(hhhj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj2ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hDevices are disabled till a gadget driver successfully bind()s, which means the driver will handle setup() requests needed to enumerate (and meet "chapter 9" requirements) then do some useful work.h]hDevices are disabled till a gadget driver successfully bind()s, which means the driver will handle setup() requests needed to enumerate (and meet “chapter 9” requirements) then do some useful work.}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXIf gadget->is_otg is true, the gadget driver must provide an OTG descriptor during enumeration, or else fail the bind() call. In such cases, no USB traffic may flow until both bind() returns without having called usb_gadget_disconnect(), and the USB host stack has initialized.h]hXIf gadget->is_otg is true, the gadget driver must provide an OTG descriptor during enumeration, or else fail the bind() call. In such cases, no USB traffic may flow until both bind() returns without having called usb_gadget_disconnect(), and the USB host stack has initialized.}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hDrivers use hardware-specific knowledge to configure the usb hardware. endpoint addressing is only one of several hardware characteristics that are in descriptors the ep0 implementation returns from setup() calls.h]hDrivers use hardware-specific knowledge to configure the usb hardware. endpoint addressing is only one of several hardware characteristics that are in descriptors the ep0 implementation returns from setup() calls.}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hExcept for ep0 implementation, most driver code shouldn't need change to run on top of different usb controllers. It'll use endpoints set up by that ep0 implementation.h]hExcept for ep0 implementation, most driver code shouldn’t need change to run on top of different usb controllers. It’ll use endpoints set up by that ep0 implementation.}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hThe usb controller driver handles a few standard usb requests. Those include set_address, and feature flags for devices, interfaces, and endpoints (the get_status, set_feature, and clear_feature requests).h]hThe usb controller driver handles a few standard usb requests. Those include set_address, and feature flags for devices, interfaces, and endpoints (the get_status, set_feature, and clear_feature requests).}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXZAccordingly, the driver's setup() callback must always implement all get_descriptor requests, returning at least a device descriptor and a configuration descriptor. Drivers must make sure the endpoint descriptors match any hardware constraints. Some hardware also constrains other descriptors. (The pxa250 allows only configurations 1, 2, or 3).h]hX\Accordingly, the driver’s setup() callback must always implement all get_descriptor requests, returning at least a device descriptor and a configuration descriptor. Drivers must make sure the endpoint descriptors match any hardware constraints. Some hardware also constrains other descriptors. (The pxa250 allows only configurations 1, 2, or 3).}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hThe driver's setup() callback must also implement set_configuration, and should also implement set_interface, get_configuration, and get_interface. Setting a configuration (or interface) is where endpoints should be activated or (config 0) shut down.h]hThe driver’s setup() callback must also implement set_configuration, and should also implement set_interface, get_configuration, and get_interface. Setting a configuration (or interface) is where endpoints should be activated or (config 0) shut down.}(hj3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXThe gadget driver's setup() callback does not have to queue a response to ep0 within the setup() call, the driver can do it after setup() returns. The UDC driver must wait until such a response is queued before proceeding with the data/status stages of the control transfer.h]hXThe gadget driver’s setup() callback does not have to queue a response to ep0 within the setup() call, the driver can do it after setup() returns. The UDC driver must wait until such a response is queued before proceeding with the data/status stages of the control transfer.}(hj3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(h(Note that only the default control endpoint is supported. Neither hosts nor devices generally support control traffic except to ep0.)h]h(Note that only the default control endpoint is supported. Neither hosts nor devices generally support control traffic except to ep0.)}(hj!3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hXMost devices will ignore USB suspend/resume operations, and so will not provide those callbacks. However, some may need to change modes when the host is not longer directing those activities. For example, local controls (buttons, dials, etc) may need to be re-enabled since the (remote) host can't do that any longer; or an error state might be cleared, to make the device behave identically whether or not power is maintained.h]hXMost devices will ignore USB suspend/resume operations, and so will not provide those callbacks. However, some may need to change modes when the host is not longer directing those activities. For example, local controls (buttons, dials, etc) may need to be re-enabled since the (remote) host can’t do that any longer; or an error state might be cleared, to make the device behave identically whether or not power is maintained.}(hj03hj.3hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(h**NOTE**h]je )}(hj?3h]hNOTE}(hhhjA3hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj=3ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubh)}(hCurrently, a number of UDC drivers rely on USB_GADGET_DELAYED_STATUS being returned from the setup() callback, which is a bug. See the comment next to USB_GADGET_DELAYED_STATUS for details.h]hCurrently, a number of UDC drivers rely on USB_GADGET_DELAYED_STATUS being returned from the setup() callback, which is a bug. See the comment next to USB_GADGET_DELAYED_STATUS for details.}(hjW3hjU3hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j-usb_gadget_register_driver_owner (C function)"c.usb_gadget_register_driver_ownerhNtauh1jhjhhhNhNubj)}(hhh](j)}(hsint usb_gadget_register_driver_owner (struct usb_gadget_driver *driver, struct module *owner, const char *mod_name)h]j)}(hrint usb_gadget_register_driver_owner(struct usb_gadget_driver *driver, struct module *owner, const char *mod_name)h](j#)}(hinth]hint}(hhhj}3hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjy3hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjy3hhhj3hMubj )}(h usb_gadget_register_driver_ownerh]j )}(h usb_gadget_register_driver_ownerh]h usb_gadget_register_driver_owner}(hhhj3hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj3ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjy3hhhj3hMubj)}(hN(struct usb_gadget_driver *driver, struct module *owner, const char *mod_name)h](j)}(h struct usb_gadget_driver *driverh](j)}(hjh]hstruct}(hhhj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubj)}(h h]h }(hhhj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubh)}(hhh]j )}(husb_gadget_driverh]husb_gadget_driver}(hhhj3hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj3ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj3modnameN classnameNjj)}j]j)}jj3sb"c.usb_gadget_register_driver_ownerasbuh1hhj3ubj)}(h h]h }(hhhj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubjA)}(hjDh]h*}(hhhj4hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj3ubj )}(hdriverh]hdriver}(hhhj4hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj3ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj3ubj)}(hstruct module *ownerh](j)}(hjh]hstruct}(hhhj,4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj(4ubj)}(h h]h }(hhhj94hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj(4ubh)}(hhh]j )}(hmoduleh]hmodule}(hhhjJ4hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjG4ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjL4modnameN classnameNjj)}j]j3"c.usb_gadget_register_driver_ownerasbuh1hhj(4ubj)}(h h]h }(hhhjh4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj(4ubjA)}(hjDh]h*}(hhhjv4hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj(4ubj )}(hownerh]howner}(hhhj4hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj(4ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj3ubj)}(hconst char *mod_nameh](j)}(hconsth]hconst}(hhhj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubj)}(h h]h }(hhhj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubj#)}(hcharh]hchar}(hhhj4hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj4ubj)}(h h]h }(hhhj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubjA)}(hjDh]h*}(hhhj4hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj4ubj )}(hmod_nameh]hmod_name}(hhhj4hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj4ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj3ubeh}(h]h ]h"]h$]h&]j j! uh1jhjy3hhhj3hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hju3hhhj3hMubah}(h]jp3ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjr3hhubj6 )}(hhh]h)}(hregister a gadget driverh]hregister a gadget driver}(hj5hj 5hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj 5hhubah}(h]h ]h"]h$]h&]uh1j5 hjr3hhhj3hMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j$5jX j$5jY uh1jhhhjhNhNubj[ )}(hXU**Parameters** ``struct usb_gadget_driver *driver`` the driver being registered ``struct module *owner`` the driver module ``const char *mod_name`` the driver module's build name **Context** can sleep **Description** Call this in your gadget driver's module initialization function, to tell the underlying UDC controller driver about your driver. The **bind\(\)** function will be called to bind it to a gadget before this registration call returns. It's expected that the **bind\(\)** function will be in init sections. Use the macro defined below instead of calling this directly.h](h)}(h**Parameters**h]je )}(hj.5h]h Parameters}(hhhj05hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj,5ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(5ubjw)}(hhh](j|)}(hA``struct usb_gadget_driver *driver`` the driver being registered h](j)}(h$``struct usb_gadget_driver *driver``h]j)}(hjM5h]h struct usb_gadget_driver *driver}(hhhjO5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjK5ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjG5ubj)}(hhh]h)}(hthe driver being registeredh]hthe driver being registered}(hjh5hjf5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjb5hMhjc5ubah}(h]h ]h"]h$]h&]uh1jhjG5ubeh}(h]h ]h"]h$]h&]uh1j{hjb5hMhjD5ubj|)}(h+``struct module *owner`` the driver module h](j)}(h``struct module *owner``h]j)}(hj5h]hstruct module *owner}(hhhj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj5ubj)}(hhh]h)}(hthe driver moduleh]hthe driver module}(hj5hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hMhj5ubah}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1j{hj5hMhjD5ubj|)}(h8``const char *mod_name`` the driver module's build name h](j)}(h``const char *mod_name``h]j)}(hj5h]hconst char *mod_name}(hhhj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj5ubj)}(hhh]h)}(hthe driver module's build nameh]h the driver module’s build name}(hj5hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hMhj5ubah}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1j{hj5hMhjD5ubeh}(h]h ]h"]h$]h&]uh1jvhj(5ubh)}(h **Context**h]je )}(hj5h]hContext}(hhhj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj5ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(5ubh)}(h can sleeph]h can sleep}(hj6hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(5ubh)}(h**Description**h]je )}(hj!6h]h Description}(hhhj#6hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj6ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(5ubh)}(hX0Call this in your gadget driver's module initialization function, to tell the underlying UDC controller driver about your driver. The **bind\(\)** function will be called to bind it to a gadget before this registration call returns. It's expected that the **bind\(\)** function will be in init sections.h](hCall this in your gadget driver’s module initialization function, to tell the underlying UDC controller driver about your driver. The }(hCall this in your gadget driver's module initialization function, to tell the underlying UDC controller driver about your driver. The hj76hhhNhNubje )}(h **bind\(\)**h]hbind()}(hhhj@6hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj76ubhq function will be called to bind it to a gadget before this registration call returns. It’s expected that the }(ho function will be called to bind it to a gadget before this registration call returns. It's expected that the hj76hhhNhNubje )}(h **bind\(\)**h]hbind()}(hhhjS6hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj76ubh# function will be in init sections.}(h# function will be in init sections.hj76hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj(5ubh)}(h=Use the macro defined below instead of calling this directly.h]h=Use the macro defined below instead of calling this directly.}(hjo6hjm6hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM hj(5ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j)usb_gadget_unregister_driver (C function)c.usb_gadget_unregister_driverhNtauh1jhjhhhNhNubj)}(hhh](j)}(hCint usb_gadget_unregister_driver (struct usb_gadget_driver *driver)h]j)}(hBint usb_gadget_unregister_driver(struct usb_gadget_driver *driver)h](j#)}(hinth]hint}(hhhj6hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj6hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hhhj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6hhhj6hMubj )}(husb_gadget_unregister_driverh]j )}(husb_gadget_unregister_driverh]husb_gadget_unregister_driver}(hhhj6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj6ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj6hhhj6hMubj)}(h"(struct usb_gadget_driver *driver)h]j)}(h struct usb_gadget_driver *driverh](j)}(hjh]hstruct}(hhhj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubj)}(h h]h }(hhhj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubh)}(hhh]j )}(husb_gadget_driverh]husb_gadget_driver}(hhhj6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj6ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj6modnameN classnameNjj)}j]j)}jj6sbc.usb_gadget_unregister_driverasbuh1hhj6ubj)}(h h]h }(hhhj7hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubjA)}(hjDh]h*}(hhhj%7hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj6ubj )}(hdriverh]hdriver}(hhhj27hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj6ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj6ubah}(h]h ]h"]h$]h&]j j! uh1jhj6hhhj6hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj6hhhj6hMubah}(h]j6ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM"hj6hhubj6 )}(hhh]h)}(hunregister a gadget driverh]hunregister a gadget driver}(hj_7hj]7hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjZ7hhubah}(h]h ]h"]h$]h&]uh1j5 hj6hhhj6hMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW ju7jX ju7jY uh1jhhhjhNhNubj[ )}(hX%**Parameters** ``struct usb_gadget_driver *driver`` the driver being unregistered **Context** can sleep **Description** Call this in your gadget driver's module cleanup function, to tell the underlying usb controller that your driver is going away. If the controller is connected to a USB host, it will first disconnect(). The driver is also requested to unbind() and clean up any device state, before this procedure finally returns. It's expected that the unbind() functions will be in exit sections, so may not be linked in some kernels.h](h)}(h**Parameters**h]je )}(hj7h]h Parameters}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj}7ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjy7ubjw)}(hhh]j|)}(hC``struct usb_gadget_driver *driver`` the driver being unregistered h](j)}(h$``struct usb_gadget_driver *driver``h]j)}(hj7h]h struct usb_gadget_driver *driver}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj7ubj)}(hhh]h)}(hthe driver being unregisteredh]hthe driver being unregistered}(hj7hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hMhj7ubah}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1j{hj7hMhj7ubah}(h]h ]h"]h$]h&]uh1jvhjy7ubh)}(h **Context**h]je )}(hj7h]hContext}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj7ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjy7ubh)}(h can sleeph]h can sleep}(hj7hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjy7ubh)}(h**Description**h]je )}(hj8h]h Description}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj7ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjy7ubh)}(hXCall this in your gadget driver's module cleanup function, to tell the underlying usb controller that your driver is going away. If the controller is connected to a USB host, it will first disconnect(). The driver is also requested to unbind() and clean up any device state, before this procedure finally returns. It's expected that the unbind() functions will be in exit sections, so may not be linked in some kernels.h]hXCall this in your gadget driver’s module cleanup function, to tell the underlying usb controller that your driver is going away. If the controller is connected to a USB host, it will first disconnect(). The driver is also requested to unbind() and clean up any device state, before this procedure finally returns. It’s expected that the unbind() functions will be in exit sections, so may not be linked in some kernels.}(hj8hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjy7ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string (C struct) c.usb_stringhNtauh1jhjhhhNhNubj)}(hhh](j)}(h usb_stringh]j)}(hstruct usb_stringh](j)}(hjh]hstruct}(hhhjE8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjA8hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM*ubj)}(h h]h }(hhhjS8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjA8hhhjR8hM*ubj )}(h usb_stringh]j )}(hj?8h]h usb_string}(hhhje8hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hja8ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjA8hhhjR8hM*ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj=8hhhjR8hM*ubah}(h]j88ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM$hj:8hhubj6 )}(hhh]h)}(hwraps a C string and its USB idh]hwraps a C string and its USB id}(hj8hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM)hj8hhubah}(h]h ]h"]h$]h&]uh1j5 hj:8hhhjR8hM*ubeh}(h]h ](jstructeh"]h$]h&]jV jjW j8jX j8jY uh1jhhhjhNhNubj[ )}(h**Definition**:: struct usb_string { u8 id; const char *s; }; **Members** ``id`` the (nonzero) ID for this string ``s`` the string, in UTF-8 encodingh](h)}(h**Definition**::h](je )}(h**Definition**h]h Definition}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj8ubh:}(hjx hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM-hj8ubj )}(hAstruct usb_string { u8 id; const char *s; };h]hAstruct usb_string { u8 id; const char *s; };}(hhhj8ubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM/hj8ubh)}(h **Members**h]je )}(hj8h]hMembers}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj8ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM4hj8ubjw)}(hhh](j|)}(h(``id`` the (nonzero) ID for this string h](j)}(h``id``h]j)}(hj8h]hid}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM+hj8ubj)}(hhh]h)}(h the (nonzero) ID for this stringh]h the (nonzero) ID for this string}(hj9hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj 9hM+hj 9ubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1j{hj 9hM+hj8ubj|)}(h#``s`` the string, in UTF-8 encodingh](j)}(h``s``h]j)}(hj.9h]hs}(hhhj09hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,9ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM+hj(9ubj)}(hhh]h)}(hthe string, in UTF-8 encodingh]hthe string, in UTF-8 encoding}(hjI9hjG9hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM,hjD9ubah}(h]h ]h"]h$]h&]uh1jhj(9ubeh}(h]h ]h"]h$]h&]uh1j{hjC9hM+hj8ubeh}(h]h ]h"]h$]h&]uh1jvhj8ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubh)}(h**Description**h]je )}(hjq9h]h Description}(hhhjs9hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjo9ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM/hjhhubh)}(hXIf you're using usb_gadget_get_string(), use this to wrap a string together with its ID.h]hZIf you’re using usb_gadget_get_string(), use this to wrap a string together with its ID.}(hj9hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM-hjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_gadget_strings (C struct)c.usb_gadget_stringshNtauh1jhjhhhNhNubj)}(hhh](j)}(husb_gadget_stringsh]j)}(hstruct usb_gadget_stringsh](j)}(hjh]hstruct}(hhhj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM7ubj)}(h h]h }(hhhj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9hhhj9hM7ubj )}(husb_gadget_stringsh]j )}(hj9h]husb_gadget_strings}(hhhj9hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj9ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj9hhhj9hM7ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj9hhhj9hM7ubah}(h]j9ah ](j. j/ eh"]h$]h&]j3 uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM3hj9hhubj6 )}(hhh]h)}(h(a set of USB strings in a given languageh]h(a set of USB strings in a given language}(hj9hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM6hj9hhubah}(h]h ]h"]h$]h&]uh1j5 hj9hhhj9hM7ubeh}(h]h ](jstructeh"]h$]h&]jV jjW j :jX j :jY uh1jhhhjhNhNubj[ )}(h**Definition**:: struct usb_gadget_strings { u16 language; struct usb_string *strings; }; **Members** ``language`` identifies the strings' language (0x0409 for en-us) ``strings`` array of strings with their idsh](h)}(h**Definition**::h](je )}(h**Definition**h]h Definition}(hhhj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj:ubh:}(hjx hj:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM:hj:ubj )}(hVstruct usb_gadget_strings { u16 language; struct usb_string *strings; };h]hVstruct usb_gadget_strings { u16 language; struct usb_string *strings; };}(hhhj/:ubah}(h]h ]h"]h$]h&]j j! uh1j ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM<hj:ubh)}(h **Members**h]je )}(hj@:h]hMembers}(hhhjB:hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj>:ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMAhj:ubjw)}(hhh](j|)}(hA``language`` identifies the strings' language (0x0409 for en-us) h](j)}(h ``language``h]j)}(hj_:h]hlanguage}(hhhja:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]:ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM8hjY:ubj)}(hhh]h)}(h3identifies the strings' language (0x0409 for en-us)h]h5identifies the strings’ language (0x0409 for en-us)}(hjz:hjx:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjt:hM8hju:ubah}(h]h ]h"]h$]h&]uh1jhjY:ubeh}(h]h ]h"]h$]h&]uh1j{hjt:hM8hjV:ubj|)}(h+``strings`` array of strings with their idsh](j)}(h ``strings``h]j)}(hj:h]hstrings}(hhhj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM8hj:ubj)}(hhh]h)}(harray of strings with their idsh]harray of strings with their ids}(hj:hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM9hj:ubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1j{hj:hM8hjV:ubeh}(h]h ]h"]h$]h&]uh1jvhj:ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubh)}(h**Description**h]je )}(hj:h]h Description}(hhhj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj:ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM<hjhhubh)}(h_If you're using usb_gadget_get_string(), use this to wrap all the strings for a given language.h]haIf you’re using usb_gadget_get_string(), use this to wrap all the strings for a given language.}(hj:hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM:hjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!usb_free_descriptors (C function)c.usb_free_descriptorshNtauh1jhjhhhNhNubj)}(hhh](j)}(h<ubah}(h]h ]h"]h$]h&]uh1jhj"<ubeh}(h]h ]h"]h$]h&]uh1j{hj=<hMnhj<ubah}(h]h ]h"]h$]h&]uh1jvhj<ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjhhhNhNubeh}(h]core-objects-and-methodsah ]h"]core objects and methodsah$]h&]uh1hhjhhhhhM8ubh)}(hhh](h)}(hOptional Utilitiesh]hOptional Utilities}(hjv<hjt<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjq<hhhhhMAubh)}(hThe core API is sufficient for writing a USB Gadget Driver, but some optional utilities are provided to simplify common tasks. These utilities include endpoint autoconfiguration.h]hThe core API is sufficient for writing a USB Gadget Driver, but some optional utilities are provided to simplify common tasks. These utilities include endpoint autoconfiguration.}(hj<hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChjq<hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"usb_gadget_get_string (C function)c.usb_gadget_get_stringhNtauh1jhjq<hhhNhNubj)}(hhh](j)}(hSint usb_gadget_get_string (const struct usb_gadget_strings *table, int id, u8 *buf)h]j)}(hRint usb_gadget_get_string(const struct usb_gadget_strings *table, int id, u8 *buf)h](j#)}(hinth]hint}(hhhj<hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj<hhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKubj)}(h h]h }(hhhj<hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<hhhj<hKubj )}(husb_gadget_get_stringh]j )}(husb_gadget_get_stringh]husb_gadget_get_string}(hhhj<hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj<ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj<hhhj<hKubj)}(h9(const struct usb_gadget_strings *table, int id, u8 *buf)h](j)}(h&const struct usb_gadget_strings *tableh](j)}(hj4h]hconst}(hhhj<hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<ubj)}(h h]h }(hhhj<hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<ubj)}(hjh]hstruct}(hhhj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<ubj)}(h h]h }(hhhj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<ubh)}(hhh]j )}(husb_gadget_stringsh]husb_gadget_strings}(hhhj=hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj=ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj!=modnameN classnameNjj)}j]j)}jj<sbc.usb_gadget_get_stringasbuh1hhj<ubj)}(h h]h }(hhhj?=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<ubjA)}(hjDh]h*}(hhhjM=hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj<ubj )}(htableh]htable}(hhhjZ=hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj<ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj<ubj)}(hint idh](j#)}(hinth]hint}(hhhjs=hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjo=ubj)}(h h]h }(hhhj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjo=ubj )}(hidh]hid}(hhhj=hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjo=ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj<ubj)}(hu8 *bufh](h)}(hhh]j )}(hu8h]hu8}(hhhj=hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj=ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj=modnameN classnameNjj)}j]j;=c.usb_gadget_get_stringasbuh1hhj=ubj)}(h h]h }(hhhj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=ubjA)}(hjDh]h*}(hhhj=hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=ubj )}(hbufh]hbuf}(hhhj=hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj=ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj<ubeh}(h]h ]h"]h$]h&]j j! uh1jhj<hhhj<hKubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj<hhhj<hKubah}(h]j<ah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chK#hj<hhubj6 )}(hhh]h)}(hfill out a string descriptorh]hfill out a string descriptor}(hj>hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj >hhubah}(h]h ]h"]h$]h&]uh1j5 hj<hhhj<hKubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j'>jX j'>jY uh1jhhhjq<hNhNubj[ )}(hX**Parameters** ``const struct usb_gadget_strings *table`` of c strings encoded using UTF-8 ``int id`` string id, from low byte of wValue in get string descriptor ``u8 *buf`` at least 256 bytes, must be 16-bit aligned **Description** Finds the UTF-8 string matching the ID, and converts it into a string descriptor in utf16-le. Returns length of descriptor (always even) or negative errno If your driver needs stings in multiple languages, you'll probably "switch (wIndex) { ... }" in your ep0 string descriptor logic, using this routine after choosing which set of UTF-8 strings to use. Note that US-ASCII is a strict subset of UTF-8; any string bytes with the eighth bit set will be multibyte UTF-8 characters, not ISO-8859/1 characters (which are also widely used in C strings).h](h)}(h**Parameters**h]je )}(hj1>h]h Parameters}(hhhj3>hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj/>ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj+>ubjw)}(hhh](j|)}(hL``const struct usb_gadget_strings *table`` of c strings encoded using UTF-8 h](j)}(h*``const struct usb_gadget_strings *table``h]j)}(hjP>h]h&const struct usb_gadget_strings *table}(hhhjR>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjN>ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhjJ>ubj)}(hhh]h)}(h of c strings encoded using UTF-8h]h of c strings encoded using UTF-8}(hjk>hji>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhje>hKhjf>ubah}(h]h ]h"]h$]h&]uh1jhjJ>ubeh}(h]h ]h"]h$]h&]uh1j{hje>hKhjG>ubj|)}(hG``int id`` string id, from low byte of wValue in get string descriptor h](j)}(h ``int id``h]j)}(hj>h]hint id}(hhhj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj>ubj)}(hhh]h)}(h;string id, from low byte of wValue in get string descriptorh]h;string id, from low byte of wValue in get string descriptor}(hj>hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hKhj>ubah}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]uh1j{hj>hKhjG>ubj|)}(h7``u8 *buf`` at least 256 bytes, must be 16-bit aligned h](j)}(h ``u8 *buf``h]j)}(hj>h]hu8 *buf}(hhhj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj>ubj)}(hhh]h)}(h*at least 256 bytes, must be 16-bit alignedh]h*at least 256 bytes, must be 16-bit aligned}(hj>hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hKhj>ubah}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]uh1j{hj>hKhjG>ubeh}(h]h ]h"]h$]h&]uh1jvhj+>ubh)}(h**Description**h]je )}(hj>h]h Description}(hhhj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj>ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj+>ubh)}(hFinds the UTF-8 string matching the ID, and converts it into a string descriptor in utf16-le. Returns length of descriptor (always even) or negative errnoh]hFinds the UTF-8 string matching the ID, and converts it into a string descriptor in utf16-le. Returns length of descriptor (always even) or negative errno}(hj?hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj+>ubh)}(hXIf your driver needs stings in multiple languages, you'll probably "switch (wIndex) { ... }" in your ep0 string descriptor logic, using this routine after choosing which set of UTF-8 strings to use. Note that US-ASCII is a strict subset of UTF-8; any string bytes with the eighth bit set will be multibyte UTF-8 characters, not ISO-8859/1 characters (which are also widely used in C strings).h]hXIf your driver needs stings in multiple languages, you’ll probably “switch (wIndex) { ... }” in your ep0 string descriptor logic, using this routine after choosing which set of UTF-8 strings to use. Note that US-ASCII is a strict subset of UTF-8; any string bytes with the eighth bit set will be multibyte UTF-8 characters, not ISO-8859/1 characters (which are also widely used in C strings).}(hj$?hj"?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj+>ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjq<hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j usb_validate_langid (C function)c.usb_validate_langidhNtauh1jhjq<hhhNhNubj)}(hhh](j)}(h%bool usb_validate_langid (u16 langid)h]j)}(h$bool usb_validate_langid(u16 langid)h](j#)}(hboolh]hbool}(hhhjQ?hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjM?hhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKGubj)}(h h]h }(hhhj`?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjM?hhhj_?hKGubj )}(husb_validate_langidh]j )}(husb_validate_langidh]husb_validate_langid}(hhhjr?hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjn?ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjM?hhhj_?hKGubj)}(h (u16 langid)h]j)}(h u16 langidh](h)}(hhh]j )}(hu16h]hu16}(hhhj?hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj?ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj?modnameN classnameNjj)}j]j)}jjt?sbc.usb_validate_langidasbuh1hhj?ubj)}(h h]h }(hhhj?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?ubj )}(hlangidh]hlangid}(hhhj?hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj?ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj?ubah}(h]h ]h"]h$]h&]j j! uh1jhjM?hhhj_?hKGubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjI?hhhj_?hKGubah}(h]jD?ah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKKhjF?hhubj6 )}(hhh]h)}(h!validate usb language identifiersh]h!validate usb language identifiers}(hj?hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKFhj?hhubah}(h]h ]h"]h$]h&]uh1j5 hjF?hhhj_?hKGubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j@jX j@jY uh1jhhhjq<hNhNubj[ )}(h**Parameters** ``u16 langid`` usb language identifier **Description** Returns true for valid language identifier, otherwise false.h](h)}(h**Parameters**h]je )}(hj @h]h Parameters}(hhhj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj @ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKJhj@ubjw)}(hhh]j|)}(h'``u16 langid`` usb language identifier h](j)}(h``u16 langid``h]j)}(hj+@h]h u16 langid}(hhhj-@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)@ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKGhj%@ubj)}(hhh]h)}(husb language identifierh]husb language identifier}(hjF@hjD@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@@hKGhjA@ubah}(h]h ]h"]h$]h&]uh1jhj%@ubeh}(h]h ]h"]h$]h&]uh1j{hj@@hKGhj"@ubah}(h]h ]h"]h$]h&]uh1jvhj@ubh)}(h**Description**h]je )}(hjf@h]h Description}(hhhjh@hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjd@ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKIhj@ubh)}(hChhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj:Chhhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK:ubj)}(h h]h }(hhhjMChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj:ChhhjLChK:ubj )}(husb_gadget_config_bufh]j )}(husb_gadget_config_bufh]husb_gadget_config_buf}(hhhj_ChhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj[Cubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj:ChhhjLChK:ubj)}(hs(const struct usb_config_descriptor *config, void *buf, unsigned length, const struct usb_descriptor_header **desc)h](j)}(h*const struct usb_config_descriptor *configh](j)}(hj4h]hconst}(hhhj{ChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwCubj)}(h h]h }(hhhjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwCubj)}(hjh]hstruct}(hhhjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwCubj)}(h h]h }(hhhjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwCubh)}(hhh]j )}(husb_config_descriptorh]husb_config_descriptor}(hhhjChhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjCubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjCmodnameN classnameNjj)}j]j)}jjaCsbc.usb_gadget_config_bufasbuh1hhjwCubj)}(h h]h }(hhhjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwCubjA)}(hjDh]h*}(hhhjChhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjwCubj )}(hconfigh]hconfig}(hhhjChhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjwCubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjsCubj)}(h void *bufh](j#)}(hvoidh]hvoid}(hhhjDhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjDubj)}(h h]h }(hhhjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjDubjA)}(hjDh]h*}(hhhj$DhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjDubj )}(hbufh]hbuf}(hhhj1DhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjDubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjsCubj)}(hunsigned lengthh](j#)}(hunsignedh]hunsigned}(hhhjJDhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjFDubj)}(h h]h }(hhhjXDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFDubj )}(hlengthh]hlength}(hhhjfDhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjFDubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjsCubj)}(h)const struct usb_descriptor_header **desch](j)}(hj4h]hconst}(hhhjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{Dubj)}(h h]h }(hhhjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{Dubj)}(hjh]hstruct}(hhhjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{Dubj)}(h h]h }(hhhjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{Dubh)}(hhh]j )}(husb_descriptor_headerh]husb_descriptor_header}(hhhjDhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjDubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjDmodnameN classnameNjj)}j]jCc.usb_gadget_config_bufasbuh1hhj{Dubj)}(h h]h }(hhhjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{DubjA)}(hjDh]h*}(hhhjDhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj{DubjA)}(hjDh]h*}(hhhjDhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj{Dubj )}(hdesch]hdesc}(hhhjDhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj{Dubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjsCubeh}(h]h ]h"]h$]h&]j j! uh1jhj:ChhhjLChK:ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj6ChhhjLChK:ubah}(h]j1Cah ](j. j/ eh"]h$]h&]j3 uh1jhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKLhj3Chhubj6 )}(hhh]h)}(h*builts a complete configuration descriptorh]h*builts a complete configuration descriptor}(hj+Ehj)EhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK9hj&Ehhubah}(h]h ]h"]h$]h&]uh1j5 hj3ChhhjLChK:ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jAEjX jAEjY uh1jhhhjq<hNhNubj[ )}(hXd**Parameters** ``const struct usb_config_descriptor *config`` Header for the descriptor, including characteristics such as power requirements and number of interfaces. ``void *buf`` Buffer for the resulting configuration descriptor. ``unsigned length`` Length of buffer. If this is not big enough to hold the entire configuration descriptor, an error code will be returned. ``const struct usb_descriptor_header **desc`` Null-terminated vector of pointers to the descriptors (interface, endpoint, etc) defining all functions in this device configuration. **Description** This copies descriptors into the response buffer, building a descriptor for that configuration. It returns the buffer length or a negative status code. The config.wTotalLength field is set to match the length of the result, but other descriptor fields (including power usage and interface count) must be set by the caller. Gadget drivers could use this when constructing a config descriptor in response to USB_REQ_GET_DESCRIPTOR. They will need to patch the resulting bDescriptorType value if USB_DT_OTHER_SPEED_CONFIG is needed.h](h)}(h**Parameters**h]je )}(hjKEh]h Parameters}(hhhjMEhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjIEubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK=hjEEubjw)}(hhh](j|)}(h``const struct usb_config_descriptor *config`` Header for the descriptor, including characteristics such as power requirements and number of interfaces. h](j)}(h.``const struct usb_config_descriptor *config``h]j)}(hjjEh]h*const struct usb_config_descriptor *config}(hhhjlEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhEubah}(h]h ]h"]h$]h&]uh1jhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK;hjdEubj)}(hhh]h)}(hiHeader for the descriptor, including characteristics such as power requirements and number of interfaces.h]hiHeader for the descriptor, including characteristics such as power requirements and number of interfaces.}(hjEhjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK:hjEubah}(h]h ]h"]h$]h&]uh1jhjdEubeh}(h]h ]h"]h$]h&]uh1j{hjEhK;hjaEubj|)}(hA``void *buf`` Buffer for the resulting configuration descriptor. h](j)}(h ``void *buf``h]j)}(hjEh]h void *buf}(hhhjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]uh1jhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK>hjEubj)}(hhh]h)}(h2Buffer for the resulting configuration descriptor.h]h2Buffer for the resulting configuration descriptor.}(hjEhjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjEhK>hjEubah}(h]h ]h"]h$]h&]uh1jhjEubeh}(h]h ]h"]h$]h&]uh1j{hjEhK>hjaEubj|)}(h``unsigned length`` Length of buffer. If this is not big enough to hold the entire configuration descriptor, an error code will be returned. h](j)}(h``unsigned length``h]j)}(hjEh]hunsigned length}(hhhjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]uh1jhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK@hjEubj)}(hhh]h)}(hyLength of buffer. If this is not big enough to hold the entire configuration descriptor, an error code will be returned.h]hyLength of buffer. If this is not big enough to hold the entire configuration descriptor, an error code will be returned.}(hjEhjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK?hjEubah}(h]h ]h"]h$]h&]uh1jhjEubeh}(h]h ]h"]h$]h&]uh1j{hjEhK@hjaEubj|)}(h``const struct usb_descriptor_header **desc`` Null-terminated vector of pointers to the descriptors (interface, endpoint, etc) defining all functions in this device configuration. h](j)}(h-``const struct usb_descriptor_header **desc``h]j)}(hjFh]h)const struct usb_descriptor_header **desc}(hhhjFhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjFubah}(h]h ]h"]h$]h&]uh1jhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK=hjFubj)}(hhh]h)}(hNull-terminated vector of pointers to the descriptors (interface, endpoint, etc) defining all functions in this device configuration.h]hNull-terminated vector of pointers to the descriptors (interface, endpoint, etc) defining all functions in this device configuration.}(hj2Fhj0FhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKhjIubj)}(hhh]h)}(hExtended Property typeh]hExtended Property type}(hjJhjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJhK>hjJubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1j{hjJhK>hjIubj|)}(hO``name_len`` Extended Property unicode name length, including terminating '\0' h](j)}(h ``name_len``h]j)}(hj&Jh]hname_len}(hhhj(JhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$Jubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK?hj Jubj)}(hhh]h)}(hAExtended Property unicode name length, including terminating '\0'h]hEExtended Property unicode name length, including terminating ‘0’}(hAExtended Property unicode name length, including terminating '\0'hj?JhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;JhK?hjSubj)}(hhh]h)}(h(REQUIRED) Reconfigures altsettings; function drivers may initialize usb_ep.driver data at this time (when it is used). Note that setting an interface to its current altsetting resets interface state, and that all interfaces have a disabled state.h]h(REQUIRED) Reconfigures altsettings; function drivers may initialize usb_ep.driver data at this time (when it is used). Note that setting an interface to its current altsetting resets interface state, and that all interfaces have a disabled state.}(hj_Shj]ShhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjZSubah}(h]h ]h"]h$]h&]uh1jhj>Subeh}(h]h ]h"]h$]h&]uh1j{hjYShKhjOubj|)}(hm``get_alt`` Returns the active altsetting. If this is not provided, then only altsetting zero is supported. h](j)}(h ``get_alt``h]j)}(hj~Sh]hget_alt}(hhhjShhhNhNubah}(h]h ]h"]h$]h&]uh1jhj|Subah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjxSubj)}(hhh]h)}(h`Returns the active altsetting. If this is not provided, then only altsetting zero is supported.h]h`Returns the active altsetting. If this is not provided, then only altsetting zero is supported.}(hjShjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjSubah}(h]h ]h"]h$]h&]uh1jhjxSubeh}(h]h ]h"]h$]h&]uh1j{hjShKhjOubj|)}(h``disable`` (REQUIRED) Indicates the function should be disabled. Reasons include host resetting or reconfiguring the gadget, and disconnection. h](j)}(h ``disable``h]j)}(hjSh]hdisable}(hhhjShhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjSubj)}(hhh]h)}(h(REQUIRED) Indicates the function should be disabled. Reasons include host resetting or reconfiguring the gadget, and disconnection.h]h(REQUIRED) Indicates the function should be disabled. Reasons include host resetting or reconfiguring the gadget, and disconnection.}(hjShjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjSubah}(h]h ]h"]h$]h&]uh1jhjSubeh}(h]h ]h"]h$]h&]uh1j{hjShKhjOubj|)}(h8``setup`` Used for interface-specific control requests. h](j)}(h ``setup``h]j)}(hjSh]hsetup}(hhhjShhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjSubj)}(hhh]h)}(h-Used for interface-specific control requests.h]h-Used for interface-specific control requests.}(hj Thj ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThKhjTubah}(h]h ]h"]h$]h&]uh1jhjSubeh}(h]h ]h"]h$]h&]uh1j{hjThKhjOubj|)}(hN``req_match`` Tests if a given class request can be handled by this function. h](j)}(h ``req_match``h]j)}(hj+Th]h req_match}(hhhj-ThhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)Tubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj%Tubj)}(hhh]h)}(h?Tests if a given class request can be handled by this function.h]h?Tests if a given class request can be handled by this function.}(hjFThjDThhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@ThKhjATubah}(h]h ]h"]h$]h&]uh1jhj%Tubeh}(h]h ]h"]h$]h&]uh1j{hj@ThKhjOubj|)}(hH``suspend`` Notifies functions when the host stops sending USB traffic. h](j)}(h ``suspend``h]j)}(hjdTh]hsuspend}(hhhjfThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbTubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj^Tubj)}(hhh]h)}(h;Notifies functions when the host stops sending USB traffic.h]h;Notifies functions when the host stops sending USB traffic.}(hjThj}ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjyThKhjzTubah}(h]h ]h"]h$]h&]uh1jhj^Tubeh}(h]h ]h"]h$]h&]uh1j{hjyThKhjOubj|)}(hB``resume`` Notifies functions when the host restarts USB traffic. h](j)}(h ``resume``h]j)}(hjTh]hresume}(hhhjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjTubj)}(hhh]h)}(h6Notifies functions when the host restarts USB traffic.h]h6Notifies functions when the host restarts USB traffic.}(hjThjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThKhjTubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1j{hjThKhjOubj|)}(hj``get_status`` Returns function status as a reply to GetStatus() request when the recipient is Interface. h](j)}(h``get_status``h]j)}(hjTh]h get_status}(hhhjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjTubj)}(hhh]h)}(hZReturns function status as a reply to GetStatus() request when the recipient is Interface.h]hZReturns function status as a reply to GetStatus() request when the recipient is Interface.}(hjThjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjTubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1j{hjThKhjOubj|)}(hU``func_suspend`` callback to be called when SetFeature(FUNCTION_SUSPEND) is reseived h](j)}(h``func_suspend``h]j)}(hjUh]h func_suspend}(hhhjUhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjUubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj Uubj)}(hhh]h)}(hCcallback to be called when SetFeature(FUNCTION_SUSPEND) is reseivedh]hCcallback to be called when SetFeature(FUNCTION_SUSPEND) is reseived}(hj+Uhj)UhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj&Uubah}(h]h ]h"]h$]h&]uh1jhj Uubeh}(h]h ]h"]h$]h&]uh1j{hj%UhKhjOubj|)}(hP``func_suspended`` Indicates whether the function is in function suspend state. h](j)}(h``func_suspended``h]j)}(hjJUh]hfunc_suspended}(hhhjLUhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHUubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjDUubj)}(hhh]h)}(hXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:Xubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj6Xubj)}(hhh]h)}(h|Used to delegate control requests that aren't handled by standard device infrastructure or directed at a specific interface.h]h~Used to delegate control requests that aren’t handled by standard device infrastructure or directed at a specific interface.}(hjWXhjUXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjRXubah}(h]h ]h"]h$]h&]uh1jhj6Xubeh}(h]h ]h"]h$]h&]uh1j{hjQXhMhj$Wubj|)}(h>``bConfigurationValue`` Copied into configuration descriptor. h](j)}(h``bConfigurationValue``h]j)}(hjvXh]hbConfigurationValue}(hhhjxXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjtXubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjpXubj)}(hhh]h)}(h%Copied into configuration descriptor.h]h%Copied into configuration descriptor.}(hjXhjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhMhjXubah}(h]h ]h"]h$]h&]uh1jhjpXubeh}(h]h ]h"]h$]h&]uh1j{hjXhMhj$Wubj|)}(h9``iConfiguration`` Copied into configuration descriptor. h](j)}(h``iConfiguration``h]j)}(hjXh]hiConfiguration}(hhhjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjXubj)}(hhh]h)}(h%Copied into configuration descriptor.h]h%Copied into configuration descriptor.}(hjXhjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhMhjXubah}(h]h ]h"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]uh1j{hjXhMhj$Wubj|)}(h7``bmAttributes`` Copied into configuration descriptor. h](j)}(h``bmAttributes``h]j)}(hjXh]h bmAttributes}(hhhjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjXubj)}(hhh]h)}(h%Copied into configuration descriptor.h]h%Copied into configuration descriptor.}(hjYhjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhMhjXubah}(h]h ]h"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]uh1j{hjXhMhj$Wubj|)}(h``MaxPower`` Power consumption in mA. Used to compute bMaxPower in the configuration descriptor after considering the bus speed. h](j)}(h ``MaxPower``h]j)}(hj!Yh]hMaxPower}(hhhj#YhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjYubj)}(hhh]h)}(hsPower consumption in mA. Used to compute bMaxPower in the configuration descriptor after considering the bus speed.h]hsPower consumption in mA. Used to compute bMaxPower in the configuration descriptor after considering the bus speed.}(hj``use_os_string`` false by default, interested gadgets set it h](j)}(h``use_os_string``h]j)}(hjah]h use_os_string}(hhhjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjaubj)}(hhh]h)}(h+false by default, interested gadgets set ith]h+false by default, interested gadgets set it}(hjahjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahMhjaubah}(h]h ]h"]h$]h&]uh1jhjaubeh}(h]h ]h"]h$]h&]uh1j{hjahMhj'`ubj|)}(hG``bcd_webusb_version`` 0x0100 by default, WebUSB specification version h](j)}(h``bcd_webusb_version``h]j)}(hjah]hbcd_webusb_version}(hhhjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjaubj)}(hhh]h)}(h/0x0100 by default, WebUSB specification versionh]h/0x0100 by default, WebUSB specification version}(hjbhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj bhMhjbubah}(h]h ]h"]h$]h&]uh1jhjaubeh}(h]h ]h"]h$]h&]uh1j{hj bhMhj'`ubj|)}(h@``b_webusb_vendor_code`` 0x0 by default, vendor code for WebUSB h](j)}(h``b_webusb_vendor_code``h]j)}(hj1bh]hb_webusb_vendor_code}(hhhj3bhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/bubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj+bubj)}(hhh]h)}(h&0x0 by default, vendor code for WebUSBh]h&0x0 by default, vendor code for WebUSB}(hjLbhjJbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFbhMhjGbubah}(h]h ]h"]h$]h&]uh1jhj+bubeh}(h]h ]h"]h$]h&]uh1j{hjFbhMhj'`ubj|)}(hF``landing_page`` empty by default, landing page to announce in WebUSB h](j)}(h``landing_page``h]j)}(hjjbh]h landing_page}(hhhjlbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhbubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjdbubj)}(hhh]h)}(h4empty by default, landing page to announce in WebUSBh]h4empty by default, landing page to announce in WebUSB}(hjbhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhMhjbubah}(h]h ]h"]h$]h&]uh1jhjdbubeh}(h]h ]h"]h$]h&]uh1j{hjbhMhj'`ubj|)}(h;``use_webusb`` false by default, interested gadgets set it h](j)}(h``use_webusb``h]j)}(hjbh]h use_webusb}(hhhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjbubj)}(hhh]h)}(h+false by default, interested gadgets set ith]h+false by default, interested gadgets set it}(hjbhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhMhjbubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1j{hjbhMhj'`ubj|)}(hF``setup_pending`` true when setup request is queued but not completed h](j)}(h``setup_pending``h]j)}(hjbh]h setup_pending}(hhhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjbubj)}(hhh]h)}(h3true when setup request is queued but not completedh]h3true when setup request is queued but not completed}(hjbhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhMhjbubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1j{hjbhMhj'`ubj|)}(hI``os_desc_pending`` true when os_desc request is queued but not completedh](j)}(h``os_desc_pending``h]j)}(hjch]hos_desc_pending}(hhhjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhjcubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjcubj)}(hhh]h)}(h5true when os_desc request is queued but not completedh]h5true when os_desc request is queued but not completed}(hj0chj.chhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj+cubah}(h]h ]h"]h$]h&]uh1jhjcubeh}(h]h ]h"]h$]h&]uh1j{hj*chMhj'`ubeh}(h]h ]h"]h$]h&]uh1jvhj_ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhjHhNubh)}(h**Description**h]je )}(hjXch]h Description}(hhhjZchhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjVcubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjHhhubh)}(hiOne of these devices is allocated and initialized before the associated device driver's bind() is called.h]hkOne of these devices is allocated and initialized before the associated device driver’s bind() is called.}(hjpchjnchhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjHhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j'config_ep_by_speed_and_alt (C function)c.config_ep_by_speed_and_althNtauh1jhjHhhhNhNubj)}(hhh](j)}(hiint config_ep_by_speed_and_alt (struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep, u8 alt)h]j)}(hhint config_ep_by_speed_and_alt(struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep, u8 alt)h](j#)}(hinth]hint}(hhhjchhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjchhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKubj)}(h h]h }(hhhjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjchhhjchKubj )}(hconfig_ep_by_speed_and_alth]j )}(hconfig_ep_by_speed_and_alth]hconfig_ep_by_speed_and_alt}(hhhjchhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjcubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjchhhjchKubj)}(hJ(struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep, u8 alt)h](j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubj)}(h h]h }(hhhjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhjchhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjcubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjcmodnameN classnameNjj)}j]j)}jjcsbc.config_ep_by_speed_and_altasbuh1hhjcubj)}(h h]h }(hhhjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubjA)}(hjDh]h*}(hhhjdhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjcubj )}(hj!h]hg}(hhhj,dhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjcubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjcubj)}(hstruct usb_function *fh](j)}(hjh]hstruct}(hhhjDdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@dubj)}(h h]h }(hhhjQdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@dubh)}(hhh]j )}(h usb_functionh]h usb_function}(hhhjbdhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj_dubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjddmodnameN classnameNjj)}j]j dc.config_ep_by_speed_and_altasbuh1hhj@dubj)}(h h]h }(hhhjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@dubjA)}(hjDh]h*}(hhhjdhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj@dubj )}(hfh]hf}(hhhjdhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj@dubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjcubj)}(hstruct usb_ep *_eph](j)}(hjh]hstruct}(hhhjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubj)}(h h]h }(hhhjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubh)}(hhh]j )}(husb_eph]husb_ep}(hhhjdhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjdubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjdmodnameN classnameNjj)}j]j dc.config_ep_by_speed_and_altasbuh1hhjdubj)}(h h]h }(hhhjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubjA)}(hjDh]h*}(hhhjdhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjdubj )}(h_eph]h_ep}(hhhj ehhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjdubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjcubj)}(hu8 alth](h)}(hhh]j )}(hu8h]hu8}(hhhj'ehhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj$eubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj)emodnameN classnameNjj)}j]j dc.config_ep_by_speed_and_altasbuh1hhj eubj)}(h h]h }(hhhjEehhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj eubj )}(halth]halt}(hhhjSehhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj eubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjcubeh}(h]h ]h"]h$]h&]j j! uh1jhjchhhjchKubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjchhhjchKubah}(h]jcah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjchhubj6 )}(hhh]h)}(h8configures the given endpoint according to gadget speed.h]h8configures the given endpoint according to gadget speed.}(hjehj~ehhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhj{ehhubah}(h]h ]h"]h$]h&]uh1j5 hjchhhjchKubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jejX jejY uh1jhhhjHhNhNubj[ )}(hX**Parameters** ``struct usb_gadget *g`` pointer to the gadget ``struct usb_function *f`` usb function ``struct usb_ep *_ep`` the endpoint to configure ``u8 alt`` alternate setting number **Return** error code, 0 on success **Description** This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor. **Note** the supplied function should hold all the descriptors for supported speedsh](h)}(h**Parameters**h]je )}(hjeh]h Parameters}(hhhjehhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjeubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubjw)}(hhh](j|)}(h/``struct usb_gadget *g`` pointer to the gadget h](j)}(h``struct usb_gadget *g``h]j)}(hjeh]hstruct usb_gadget *g}(hhhjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubj)}(hhh]h)}(hpointer to the gadgeth]hpointer to the gadget}(hjehjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehKhjeubah}(h]h ]h"]h$]h&]uh1jhjeubeh}(h]h ]h"]h$]h&]uh1j{hjehKhjeubj|)}(h(``struct usb_function *f`` usb function h](j)}(h``struct usb_function *f``h]j)}(hjeh]hstruct usb_function *f}(hhhjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubj)}(hhh]h)}(h usb functionh]h usb function}(hjfhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj fhKhjfubah}(h]h ]h"]h$]h&]uh1jhjeubeh}(h]h ]h"]h$]h&]uh1j{hj fhKhjeubj|)}(h1``struct usb_ep *_ep`` the endpoint to configure h](j)}(h``struct usb_ep *_ep``h]j)}(hj1fh]hstruct usb_ep *_ep}(hhhj3fhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/fubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhj+fubj)}(hhh]h)}(hthe endpoint to configureh]hthe endpoint to configure}(hjLfhjJfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFfhKhjGfubah}(h]h ]h"]h$]h&]uh1jhj+fubeh}(h]h ]h"]h$]h&]uh1j{hjFfhKhjeubj|)}(h$``u8 alt`` alternate setting number h](j)}(h ``u8 alt``h]j)}(hjjfh]hu8 alt}(hhhjlfhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhfubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjdfubj)}(hhh]h)}(halternate setting numberh]halternate setting number}(hjfhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjfhKhjfubah}(h]h ]h"]h$]h&]uh1jhjdfubeh}(h]h ]h"]h$]h&]uh1j{hjfhKhjeubeh}(h]h ]h"]h$]h&]uh1jvhjeubh)}(h **Return**h]je )}(hjfh]hReturn}(hhhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjfubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubh)}(herror code, 0 on successh]herror code, 0 on success}(hjfhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubh)}(h**Description**h]je )}(hjfh]h Description}(hhhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjfubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubh)}(hX@This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor.h]hX@This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor.}(hjfhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubh)}(h**Note**h]je )}(hjfh]hNote}(hhhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjfubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubh)}(hJthe supplied function should hold all the descriptors for supported speedsh]hJthe supplied function should hold all the descriptors for supported speeds}(hj ghj ghhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jconfig_ep_by_speed (C function)c.config_ep_by_speedhNtauh1jhjHhhhNhNubj)}(hhh](j)}(hYint config_ep_by_speed (struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep)h]j)}(hXint config_ep_by_speed(struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep)h](j#)}(hinth]hint}(hhhj8ghhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj4ghhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hhhjGghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ghhhjFghMubj )}(hconfig_ep_by_speedh]j )}(hconfig_ep_by_speedh]hconfig_ep_by_speed}(hhhjYghhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjUgubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj4ghhhjFghMubj)}(hB(struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep)h](j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hhhjughhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqgubj)}(h h]h }(hhhjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqgubh)}(hhh]j )}(h usb_gadgeth]h usb_gadget}(hhhjghhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjgubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjgmodnameN classnameNjj)}j]j)}jj[gsbc.config_ep_by_speedasbuh1hhjqgubj)}(h h]h }(hhhjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqgubjA)}(hjDh]h*}(hhhjghhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjqgubj )}(hj!h]hg}(hhhjghhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjqgubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjmgubj)}(hstruct usb_function *fh](j)}(hjh]hstruct}(hhhjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubj)}(h h]h }(hhhjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubh)}(hhh]j )}(h usb_functionh]h usb_function}(hhhjhhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjhubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjhmodnameN classnameNjj)}j]jgc.config_ep_by_speedasbuh1hhjgubj)}(h h]h }(hhhj"hhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubjA)}(hjDh]h*}(hhhj0hhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjgubj )}(hjdh]hf}(hhhj=hhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjgubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjmgubj)}(hstruct usb_ep *_eph](j)}(hjh]hstruct}(hhhjUhhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQhubj)}(h h]h }(hhhjbhhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQhubh)}(hhh]j )}(husb_eph]husb_ep}(hhhjshhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjphubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjuhmodnameN classnameNjj)}j]jgc.config_ep_by_speedasbuh1hhjQhubj)}(h h]h }(hhhjhhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQhubjA)}(hjDh]h*}(hhhjhhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjQhubj )}(h_eph]h_ep}(hhhjhhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjQhubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjmgubeh}(h]h ]h"]h$]h&]j j! uh1jhj4ghhhjFghMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj0ghhhjFghMubah}(h]j+gah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hj-ghhubj6 )}(hhh]h)}(h8configures the given endpoint according to gadget speed.h]h8configures the given endpoint according to gadget speed.}(hjhhjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhhhubah}(h]h ]h"]h$]h&]uh1j5 hj-ghhhjFghMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jhjX jhjY uh1jhhhjHhNhNubj[ )}(hXn**Parameters** ``struct usb_gadget *g`` pointer to the gadget ``struct usb_function *f`` usb function ``struct usb_ep *_ep`` the endpoint to configure **Return** error code, 0 on success **Description** This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor. **Note** the supplied function should hold all the descriptors for supported speedsh](h)}(h**Parameters**h]je )}(hjhh]h Parameters}(hhhjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjhubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubjw)}(hhh](j|)}(h/``struct usb_gadget *g`` pointer to the gadget h](j)}(h``struct usb_gadget *g``h]j)}(hjih]hstruct usb_gadget *g}(hhhjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjiubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjiubj)}(hhh]h)}(hpointer to the gadgeth]hpointer to the gadget}(hj3ihj1ihhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-ihMhj.iubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1j{hj-ihMhjiubj|)}(h(``struct usb_function *f`` usb function h](j)}(h``struct usb_function *f``h]j)}(hjQih]hstruct usb_function *f}(hhhjSihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOiubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjKiubj)}(hhh]h)}(h usb functionh]h usb function}(hjlihjjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjfihMhjgiubah}(h]h ]h"]h$]h&]uh1jhjKiubeh}(h]h ]h"]h$]h&]uh1j{hjfihMhjiubj|)}(h1``struct usb_ep *_ep`` the endpoint to configure h](j)}(h``struct usb_ep *_ep``h]j)}(hjih]hstruct usb_ep *_ep}(hhhjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjiubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjiubj)}(hhh]h)}(hthe endpoint to configureh]hthe endpoint to configure}(hjihjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihMhjiubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1j{hjihMhjiubeh}(h]h ]h"]h$]h&]uh1jvhjhubh)}(h **Return**h]je )}(hjih]hReturn}(hhhjihhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjiubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubh)}(herror code, 0 on successh]herror code, 0 on success}(hjihjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubh)}(h**Description**h]je )}(hjih]h Description}(hhhjihhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjiubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubh)}(hX@This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor.h]hX@This function chooses the right descriptors for a given endpoint according to gadget speed and saves it in the endpoint desc field. If the endpoint already has a descriptor assigned to it - overwrites it with currently corresponding descriptor. The endpoint maxpacket field is updated according to the chosen descriptor.}(hjjhjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubh)}(h**Note**h]je )}(hjjh]hNote}(hhhjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjjubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubh)}(hJthe supplied function should hold all the descriptors for supported speedsh]hJthe supplied function should hold all the descriptors for supported speeds}(hj+jhj)jhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_add_function (C function)c.usb_add_functionhNtauh1jhjHhhhNhNubj)}(hhh](j)}(hVint usb_add_function (struct usb_configuration *config, struct usb_function *function)h]j)}(hUint usb_add_function(struct usb_configuration *config, struct usb_function *function)h](j#)}(hinth]hint}(hhhjXjhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjTjhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM*ubj)}(h h]h }(hhhjgjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjTjhhhjfjhM*ubj )}(husb_add_functionh]j )}(husb_add_functionh]husb_add_function}(hhhjyjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjujubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjTjhhhjfjhM*ubj)}(hA(struct usb_configuration *config, struct usb_function *function)h](j)}(h struct usb_configuration *configh](j)}(hjh]hstruct}(hhhjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubj)}(h h]h }(hhhjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubh)}(hhh]j )}(husb_configurationh]husb_configuration}(hhhjjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjjmodnameN classnameNjj)}j]j)}jj{jsbc.usb_add_functionasbuh1hhjjubj)}(h h]h }(hhhjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubjA)}(hjDh]h*}(hhhjjhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjjubj )}(hconfigh]hconfig}(hhhjjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjjubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjjubj)}(hstruct usb_function *functionh](j)}(hjh]hstruct}(hhhjkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjkubj)}(h h]h }(hhhjkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjkubh)}(hhh]j )}(h usb_functionh]h usb_function}(hhhj%khhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj"kubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj'kmodnameN classnameNjj)}j]jjc.usb_add_functionasbuh1hhjkubj)}(h h]h }(hhhjCkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjkubjA)}(hjDh]h*}(hhhjQkhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjkubj )}(hfunctionh]hfunction}(hhhj^khhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjkubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjjubeh}(h]h ]h"]h$]h&]j j! uh1jhjTjhhhjfjhM*ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjPjhhhjfjhM*ubah}(h]jKjah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM6hjMjhhubj6 )}(hhh]h)}(h!add a function to a configurationh]h!add a function to a configuration}(hjkhjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM)hjkhhubah}(h]h ]h"]h$]h&]uh1j5 hjMjhhhjfjhM*ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jkjX jkjY uh1jhhhjHhNhNubj[ )}(hX**Parameters** ``struct usb_configuration *config`` the configuration ``struct usb_function *function`` the function being added **Context** single threaded during gadget setup **Description** After initialization, each configuration must have one or more functions added to it. Adding a function involves calling its **bind\(\)** method to allocate resources such as interface and string identifiers and endpoints. This function returns the value of the function's bind(), which is zero for success else a negative errno value.h](h)}(h**Parameters**h]je )}(hjkh]h Parameters}(hhhjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjkubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM-hjkubjw)}(hhh](j|)}(h7``struct usb_configuration *config`` the configuration h](j)}(h$``struct usb_configuration *config``h]j)}(hjkh]h struct usb_configuration *config}(hhhjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjkubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM*hjkubj)}(hhh]h)}(hthe configurationh]hthe configuration}(hjkhjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjkhM*hjkubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1j{hjkhM*hjkubj|)}(h;``struct usb_function *function`` the function being added h](j)}(h!``struct usb_function *function``h]j)}(hjlh]hstruct usb_function *function}(hhhjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjlubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM+hjkubj)}(hhh]h)}(hthe function being addedh]hthe function being added}(hjlhjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjlhM+hjlubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1j{hjlhM+hjkubeh}(h]h ]h"]h$]h&]uh1jvhjkubh)}(h **Context**h]je )}(hj>lh]hContext}(hhhj@lhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjpubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjphhhj/phMubj)}(hA(struct usb_configuration *config, struct usb_function *function)h](j)}(h struct usb_configuration *configh](j)}(hjh]hstruct}(hhhj^phhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjZpubj)}(h h]h }(hhhjkphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjZpubh)}(hhh]j )}(husb_configurationh]husb_configuration}(hhhj|phhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjypubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj~pmodnameN classnameNjj)}j]j)}jjDpsbc.usb_interface_idasbuh1hhjZpubj)}(h h]h }(hhhjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjZpubjA)}(hjDh]h*}(hhhjphhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjZpubj )}(hconfigh]hconfig}(hhhjphhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjZpubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjVpubj)}(hstruct usb_function *functionh](j)}(hjh]hstruct}(hhhjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubj)}(h h]h }(hhhjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubh)}(hhh]j )}(h usb_functionh]h usb_function}(hhhjphhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjpubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjpmodnameN classnameNjj)}j]jpc.usb_interface_idasbuh1hhjpubj)}(h h]h }(hhhj qhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubjA)}(hjDh]h*}(hhhjqhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjpubj )}(hfunctionh]hfunction}(hhhj'qhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjpubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjVpubeh}(h]h ]h"]h$]h&]j j! uh1jhjphhhj/phMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjphhhj/phMubah}(h]jpah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjphhubj6 )}(hhh]h)}(hallocate an unused interface IDh]hallocate an unused interface ID}(hjTqhjRqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjOqhhubah}(h]h ]h"]h$]h&]uh1j5 hjphhhj/phMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jjqjX jjqjY uh1jhhhjHhNhNubj[ )}(hX_**Parameters** ``struct usb_configuration *config`` configuration associated with the interface ``struct usb_function *function`` function handling the interface **Context** single threaded during gadget setup **Description** usb_interface_id() is called from usb_function.bind() callbacks to allocate new interface IDs. The function driver will then store that ID in interface, association, CDC union, and other descriptors. It will also handle any control requests targeted at that interface, particularly changing its altsetting via set_alt(). There may also be class-specific or vendor-specific requests to handle. All interface identifier should be allocated using this routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier. Note that since interface identifiers are configuration-specific, functions used in more than one configuration (or more than once in a given configuration) need multiple versions of the relevant descriptors. Returns the interface ID which was allocated; or -ENODEV if no more interface IDs can be allocated.h](h)}(h**Parameters**h]je )}(hjtqh]h Parameters}(hhhjvqhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjrqubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubjw)}(hhh](j|)}(hQ``struct usb_configuration *config`` configuration associated with the interface h](j)}(h$``struct usb_configuration *config``h]j)}(hjqh]h struct usb_configuration *config}(hhhjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjqubj)}(hhh]h)}(h+configuration associated with the interfaceh]h+configuration associated with the interface}(hjqhjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqhMhjqubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1j{hjqhMhjqubj|)}(hB``struct usb_function *function`` function handling the interface h](j)}(h!``struct usb_function *function``h]j)}(hjqh]hstruct usb_function *function}(hhhjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjqubj)}(hhh]h)}(hfunction handling the interfaceh]hfunction handling the interface}(hjqhjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqhMhjqubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1j{hjqhMhjqubeh}(h]h ]h"]h$]h&]uh1jvhjnqubh)}(h **Context**h]je )}(hjrh]hContext}(hhhj rhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjrubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjrhjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubh)}(h**Description**h]je )}(hj.rh]h Description}(hhhj0rhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj,rubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubh)}(hXusb_interface_id() is called from usb_function.bind() callbacks to allocate new interface IDs. The function driver will then store that ID in interface, association, CDC union, and other descriptors. It will also handle any control requests targeted at that interface, particularly changing its altsetting via set_alt(). There may also be class-specific or vendor-specific requests to handle.h]hXusb_interface_id() is called from usb_function.bind() callbacks to allocate new interface IDs. The function driver will then store that ID in interface, association, CDC union, and other descriptors. It will also handle any control requests targeted at that interface, particularly changing its altsetting via set_alt(). There may also be class-specific or vendor-specific requests to handle.}(hjFrhjDrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubh)}(hXAll interface identifier should be allocated using this routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier. Note that since interface identifiers are configuration-specific, functions used in more than one configuration (or more than once in a given configuration) need multiple versions of the relevant descriptors.h]hXAll interface identifier should be allocated using this routine, to ensure that for example different functions don’t wrongly assign different meanings to the same identifier. Note that since interface identifiers are configuration-specific, functions used in more than one configuration (or more than once in a given configuration) need multiple versions of the relevant descriptors.}(hjUrhjSrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubh)}(hcReturns the interface ID which was allocated; or -ENODEV if no more interface IDs can be allocated.h]hcReturns the interface ID which was allocated; or -ENODEV if no more interface IDs can be allocated.}(hjdrhjbrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnqubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_func_wakeup (C function)c.usb_func_wakeuphNtauh1jhjHhhhNhNubj)}(hhh](j)}(h/int usb_func_wakeup (struct usb_function *func)h]j)}(h.int usb_func_wakeup(struct usb_function *func)h](j#)}(hinth]hint}(hhhjrhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjrhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hhhjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjrhhhjrhMubj )}(husb_func_wakeuph]j )}(husb_func_wakeuph]husb_func_wakeup}(hhhjrhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjrubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjrhhhjrhMubj)}(h(struct usb_function *func)h]j)}(hstruct usb_function *funch](j)}(hjh]hstruct}(hhhjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjrubj)}(h h]h }(hhhjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjrubh)}(hhh]j )}(h usb_functionh]h usb_function}(hhhjrhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjrubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjrmodnameN classnameNjj)}j]j)}jjrsbc.usb_func_wakeupasbuh1hhjrubj)}(h h]h }(hhhj shhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjrubjA)}(hjDh]h*}(hhhjshhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjrubj )}(hfunch]hfunc}(hhhj'shhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjrubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjrubah}(h]h ]h"]h$]h&]j j! uh1jhjrhhhjrhMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjrhhhjrhMubah}(h]jrah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjrhhubj6 )}(hhh]h)}(h-sends function wake notification to the host.h]h-sends function wake notification to the host.}(hjTshjRshhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjOshhubah}(h]h ]h"]h$]h&]uh1j5 hjrhhhjrhMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jjsjX jjsjY uh1jhhhjHhNhNubj[ )}(hX}**Parameters** ``struct usb_function *func`` function that sends the remote wakeup notification. **Description** Applicable to devices operating at enhanced superspeed when usb functions are put in function suspend state and armed for function remote wakeup. On completion, function wake notification is sent. If the device is in low power state it tries to bring the device to active state before sending the wake notification. Since it is a synchronous call, caller must take care of not calling it in interrupt context. For devices operating at lower speeds returns negative errno. Returns zero on success, else negative errno.h](h)}(h**Parameters**h]je )}(hjtsh]h Parameters}(hhhjvshhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjrsubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnsubjw)}(hhh]j|)}(hR``struct usb_function *func`` function that sends the remote wakeup notification. h](j)}(h``struct usb_function *func``h]j)}(hjsh]hstruct usb_function *func}(hhhjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhjsubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjsubj)}(hhh]h)}(h3function that sends the remote wakeup notification.h]h3function that sends the remote wakeup notification.}(hjshjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjshMhjsubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1j{hjshMhjsubah}(h]h ]h"]h$]h&]uh1jvhjnsubh)}(h**Description**h]je )}(hjsh]h Description}(hhhjshhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjsubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnsubh)}(hXApplicable to devices operating at enhanced superspeed when usb functions are put in function suspend state and armed for function remote wakeup. On completion, function wake notification is sent. If the device is in low power state it tries to bring the device to active state before sending the wake notification. Since it is a synchronous call, caller must take care of not calling it in interrupt context. For devices operating at lower speeds returns negative errno.h]hXApplicable to devices operating at enhanced superspeed when usb functions are put in function suspend state and armed for function remote wakeup. On completion, function wake notification is sent. If the device is in low power state it tries to bring the device to active state before sending the wake notification. Since it is a synchronous call, caller must take care of not calling it in interrupt context. For devices operating at lower speeds returns negative errno.}(hjshjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnsubh)}(h-Returns zero on success, else negative errno.h]h-Returns zero on success, else negative errno.}(hjshjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnsubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_add_config (C function)c.usb_add_confighNtauh1jhjHhhhNhNubj)}(hhh](j)}(h~int usb_add_config (struct usb_composite_dev *cdev, struct usb_configuration *config, int (*bind)(struct usb_configuration *))h]j)}(h|int usb_add_config(struct usb_composite_dev *cdev, struct usb_configuration *config, int (*bind)(struct usb_configuration*))h](j#)}(hinth]hint}(hhhj"thhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjthhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMCubj)}(h h]h }(hhhj1thhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjthhhj0thMCubj )}(husb_add_configh]j )}(husb_add_configh]husb_add_config}(hhhjCthhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj?tubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjthhhj0thMCubj)}(hj(struct usb_composite_dev *cdev, struct usb_configuration *config, int (*bind)(struct usb_configuration*))h](j)}(hstruct usb_composite_dev *cdevh](j)}(hjh]hstruct}(hhhj_thhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj[tubj)}(h h]h }(hhhjlthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj[tubh)}(hhh]j )}(husb_composite_devh]husb_composite_dev}(hhhj}thhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjztubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjtmodnameN classnameNjj)}j]j)}jjEtsbc.usb_add_configasbuh1hhj[tubj)}(h h]h }(hhhjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj[tubjA)}(hjDh]h*}(hhhjthhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj[tubj )}(hcdevh]hcdev}(hhhjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj[tubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjWtubj)}(h struct usb_configuration *configh](j)}(hjh]hstruct}(hhhjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubj)}(h h]h }(hhhjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubh)}(hhh]j )}(husb_configurationh]husb_configuration}(hhhjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjtubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjtmodnameN classnameNjj)}j]jtc.usb_add_configasbuh1hhjtubj)}(h h]h }(hhhj uhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubjA)}(hjDh]h*}(hhhjuhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjtubj )}(hconfigh]hconfig}(hhhj(uhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjtubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjWtubj)}(h&int (*bind)(struct usb_configuration*)h](j#)}(hinth]hint}(hhhjAuhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj=uubj)}(h h]h }(hhhjOuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=uubjA)}(h(h]h(}(hhhj]uhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=uubjA)}(hjDh]h*}(hhhjkuhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=uubj )}(hbindh]hbind}(hhhjxuhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj=uubjA)}(h)h]h)}(hhhjuhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=uubjA)}(hj_uh]h(}(hhhjuhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=uubj)}(hjh]hstruct}(hhhjuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=uubj)}(h h]h }(hhhjuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=uubh)}(hhh]j )}(husb_configurationh]husb_configuration}(hhhjuhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjuubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjumodnameN classnameNjj)}j]jtc.usb_add_configasbuh1hhj=uubjA)}(hjDh]h*}(hhhjuhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=uubjA)}(hjuh]h)}(hhhjuhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj=uubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjWtubeh}(h]h ]h"]h$]h&]j j! uh1jhjthhhj0thMCubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjthhhj0thMCubah}(h]jtah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMPhjthhubj6 )}(hhh]h)}(h add a configuration to a device.h]h add a configuration to a device.}(hjvhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMBhjvhhubah}(h]h ]h"]h$]h&]uh1j5 hjthhhj0thMCubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j,vjX j,vjY uh1jhhhjHhNhNubj[ )}(hX**Parameters** ``struct usb_composite_dev *cdev`` wraps the USB gadget ``struct usb_configuration *config`` the configuration, with bConfigurationValue assigned ``int (*bind)(struct usb_configuration *)`` the configuration's bind function **Context** single threaded during gadget setup **Description** One of the main tasks of a composite **bind\(\)** routine is to add each of the configurations it supports, using this routine. This function returns the value of the configuration's **bind\(\)**, which is zero for success else a negative errno value. Binding configurations assigns global resources including string IDs, and per-configuration resources such as interface IDs and endpoints.h](h)}(h**Parameters**h]je )}(hj6vh]h Parameters}(hhhj8vhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj4vubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMFhj0vubjw)}(hhh](j|)}(h8``struct usb_composite_dev *cdev`` wraps the USB gadget h](j)}(h"``struct usb_composite_dev *cdev``h]j)}(hjUvh]hstruct usb_composite_dev *cdev}(hhhjWvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSvubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMChjOvubj)}(hhh]h)}(hwraps the USB gadgeth]hwraps the USB gadget}(hjpvhjnvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjjvhMChjkvubah}(h]h ]h"]h$]h&]uh1jhjOvubeh}(h]h ]h"]h$]h&]uh1j{hjjvhMChjLvubj|)}(hZ``struct usb_configuration *config`` the configuration, with bConfigurationValue assigned h](j)}(h$``struct usb_configuration *config``h]j)}(hjvh]h struct usb_configuration *config}(hhhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMDhjvubj)}(hhh]h)}(h4the configuration, with bConfigurationValue assignedh]h4the configuration, with bConfigurationValue assigned}(hjvhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjvhMDhjvubah}(h]h ]h"]h$]h&]uh1jhjvubeh}(h]h ]h"]h$]h&]uh1j{hjvhMDhjLvubj|)}(hN``int (*bind)(struct usb_configuration *)`` the configuration's bind function h](j)}(h+``int (*bind)(struct usb_configuration *)``h]j)}(hjvh]h'int (*bind)(struct usb_configuration *)}(hhhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMEhjvubj)}(hhh]h)}(h!the configuration's bind functionh]h#the configuration’s bind function}(hjvhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjvhMEhjvubah}(h]h ]h"]h$]h&]uh1jhjvubeh}(h]h ]h"]h$]h&]uh1j{hjvhMEhjLvubeh}(h]h ]h"]h$]h&]uh1jvhj0vubh)}(h **Context**h]je )}(hjwh]hContext}(hhhjwhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjwubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMGhj0vubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjwhjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMFhj0vubh)}(h**Description**h]je )}(hj)wh]h Description}(hhhj+whhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj'wubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMHhj0vubh)}(hOne of the main tasks of a composite **bind\(\)** routine is to add each of the configurations it supports, using this routine.h](h%One of the main tasks of a composite }(h%One of the main tasks of a composite hj?whhhNhNubje )}(h **bind\(\)**h]hbind()}(hhhjHwhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj?wubhN routine is to add each of the configurations it supports, using this routine.}(hN routine is to add each of the configurations it supports, using this routine.hj?whhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMGhj0vubh)}(hXThis function returns the value of the configuration's **bind\(\)**, which is zero for success else a negative errno value. Binding configurations assigns global resources including string IDs, and per-configuration resources such as interface IDs and endpoints.h](h9This function returns the value of the configuration’s }(h7This function returns the value of the configuration's hjbwhhhNhNubje )}(h **bind\(\)**h]hbind()}(hhhjkwhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjbwubh, which is zero for success else a negative errno value. Binding configurations assigns global resources including string IDs, and per-configuration resources such as interface IDs and endpoints.}(h, which is zero for success else a negative errno value. Binding configurations assigns global resources including string IDs, and per-configuration resources such as interface IDs and endpoints.hjbwhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMJhj0vubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string_id (C function)c.usb_string_idhNtauh1jhjHhhhNhNubj)}(hhh](j)}(h2int usb_string_id (struct usb_composite_dev *cdev)h]j)}(h1int usb_string_id(struct usb_composite_dev *cdev)h](j#)}(hinth]hint}(hhhjwhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjwhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM[ubj)}(h h]h }(hhhjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwhhhjwhM[ubj )}(h usb_string_idh]j )}(h usb_string_idh]h usb_string_id}(hhhjwhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjwubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjwhhhjwhM[ubj)}(h (struct usb_composite_dev *cdev)h]j)}(hstruct usb_composite_dev *cdevh](j)}(hjh]hstruct}(hhhjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwubj)}(h h]h }(hhhjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwubh)}(hhh]j )}(husb_composite_devh]husb_composite_dev}(hhhjxhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjwubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjxmodnameN classnameNjj)}j]j)}jjwsbc.usb_string_idasbuh1hhjwubj)}(h h]h }(hhhj xhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwubjA)}(hjDh]h*}(hhhj.xhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjwubj )}(hcdevh]hcdev}(hhhj;xhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjwubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjwubah}(h]h ]h"]h$]h&]j j! uh1jhjwhhhjwhM[ubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjwhhhjwhM[ubah}(h]jwah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMghjwhhubj6 )}(hhh]h)}(hallocate an unused string IDh]hallocate an unused string ID}(hjhxhjfxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMZhjcxhhubah}(h]h ]h"]h$]h&]uh1j5 hjwhhhjwhM[ubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j~xjX j~xjY uh1jhhhjHhNhNubj[ )}(hXc**Parameters** ``struct usb_composite_dev *cdev`` the device whose string descriptor IDs are being allocated **Context** single threaded during gadget setup **Description** **usb_string_id\(\)** is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table. All string identifier should be allocated using this, **usb_string_ids_tab\(\)** or **usb_string_ids_n\(\)** routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.h](h)}(h**Parameters**h]je )}(hjxh]h Parameters}(hhhjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjxubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM^hjxubjw)}(hhh]j|)}(h^``struct usb_composite_dev *cdev`` the device whose string descriptor IDs are being allocated h](j)}(h"``struct usb_composite_dev *cdev``h]j)}(hjxh]hstruct usb_composite_dev *cdev}(hhhjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM[hjxubj)}(hhh]h)}(h:the device whose string descriptor IDs are being allocatedh]h:the device whose string descriptor IDs are being allocated}(hjxhjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhM[hjxubah}(h]h ]h"]h$]h&]uh1jhjxubeh}(h]h ]h"]h$]h&]uh1j{hjxhM[hjxubah}(h]h ]h"]h$]h&]uh1jvhjxubh)}(h **Context**h]je )}(hjxh]hContext}(hhhjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjxubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM]hjxubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjxhjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM\hjxubh)}(h**Description**h]je )}(hj yh]h Description}(hhhj yhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjyubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM^hjxubh)}(h**usb_string_id\(\)** is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table.h](je )}(h**usb_string_id\(\)**h]husb_string_id()}(hhhj#yhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjyubh is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table.}(h is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table.hjyhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM]hjxubh)}(hAll string identifier should be allocated using this, **usb_string_ids_tab\(\)** or **usb_string_ids_n\(\)** routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.h](h6All string identifier should be allocated using this, }(h6All string identifier should be allocated using this, hj=yhhhNhNubje )}(h**usb_string_ids_tab\(\)**h]husb_string_ids_tab()}(hhhjFyhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj=yubh or }(h or hj=yhhhNhNubje )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hhhjYyhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj=yubhz routine, to ensure that for example different functions don’t wrongly assign different meanings to the same identifier.}(hx routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.hj=yhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMahjxubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string_ids_tab (C function)c.usb_string_ids_tabhNtauh1jhjHhhhNhNubj)}(hhh](j)}(hOint usb_string_ids_tab (struct usb_composite_dev *cdev, struct usb_string *str)h]j)}(hNint usb_string_ids_tab(struct usb_composite_dev *cdev, struct usb_string *str)h](j#)}(hinth]hint}(hhhjyhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjyhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMvubj)}(h h]h }(hhhjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyhhhjyhMvubj )}(husb_string_ids_tabh]j )}(husb_string_ids_tabh]husb_string_ids_tab}(hhhjyhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjyubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjyhhhjyhMvubj)}(h8(struct usb_composite_dev *cdev, struct usb_string *str)h](j)}(hstruct usb_composite_dev *cdevh](j)}(hjh]hstruct}(hhhjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubj)}(h h]h }(hhhjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubh)}(hhh]j )}(husb_composite_devh]husb_composite_dev}(hhhjyhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjyubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjymodnameN classnameNjj)}j]j)}jjysbc.usb_string_ids_tabasbuh1hhjyubj)}(h h]h }(hhhjzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubjA)}(hjDh]h*}(hhhjzhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjyubj )}(hcdevh]hcdev}(hhhj)zhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjyubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjyubj)}(hstruct usb_string *strh](j)}(hjh]hstruct}(hhhjBzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>zubj)}(h h]h }(hhhjOzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>zubh)}(hhh]j )}(h usb_stringh]h usb_string}(hhhj`zhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj]zubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjbzmodnameN classnameNjj)}j]j zc.usb_string_ids_tabasbuh1hhj>zubj)}(h h]h }(hhhj~zhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>zubjA)}(hjDh]h*}(hhhjzhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj>zubj )}(hstrh]hstr}(hhhjzhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj>zubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjyubeh}(h]h ]h"]h$]h&]j j! uh1jhjyhhhjyhMvubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjyhhhjyhMvubah}(h]jyah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjyhhubj6 )}(hhh]h)}(h#allocate unused string IDs in batchh]h#allocate unused string IDs in batch}(hjzhjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMuhjzhhubah}(h]h ]h"]h$]h&]uh1j5 hjyhhhjyhMvubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jzjX jzjY uh1jhhhjHhNhNubj[ )}(hX**Parameters** ``struct usb_composite_dev *cdev`` the device whose string descriptor IDs are being allocated ``struct usb_string *str`` an array of usb_string objects to assign numbers to **Context** single threaded during gadget setup **Description** **usb_string_ids\(\)** is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then copy IDs from the string table to the appropriate descriptors and string table for other languages. All string identifier should be allocated using this, **usb_string_id\(\)** or **usb_string_ids_n\(\)** routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.h](h)}(h**Parameters**h]je )}(hjzh]h Parameters}(hhhjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjzubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMyhjzubjw)}(hhh](j|)}(h^``struct usb_composite_dev *cdev`` the device whose string descriptor IDs are being allocated h](j)}(h"``struct usb_composite_dev *cdev``h]j)}(hj{h]hstruct usb_composite_dev *cdev}(hhhj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj{ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMvhjzubj)}(hhh]h)}(h:the device whose string descriptor IDs are being allocatedh]h:the device whose string descriptor IDs are being allocated}(hj {hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj{hMvhj{ubah}(h]h ]h"]h$]h&]uh1jhjzubeh}(h]h ]h"]h$]h&]uh1j{hj{hMvhjzubj|)}(hO``struct usb_string *str`` an array of usb_string objects to assign numbers to h](j)}(h``struct usb_string *str``h]j)}(hj>{h]hstruct usb_string *str}(hhhj@{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<{ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMwhj8{ubj)}(hhh]h)}(h3an array of usb_string objects to assign numbers toh]h3an array of usb_string objects to assign numbers to}(hjY{hjW{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjS{hMwhjT{ubah}(h]h ]h"]h$]h&]uh1jhj8{ubeh}(h]h ]h"]h$]h&]uh1j{hjS{hMwhjzubeh}(h]h ]h"]h$]h&]uh1jvhjzubh)}(h **Context**h]je )}(hjy{h]hContext}(hhhj{{hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjw{ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMyhjzubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hj{hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMxhjzubh)}(h**Description**h]je )}(hj{h]h Description}(hhhj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj{ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMzhjzubh)}(h**usb_string_ids\(\)** is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then copy IDs from the string table to the appropriate descriptors and string table for other languages.h](je )}(h**usb_string_ids\(\)**h]husb_string_ids()}(hhhj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj{ubh is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then copy IDs from the string table to the appropriate descriptors and string table for other languages.}(h is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then copy IDs from the string table to the appropriate descriptors and string table for other languages.hj{hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMyhjzubh)}(hAll string identifier should be allocated using this, **usb_string_id\(\)** or **usb_string_ids_n\(\)** routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.h](h6All string identifier should be allocated using this, }(h6All string identifier should be allocated using this, hj{hhhNhNubje )}(h**usb_string_id\(\)**h]husb_string_id()}(hhhj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj{ubh or }(h or hj{hhhNhNubje )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hhhj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj{ubhz routine, to ensure that for example different functions don’t wrongly assign different meanings to the same identifier.}(hx routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.hj{hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM~hjzubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j usb_gstrings_attach (C function)c.usb_gstrings_attachhNtauh1jhjHhhhNhNubj)}(hhh](j)}(h|struct usb_string * usb_gstrings_attach (struct usb_composite_dev *cdev, struct usb_gadget_strings **sp, unsigned n_strings)h]j)}(hzstruct usb_string *usb_gstrings_attach(struct usb_composite_dev *cdev, struct usb_gadget_strings **sp, unsigned n_strings)h](j)}(hjh]hstruct}(hhhj*|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&|hhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hhhj8|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&|hhhj7|hMubh)}(hhh]j )}(h usb_stringh]h usb_string}(hhhjI|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjF|ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjK|modnameN classnameNjj)}j]j)}jusb_gstrings_attachsbc.usb_gstrings_attachasbuh1hhj&|hhhj7|hMubj)}(h h]h }(hhhjj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&|hhhj7|hMubjA)}(hjDh]h*}(hhhjx|hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj&|hhhj7|hMubj )}(husb_gstrings_attachh]j )}(hjg|h]husb_gstrings_attach}(hhhj|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj|ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hj&|hhhj7|hMubj)}(hT(struct usb_composite_dev *cdev, struct usb_gadget_strings **sp, unsigned n_strings)h](j)}(hstruct usb_composite_dev *cdevh](j)}(hjh]hstruct}(hhhj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubj)}(h h]h }(hhhj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubh)}(hhh]j )}(husb_composite_devh]husb_composite_dev}(hhhj|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj|ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj|modnameN classnameNjj)}j]je|c.usb_gstrings_attachasbuh1hhj|ubj)}(h h]h }(hhhj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubjA)}(hjDh]h*}(hhhj|hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj|ubj )}(hcdevh]hcdev}(hhhj|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj|ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj|ubj)}(hstruct usb_gadget_strings **sph](j)}(hjh]hstruct}(hhhj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(h h]h }(hhhj!}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubh)}(hhh]j )}(husb_gadget_stringsh]husb_gadget_strings}(hhhj2}hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj/}ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj4}modnameN classnameNjj)}j]je|c.usb_gstrings_attachasbuh1hhj}ubj)}(h h]h }(hhhjP}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubjA)}(hjDh]h*}(hhhj^}hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj}ubjA)}(hjDh]h*}(hhhjk}hhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hj}ubj )}(hsph]hsp}(hhhjx}hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj}ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj|ubj)}(hunsigned n_stringsh](j#)}(hunsignedh]hunsigned}(hhhj}hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj}ubj)}(h h]h }(hhhj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj )}(h n_stringsh]h n_strings}(hhhj}hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj}ubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhj|ubeh}(h]h ]h"]h$]h&]j j! uh1jhj&|hhhj7|hMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hj"|hhhj7|hMubah}(h]j|ah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj|hhubj6 )}(hhh]h)}(h.attach gadget strings to a cdev and assign idsh]h.attach gadget strings to a cdev and assign ids}(hj}hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj}hhubah}(h]h ]h"]h$]h&]uh1j5 hj|hhhj7|hMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW j}jX j}jY uh1jhhhjHhNhNubj[ )}(hX**Parameters** ``struct usb_composite_dev *cdev`` the device whose string descriptor IDs are being allocated and attached. ``struct usb_gadget_strings **sp`` an array of usb_gadget_strings to attach. ``unsigned n_strings`` number of entries in each usb_strings array (sp[]->strings) **Description** This function will create a deep copy of usb_gadget_strings and usb_string and attach it to the cdev. The actual string (usb_string.s) will not be copied but only a referenced will be made. The struct usb_gadget_strings array may contain multiple languages and should be NULL terminated. The ->language pointer of each struct usb_gadget_strings has to contain the same amount of entries. For instance: sp[0] is en-US, sp[1] is es-ES. It is expected that the first usb_string entry of es-ES contains the translation of the first usb_string entry of en-US. Therefore both entries become the same id assign.h](h)}(h**Parameters**h]je )}(hj}h]h Parameters}(hhhj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj}ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj}ubjw)}(hhh](j|)}(hl``struct usb_composite_dev *cdev`` the device whose string descriptor IDs are being allocated and attached. h](j)}(h"``struct usb_composite_dev *cdev``h]j)}(hj~h]hstruct usb_composite_dev *cdev}(hhhj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj~ubj)}(hhh]h)}(hHthe device whose string descriptor IDs are being allocated and attached.h]hHthe device whose string descriptor IDs are being allocated and attached.}(hj4~hj2~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj/~ubah}(h]h ]h"]h$]h&]uh1jhj~ubeh}(h]h ]h"]h$]h&]uh1j{hj.~hMhj~ubj|)}(hM``struct usb_gadget_strings **sp`` an array of usb_gadget_strings to attach. h](j)}(h"``struct usb_gadget_strings **sp``h]j)}(hjS~h]hstruct usb_gadget_strings **sp}(hhhjU~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ~ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjM~ubj)}(hhh]h)}(h)an array of usb_gadget_strings to attach.h]h)an array of usb_gadget_strings to attach.}(hjn~hjl~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh~hMhji~ubah}(h]h ]h"]h$]h&]uh1jhjM~ubeh}(h]h ]h"]h$]h&]uh1j{hjh~hMhj~ubj|)}(hS``unsigned n_strings`` number of entries in each usb_strings array (sp[]->strings) h](j)}(h``unsigned n_strings``h]j)}(hj~h]hunsigned n_strings}(hhhj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj~ubj)}(hhh]h)}(h;number of entries in each usb_strings array (sp[]->strings)h]h;number of entries in each usb_strings array (sp[]->strings)}(hj~hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~hMhj~ubah}(h]h ]h"]h$]h&]uh1jhj~ubeh}(h]h ]h"]h$]h&]uh1j{hj~hMhj~ubeh}(h]h ]h"]h$]h&]uh1jvhj}ubh)}(h**Description**h]je )}(hj~h]h Description}(hhhj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj~ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj}ubh)}(hX\This function will create a deep copy of usb_gadget_strings and usb_string and attach it to the cdev. The actual string (usb_string.s) will not be copied but only a referenced will be made. The struct usb_gadget_strings array may contain multiple languages and should be NULL terminated. The ->language pointer of each struct usb_gadget_strings has to contain the same amount of entries. For instance: sp[0] is en-US, sp[1] is es-ES. It is expected that the first usb_string entry of es-ES contains the translation of the first usb_string entry of en-US. Therefore both entries become the same id assign.h]hX\This function will create a deep copy of usb_gadget_strings and usb_string and attach it to the cdev. The actual string (usb_string.s) will not be copied but only a referenced will be made. The struct usb_gadget_strings array may contain multiple languages and should be NULL terminated. The ->language pointer of each struct usb_gadget_strings has to contain the same amount of entries. For instance: sp[0] is en-US, sp[1] is es-ES. It is expected that the first usb_string entry of es-ES contains the translation of the first usb_string entry of en-US. Therefore both entries become the same id assign.}(hj~hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj}ubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string_ids_n (C function)c.usb_string_ids_nhNtauh1jhjHhhhNhNubj)}(hhh](j)}(h>int usb_string_ids_n (struct usb_composite_dev *c, unsigned n)h]j)}(h=int usb_string_ids_n(struct usb_composite_dev *c, unsigned n)h](j#)}(hinth]hint}(hhhj hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj )}(husb_string_ids_nh]j )}(husb_string_ids_nh]husb_string_ids_n}(hhhj-hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj)ubah}(h]h ](j j eh"]h$]h&]j j! uh1j hjhhhjhMubj)}(h)(struct usb_composite_dev *c, unsigned n)h](j)}(hstruct usb_composite_dev *ch](j)}(hjh]hstruct}(hhhjIhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjEubj)}(h h]h }(hhhjVhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjEubh)}(hhh]j )}(husb_composite_devh]husb_composite_dev}(hhhjghhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjdubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjimodnameN classnameNjj)}j]j)}jj/sbc.usb_string_ids_nasbuh1hhjEubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjEubjA)}(hjDh]h*}(hhhjhhhNhNubah}(h]h ]jMah"]h$]h&]uh1j@hjEubj )}(hjh]hc}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjEubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjAubj)}(h unsigned nh](j#)}(hunsignedh]hunsigned}(hhhjhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjubj)}(h h]h }(hhhjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj )}(hj h]hn}(hhhjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]noemphj j! uh1jhjAubeh}(h]h ]h"]h$]h&]j j! uh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]j j! j( uh1jj) j* hjhhhjhMubah}(h]j~ah ](j. j/ eh"]h$]h&]j3 uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhhubj6 )}(hhh]h)}(h#allocate unused string IDs in batchh]h#allocate unused string IDs in batch}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhhubah}(h]h ]h"]h$]h&]uh1j5 hjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]jV jjW jjX jjY uh1jhhhjHhNhNubj[ )}(hX_**Parameters** ``struct usb_composite_dev *c`` the device whose string descriptor IDs are being allocated ``unsigned n`` number of string IDs to allocate **Context** single threaded during gadget setup **Description** Returns the first requested ID. This ID and next **n**-1 IDs are now valid IDs. At least provided that **n** is non-zero because if it is, returns last requested ID which is now very useful information. **usb_string_ids_n\(\)** is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table. All string identifier should be allocated using this, **usb_string_id\(\)** or **usb_string_ids_n\(\)** routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.h](h)}(h**Parameters**h]je )}(hj"h]h Parameters}(hhhj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubjw)}(hhh](j|)}(h[``struct usb_composite_dev *c`` the device whose string descriptor IDs are being allocated h](j)}(h``struct usb_composite_dev *c``h]j)}(hjAh]hstruct usb_composite_dev *c}(hhhjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj;ubj)}(hhh]h)}(h:the device whose string descriptor IDs are being allocatedh]h:the device whose string descriptor IDs are being allocated}(hj\hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhMhjWubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1j{hjVhMhj8ubj|)}(h0``unsigned n`` number of string IDs to allocate h](j)}(h``unsigned n``h]j)}(hjzh]h unsigned n}(hhhj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjtubj)}(hhh]h)}(h number of string IDs to allocateh]h number of string IDs to allocate}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1j{hjhMhj8ubeh}(h]h ]h"]h$]h&]uh1jvhjubh)}(h **Context**h]je )}(hjh]hContext}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hj̀hjˀhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubh)}(h**Description**h]je )}(hj܀h]h Description}(hhhjހhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjڀubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubh)}(hReturns the first requested ID. This ID and next **n**-1 IDs are now valid IDs. At least provided that **n** is non-zero because if it is, returns last requested ID which is now very useful information.h](h2Returns the first requested ID. This ID and next }(h2Returns the first requested ID. This ID and next hjhhhNhNubje )}(h**n**h]hn}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubh2-1 IDs are now valid IDs. At least provided that }(h2-1 IDs are now valid IDs. At least provided that hjhhhNhNubje )}(h**n**h]hn}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjubh^ is non-zero because if it is, returns last requested ID which is now very useful information.}(h^ is non-zero because if it is, returns last requested ID which is now very useful information.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubh)}(h**usb_string_ids_n\(\)** is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table.h](je )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hhhj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj(ubh is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table.}(h is called from bind() callbacks to allocate string IDs. Drivers for functions, configurations, or gadgets will then store that ID in the appropriate descriptors and string table.hj(hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjubh)}(hAll string identifier should be allocated using this, **usb_string_id\(\)** or **usb_string_ids_n\(\)** routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.h](h6All string identifier should be allocated using this, }(h6All string identifier should be allocated using this, hjFhhhNhNubje )}(h**usb_string_id\(\)**h]husb_string_id()}(hhhjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjFubh or }(h or hjFhhhNhNubje )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hhhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jd hjFubhz routine, to ensure that for example different functions don’t wrongly assign different meanings to the same identifier.}(hx routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier.hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j usb_composite_probe (C function)c.usb_composite_probehNtauh1jhjHhhhNhNubj)}(hhh](j)}(h=int usb_composite_probe (struct usb_composite_driver *driver)h]j)}(hthe composite device who’s control transfer was kept waiting}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hjhM hjubah}(h]h ]h"]h$]h&]uh1jvhjDžubh)}(h**Description**h]je )}(hj'h]h Description}(hhhj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jd hj%ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjDžubh)}(hXWThis function must be called by the USB function driver to continue with the control transfer's data/status stage in case it had requested to delay the data/status stages. A USB function's setup handler (e.g. set_alt()) can request the composite framework to delay the setup request's data/status stages by returning USB_GADGET_DELAYED_STATUS.h]hX]This function must be called by the USB function driver to continue with the control transfer’s data/status stage in case it had requested to delay the data/status stages. A USB function’s setup handler (e.g. set_alt()) can request the composite framework to delay the setup request’s data/status stages by returning USB_GADGET_DELAYED_STATUS.}(hj?hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjDžubeh}(h]h ] kernelindentah"]h$]h&]uh1jZ hjHhhhNhNubeh}(h]composite-device-frameworkah ]h"]composite device frameworkah$]h&]uh1hhjhhhhhMNubh)}(hhh](h)}(hComposite Device Functionsh]hComposite Device Functions}(hj`hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj[hhhhhMdubh)}(hAt this writing, a few of the current gadget drivers have been converted to this framework. Near-term plans include converting all of them, except for ``gadgetfs``.h](hAt this writing, a few of the current gadget drivers have been converted to this framework. Near-term plans include converting all of them, except for }(hAt this writing, a few of the current gadget drivers have been converted to this framework. Near-term plans include converting all of them, except for hjlhhhNhNubj)}(h ``gadgetfs``h]hgadgetfs}(hhhjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjlubh.}(hjhjlhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMfhj[hhubeh}(h]composite-device-functionsah ]h"]composite device functionsah$]h&]uh1hhjhhhhhMdubeh}(h]kernel-mode-gadget-apiah ]h"]kernel mode gadget apiah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hPeripheral Controller Driversh]hPeripheral Controller Drivers}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMkubh)}(hX)The first hardware supporting this API was the NetChip 2280 controller, which supports USB 2.0 high speed and is based on PCI. This is the ``net2280`` driver module. The driver supports Linux kernel versions 2.4 and 2.6; contact NetChip Technologies for development boards and product information.h](hThe first hardware supporting this API was the NetChip 2280 controller, which supports USB 2.0 high speed and is based on PCI. This is the }(hThe first hardware supporting this API was the NetChip 2280 controller, which supports USB 2.0 high speed and is based on PCI. This is the hjhhhNhNubj)}(h ``net2280``h]hnet2280}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh driver module. The driver supports Linux kernel versions 2.4 and 2.6; contact NetChip Technologies for development boards and product information.}(h driver module. The driver supports Linux kernel versions 2.4 and 2.6; contact NetChip Technologies for development boards and product information.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMmhjhhubh)}(hXOther hardware working in the ``gadget`` framework includes: Intel's PXA 25x and IXP42x series processors (``pxa2xx_udc``), Toshiba TC86c001 "Goku-S" (``goku_udc``), Renesas SH7705/7727 (``sh_udc``), MediaQ 11xx (``mq11xx_udc``), Hynix HMS30C7202 (``h7202_udc``), National 9303/4 (``n9604_udc``), Texas Instruments OMAP (``omap_udc``), Sharp LH7A40x (``lh7a40x_udc``), and more. Most of those are full speed controllers.h](hOther hardware working in the }(hOther hardware working in the hjІhhhNhNubj)}(h ``gadget``h]hgadget}(hhhjنhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubhE framework includes: Intel’s PXA 25x and IXP42x series processors (}(hC framework includes: Intel's PXA 25x and IXP42x series processors (hjІhhhNhNubj)}(h``pxa2xx_udc``h]h pxa2xx_udc}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh"), Toshiba TC86c001 “Goku-S” (}(h), Toshiba TC86c001 "Goku-S" (hjІhhhNhNubj)}(h ``goku_udc``h]hgoku_udc}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh), Renesas SH7705/7727 (}(h), Renesas SH7705/7727 (hjІhhhNhNubj)}(h ``sh_udc``h]hsh_udc}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh), MediaQ 11xx (}(h), MediaQ 11xx (hjІhhhNhNubj)}(h``mq11xx_udc``h]h mq11xx_udc}(hhhj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh), Hynix HMS30C7202 (}(h), Hynix HMS30C7202 (hjІhhhNhNubj)}(h ``h7202_udc``h]h h7202_udc}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh), National 9303/4 (}(h), National 9303/4 (hjІhhhNhNubj)}(h ``n9604_udc``h]h n9604_udc}(hhhjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh), Texas Instruments OMAP (}(h), Texas Instruments OMAP (hjІhhhNhNubj)}(h ``omap_udc``h]homap_udc}(hhhj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh), Sharp LH7A40x (}(h), Sharp LH7A40x (hjІhhhNhNubj)}(h``lh7a40x_udc``h]h lh7a40x_udc}(hhhjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjІubh6), and more. Most of those are full speed controllers.}(h6), and more. Most of those are full speed controllers.hjІhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMshjhhubh)}(hAt this writing, there are people at work on drivers in this framework for several other USB device controllers, with plans to make many of them be widely available.h]hAt this writing, there are people at work on drivers in this framework for several other USB device controllers, with plans to make many of them be widely available.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhjhhubh)}(hXA partial USB simulator, the ``dummy_hcd`` driver, is available. It can act like a net2280, a pxa25x, or an sa11x0 in terms of available endpoints and device speeds; and it simulates control, bulk, and to some extent interrupt transfers. That lets you develop some parts of a gadget driver on a normal PC, without any special hardware, and perhaps with the assistance of tools such as GDB running with User Mode Linux. At least one person has expressed interest in adapting that approach, hooking it up to a simulator for a microcontroller. Such simulators can help debug subsystems where the runtime hardware is unfriendly to software development, or is not yet available.h](hA partial USB simulator, the }(hA partial USB simulator, the hjhhhNhNubj)}(h ``dummy_hcd``h]h dummy_hcd}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhXw driver, is available. It can act like a net2280, a pxa25x, or an sa11x0 in terms of available endpoints and device speeds; and it simulates control, bulk, and to some extent interrupt transfers. That lets you develop some parts of a gadget driver on a normal PC, without any special hardware, and perhaps with the assistance of tools such as GDB running with User Mode Linux. At least one person has expressed interest in adapting that approach, hooking it up to a simulator for a microcontroller. Such simulators can help debug subsystems where the runtime hardware is unfriendly to software development, or is not yet available.}(hXw driver, is available. It can act like a net2280, a pxa25x, or an sa11x0 in terms of available endpoints and device speeds; and it simulates control, bulk, and to some extent interrupt transfers. That lets you develop some parts of a gadget driver on a normal PC, without any special hardware, and perhaps with the assistance of tools such as GDB running with User Mode Linux. At least one person has expressed interest in adapting that approach, hooking it up to a simulator for a microcontroller. Such simulators can help debug subsystems where the runtime hardware is unfriendly to software development, or is not yet available.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM~hjhhubh)}(hvSupport for other controllers is expected to be developed and contributed over time, as this driver framework evolves.h]hvSupport for other controllers is expected to be developed and contributed over time, as this driver framework evolves.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]peripheral-controller-driversah ]h"]peripheral controller driversah$]h&]uh1hhhhhhhhMkubh)}(hhh](h)}(hGadget Driversh]hGadget Drivers}(hjՇhjӇhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjЇhhhhhMubh)}(hIn addition to *Gadget Zero* (used primarily for testing and development with drivers for usb controller hardware), other gadget drivers exist.h](hIn addition to }(hIn addition to hjhhhNhNubj)}(h *Gadget Zero*h]h Gadget Zero}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhs (used primarily for testing and development with drivers for usb controller hardware), other gadget drivers exist.}(hs (used primarily for testing and development with drivers for usb controller hardware), other gadget drivers exist.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubh)}(hXThere's an ``ethernet`` gadget driver, which implements one of the most useful *Communications Device Class* (CDC) models. One of the standards for cable modem interoperability even specifies the use of this ethernet model as one of two mandatory options. Gadgets using this code look to a USB host as if they're an Ethernet adapter. It provides access to a network where the gadget's CPU is one host, which could easily be bridging, routing, or firewalling access to other networks. Since some hardware can't fully implement the CDC Ethernet requirements, this driver also implements a "good parts only" subset of CDC Ethernet. (That subset doesn't advertise itself as CDC Ethernet, to avoid creating problems.)h](h There’s an }(h There's an hjhhhNhNubj)}(h ``ethernet``h]hethernet}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh8 gadget driver, which implements one of the most useful }(h8 gadget driver, which implements one of the most useful hjhhhNhNubj)}(h*Communications Device Class*h]hCommunications Device Class}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhXh (CDC) models. One of the standards for cable modem interoperability even specifies the use of this ethernet model as one of two mandatory options. Gadgets using this code look to a USB host as if they’re an Ethernet adapter. It provides access to a network where the gadget’s CPU is one host, which could easily be bridging, routing, or firewalling access to other networks. Since some hardware can’t fully implement the CDC Ethernet requirements, this driver also implements a “good parts only” subset of CDC Ethernet. (That subset doesn’t advertise itself as CDC Ethernet, to avoid creating problems.)}(hX\ (CDC) models. One of the standards for cable modem interoperability even specifies the use of this ethernet model as one of two mandatory options. Gadgets using this code look to a USB host as if they're an Ethernet adapter. It provides access to a network where the gadget's CPU is one host, which could easily be bridging, routing, or firewalling access to other networks. Since some hardware can't fully implement the CDC Ethernet requirements, this driver also implements a "good parts only" subset of CDC Ethernet. (That subset doesn't advertise itself as CDC Ethernet, to avoid creating problems.)hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubh)}(hXSupport for Microsoft's ``RNDIS`` protocol has been contributed by Pengutronix and Auerswald GmbH. This is like CDC Ethernet, but it runs on more slightly USB hardware (but less than the CDC subset). However, its main claim to fame is being able to connect directly to recent versions of Windows, using drivers that Microsoft bundles and supports, making it much simpler to network with Windows.h](hSupport for Microsoft’s }(hSupport for Microsoft's hj8hhhNhNubj)}(h ``RNDIS``h]hRNDIS}(hhhjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubhXj protocol has been contributed by Pengutronix and Auerswald GmbH. This is like CDC Ethernet, but it runs on more slightly USB hardware (but less than the CDC subset). However, its main claim to fame is being able to connect directly to recent versions of Windows, using drivers that Microsoft bundles and supports, making it much simpler to network with Windows.}(hXj protocol has been contributed by Pengutronix and Auerswald GmbH. This is like CDC Ethernet, but it runs on more slightly USB hardware (but less than the CDC subset). However, its main claim to fame is being able to connect directly to recent versions of Windows, using drivers that Microsoft bundles and supports, making it much simpler to network with Windows.hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubh)}(hX=There is also support for user mode gadget drivers, using ``gadgetfs``. This provides a *User Mode API* that presents each endpoint as a single file descriptor. I/O is done using normal ``read()`` and ``read()`` calls. Familiar tools like GDB and pthreads can be used to develop and debug user mode drivers, so that once a robust controller driver is available many applications for it won't require new kernel mode software. Linux 2.6 *Async I/O (AIO)* support is available, so that user mode software can stream data with only slightly more overhead than a kernel driver.h](h:There is also support for user mode gadget drivers, using }(h:There is also support for user mode gadget drivers, using hjZhhhNhNubj)}(h ``gadgetfs``h]hgadgetfs}(hhhjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh. This provides a }(h. This provides a hjZhhhNhNubj)}(h*User Mode API*h]h User Mode API}(hhhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubhS that presents each endpoint as a single file descriptor. I/O is done using normal }(hS that presents each endpoint as a single file descriptor. I/O is done using normal hjZhhhNhNubj)}(h ``read()``h]hread()}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh and }(h and hjZhhhNhNubj)}(h ``read()``h]hread()}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh calls. Familiar tools like GDB and pthreads can be used to develop and debug user mode drivers, so that once a robust controller driver is available many applications for it won’t require new kernel mode software. Linux 2.6 }(h calls. Familiar tools like GDB and pthreads can be used to develop and debug user mode drivers, so that once a robust controller driver is available many applications for it won't require new kernel mode software. Linux 2.6 hjZhhhNhNubj)}(h*Async I/O (AIO)*h]hAsync I/O (AIO)}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubhx support is available, so that user mode software can stream data with only slightly more overhead than a kernel driver.}(hx support is available, so that user mode software can stream data with only slightly more overhead than a kernel driver.hjZhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubh)}(hXThere's a USB Mass Storage class driver, which provides a different solution for interoperability with systems such as MS-Windows and MacOS. That *Mass Storage* driver uses a file or block device as backing store for a drive, like the ``loop`` driver. The USB host uses the BBB, CB, or CBI versions of the mass storage class specification, using transparent SCSI commands to access the data from the backing store.h](hThere’s a USB Mass Storage class driver, which provides a different solution for interoperability with systems such as MS-Windows and MacOS. That }(hThere's a USB Mass Storage class driver, which provides a different solution for interoperability with systems such as MS-Windows and MacOS. That hjȈhhhNhNubj)}(h*Mass Storage*h]h Mass Storage}(hhhjшhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjȈubhK driver uses a file or block device as backing store for a drive, like the }(hK driver uses a file or block device as backing store for a drive, like the hjȈhhhNhNubj)}(h``loop``h]hloop}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjȈubh driver. The USB host uses the BBB, CB, or CBI versions of the mass storage class specification, using transparent SCSI commands to access the data from the backing store.}(h driver. The USB host uses the BBB, CB, or CBI versions of the mass storage class specification, using transparent SCSI commands to access the data from the backing store.hjȈhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubh)}(hX~There's a "serial line" driver, useful for TTY style operation over USB. The latest version of that driver supports CDC ACM style operation, like a USB modem, and so on most hardware it can interoperate easily with MS-Windows. One interesting use of that driver is in boot firmware (like a BIOS), which can sometimes use that model with very small systems without real serial lines.h]hXThere’s a “serial line” driver, useful for TTY style operation over USB. The latest version of that driver supports CDC ACM style operation, like a USB modem, and so on most hardware it can interoperate easily with MS-Windows. One interesting use of that driver is in boot firmware (like a BIOS), which can sometimes use that model with very small systems without real serial lines.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubh)}(hzSupport for other kinds of gadget is expected to be developed and contributed over time, as this driver framework evolves.h]hzSupport for other kinds of gadget is expected to be developed and contributed over time, as this driver framework evolves.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjЇhhubeh}(h]gadget-driversah ]h"]gadget driversah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hUSB On-The-GO (OTG)h]hUSB On-The-GO (OTG)}(hj&hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hhhhhMubh)}(hUSB OTG support on Linux 2.6 was initially developed by Texas Instruments for `OMAP `__ 16xx and 17xx series processors. Other OTG systems should work in similar ways, but the hardware level details could be very different.h](hNUSB OTG support on Linux 2.6 was initially developed by Texas Instruments for }(hNUSB OTG support on Linux 2.6 was initially developed by Texas Instruments for hj2hhhNhNubh reference)}(h`OMAP `__h]hOMAP}(hOMAPhj=hhhNhNubah}(h]h ]h"]h$]h&]namejErefurihttp://www.omap.comuh1j;hj2ubh 16xx and 17xx series processors. Other OTG systems should work in similar ways, but the hardware level details could be very different.}(h 16xx and 17xx series processors. Other OTG systems should work in similar ways, but the hardware level details could be very different.hj2hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj!hhubh)}(hX*Systems need specialized hardware support to implement OTG, notably including a special *Mini-AB* jack and associated transceiver to support *Dual-Role* operation: they can act either as a host, using the standard Linux-USB host side driver stack, or as a peripheral, using this ``gadget`` framework. To do that, the system software relies on small additions to those programming interfaces, and on a new internal component (here called an "OTG Controller") affecting which driver stack connects to the OTG port. In each role, the system can re-use the existing pool of hardware-neutral drivers, layered on top of the controller driver interfaces (:c:type:`usb_bus` or :c:type:`usb_gadget`). Such drivers need at most minor changes, and most of the calls added to support OTG can also benefit non-OTG products.h](hXSystems need specialized hardware support to implement OTG, notably including a special }(hXSystems need specialized hardware support to implement OTG, notably including a special hjZhhhNhNubj)}(h *Mini-AB*h]hMini-AB}(hhhjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh, jack and associated transceiver to support }(h, jack and associated transceiver to support hjZhhhNhNubj)}(h *Dual-Role*h]h Dual-Role}(hhhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh operation: they can act either as a host, using the standard Linux-USB host side driver stack, or as a peripheral, using this }(h operation: they can act either as a host, using the standard Linux-USB host side driver stack, or as a peripheral, using this hjZhhhNhNubj)}(h ``gadget``h]hgadget}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubhXk framework. To do that, the system software relies on small additions to those programming interfaces, and on a new internal component (here called an “OTG Controller”) affecting which driver stack connects to the OTG port. In each role, the system can re-use the existing pool of hardware-neutral drivers, layered on top of the controller driver interfaces (}(hXg framework. To do that, the system software relies on small additions to those programming interfaces, and on a new internal component (here called an "OTG Controller") affecting which driver stack connects to the OTG port. In each role, the system can re-use the existing pool of hardware-neutral drivers, layered on top of the controller driver interfaces (hjZhhhNhNubh)}(h:c:type:`usb_bus`h]j)}(hjh]husb_bus}(hhhjhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjHjHjusb_busuh1hhhhMhjZubh or }(h or hjZhhhNhNubh)}(h:c:type:`usb_gadget`h]j)}(hj‰h]h usb_gadget}(hhhjĉhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjHjHj usb_gadgetuh1hhhhMhjZubhy). Such drivers need at most minor changes, and most of the calls added to support OTG can also benefit non-OTG products.}(hy). Such drivers need at most minor changes, and most of the calls added to support OTG can also benefit non-OTG products.hjZhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj!hhubjG)}(hhh](jL)}(hGadget drivers test the ``is_otg`` flag, and use it to determine whether or not to include an OTG descriptor in each of their configurations. h]h)}(hGadget drivers test the ``is_otg`` flag, and use it to determine whether or not to include an OTG descriptor in each of their configurations.h](hGadget drivers test the }(hGadget drivers test the hjhhhNhNubj)}(h ``is_otg``h]his_otg}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhk flag, and use it to determine whether or not to include an OTG descriptor in each of their configurations.}(hk flag, and use it to determine whether or not to include an OTG descriptor in each of their configurations.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hXGadget drivers may need changes to support the two new OTG protocols, exposed in new gadget attributes such as ``b_hnp_enable`` flag. HNP support should be reported through a user interface (two LEDs could suffice), and is triggered in some cases when the host suspends the peripheral. SRP support can be user-initiated just like remote wakeup, probably by pressing the same button. h]h)}(hX~Gadget drivers may need changes to support the two new OTG protocols, exposed in new gadget attributes such as ``b_hnp_enable`` flag. HNP support should be reported through a user interface (two LEDs could suffice), and is triggered in some cases when the host suspends the peripheral. SRP support can be user-initiated just like remote wakeup, probably by pressing the same button.h](hoGadget drivers may need changes to support the two new OTG protocols, exposed in new gadget attributes such as }(hoGadget drivers may need changes to support the two new OTG protocols, exposed in new gadget attributes such as hjhhhNhNubj)}(h``b_hnp_enable``h]h b_hnp_enable}(hhhj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag. HNP support should be reported through a user interface (two LEDs could suffice), and is triggered in some cases when the host suspends the peripheral. SRP support can be user-initiated just like remote wakeup, probably by pressing the same button.}(h flag. HNP support should be reported through a user interface (two LEDs could suffice), and is triggered in some cases when the host suspends the peripheral. SRP support can be user-initiated just like remote wakeup, probably by pressing the same button.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hOn the host side, USB device drivers need to be taught to trigger HNP at appropriate moments, using ``usb_suspend_device()``. That also conserves battery power, which is useful even for non-OTG configurations. h]h)}(hOn the host side, USB device drivers need to be taught to trigger HNP at appropriate moments, using ``usb_suspend_device()``. That also conserves battery power, which is useful even for non-OTG configurations.h](hdOn the host side, USB device drivers need to be taught to trigger HNP at appropriate moments, using }(hdOn the host side, USB device drivers need to be taught to trigger HNP at appropriate moments, using hjIhhhNhNubj)}(h``usb_suspend_device()``h]husb_suspend_device()}(hhhjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjIubhU. That also conserves battery power, which is useful even for non-OTG configurations.}(hU. That also conserves battery power, which is useful even for non-OTG configurations.hjIhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjEubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubjL)}(hXXAlso on the host side, a driver must support the OTG "Targeted Peripheral List". That's just a whitelist, used to reject peripherals not supported with a given Linux OTG host. *This whitelist is product-specific; each product must modify* ``otg_whitelist.h`` *to match its interoperability specification.* Non-OTG Linux hosts, like PCs and workstations, normally have some solution for adding drivers, so that peripherals that aren't recognized can eventually be supported. That approach is unreasonable for consumer products that may never have their firmware upgraded, and where it's usually unrealistic to expect traditional PC/workstation/server kinds of support model to work. For example, it's often impractical to change device firmware once the product has been distributed, so driver bugs can't normally be fixed if they're found after shipment. h](h)}(hX1Also on the host side, a driver must support the OTG "Targeted Peripheral List". That's just a whitelist, used to reject peripherals not supported with a given Linux OTG host. *This whitelist is product-specific; each product must modify* ``otg_whitelist.h`` *to match its interoperability specification.*h](hAlso on the host side, a driver must support the OTG “Targeted Peripheral List”. That’s just a whitelist, used to reject peripherals not supported with a given Linux OTG host. }(hAlso on the host side, a driver must support the OTG "Targeted Peripheral List". That's just a whitelist, used to reject peripherals not supported with a given Linux OTG host. hjuhhhNhNubj)}(h>*This whitelist is product-specific; each product must modify*h]h