sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget)/translations/zh_CN/driver-api/usb/gadgetmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/zh_TW/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/it_IT/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ja_JP/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ko_KR/driver-api/usb/gadgetmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(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}(hhhhhNhNubah}(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}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(hDavid Brownellh]h paragraph)}(hhh]hDavid Brownell}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hDateh]hDate}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh)}(h20 August 2004 h]h)}(h20 August 2004h]h20 August 2004}(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*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:}(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.}(hjQhhhNhNubah}(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.}(hjihhhNhNubah}(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.}(hjhhhNhNubah}(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.}(hjhhhNhNubah}(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).}(hjhhhNhNubah}(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.}(hjhhhNhNubah}(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 }(hjhhhNhNubhliteral)}(h``host``h]hhost}(hjhhhNhNubah}(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”).}(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 }(hjhhhNhNubhemphasis)}(h *Chapter 9*h]h Chapter 9}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX  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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK2hj'hhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hStructure of Gadget Driversh]hStructure of Gadget Drivers}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1hhhhhK?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 }(hjBhhhNhNubj)}(h ``gadget``h]hgadget}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubhe API is used by the middle layer to interact with the lowest level (which directly handles hardware).}(hjBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKAhj1hhubh)}(h/In Linux, from the bottom up, these layers are:h]h/In Linux, from the bottom up, these layers are:}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhj1hhubhdefinition_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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj}ubah}(h]h ]h"]h$]h&]uh1j{hhhKVhjwubh 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 }(hjhhhNhNubj)}(h````h]h}(hjhhhNhNubah}(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.}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjubeh}(h]h ]h"]h$]h&]uh1jhjwubeh}(h]h ]h"]h$]h&]uh1juhhhKVhjrubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{hhhKthjubj)}(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 }(hjhhhNhNubj)}(h*autoconfiguring*h]hautoconfiguring}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubha 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}(hjhhhNhNubah}(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}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhj,ubah}(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}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjDubah}(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.}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhj\ubah}(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}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjtubah}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhhhKthjrhhubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{hhhKhjubj)}(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:}(hjhhhNhNubah}(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 }(hjhhhNhNubj)}(h``/dev``h]h/dev}(hjhhhNhNubah}(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)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(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)}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj1ubah}(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)}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjIubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(hfile system (for PTP gadgets) h]h)}(hfile system (for PTP gadgets)h]hfile system (for PTP gadgets)}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjaubah}(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)}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubah}(h]h ]h"]h$]h&]uh1jKhjubjL)}(h ... and more h]h)}(h ... and moreh]h ... and more}(hjhhhNhNubah}(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&]uh1juhhhKhjrhhubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{hhhKhjubj)}(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 }(hjhhhNhNubj)}(h ``open()``h]hopen()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h ``close()``h]hclose()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h ``read()``h]hread()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h ``write()``h]hwrite()}(hjhhhNhNubah}(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).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhhhKhjrhhubeh}(h]h ]h"]h$]h&]uh1jphj1hhhhhNubh)}(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 }(hjAhhhNhNubj)}(h ``usbcore``h]husbcore}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh, one or more }(hjAhhhNhNubj)}(h*Host Controller Drivers*h]hHost Controller Drivers}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh (HCDs), }(hjAhhhNhNubj)}(h*USB Device Drivers*h]hUSB Device Drivers}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubhX to support the OTG “Targeted Peripheral List”, and so forth. There will also be an }(hjAhhhNhNubj)}(h*OTG Controller Driver*h]hOTG Controller Driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubhX\, 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.}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj1hhubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj1hhubeh}(h]structure-of-gadget-driversah ]h"]structure of gadget driversah$]h&]uh1hhhhhhhhK?ubh)}(hhh](h)}(hKernel Mode Gadget APIh]hKernel Mode Gadget API}(hjhhhNhNubah}(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 }(hjhhhNhNubh)}(h:c:type:`usb_gadget_driver`h]j)}(hjh]husb_gadget_driver}(hjhhhNhNubah}(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.}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(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 }(hjhhhNhNubj)}(h*driver model*h]h driver model}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX 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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(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.}(hj;hhhNhNubah}(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.}(hjIhhhNhNubah}(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.}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hDriver Life Cycleh]hDriver Life Cycle}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehhhhhKubh)}(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:}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjehhubhenumerated_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 (}(hjhhhNhNubj)}(h ``attached``h]hattached}(hjhhhNhNubah}(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.}(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 }(hjhhhNhNubh)}(h:c:type:`usb_gadget`h]j)}(hjh]h usb_gadget}(hjhhhNhNubah}(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.}(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 }(hjhhhNhNubj)}(h ``power``h]hpower}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h``set_address``h]h set_address}(hj 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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(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 }(hj.hhhNhNubj)}(h ``setup()``h]hsetup()}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubhX0 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.}(hj.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(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 }(hjXhhhNhNubj)}(h``set_configuration``h]hset_configuration}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubh 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 }(hjXhhhNhNubj)}(h``usb_gadget_vbus_draw``h]husb_gadget_vbus_draw}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubh 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.}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjTubah}(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).}(hjhhhNhNubah}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jKhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjehhhhhKubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjehhubh)}(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 }(hjhhhNhNubj)}(h``SET_CONFIGURATION``h]hSET_CONFIGURATION}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhi 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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh slightly.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM(hjehhubeh}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM0ubh)}(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 }(hj$hhhNhNubh)}(h%:ref:`linux/usb/ch9.h `h]hinline)}(hj.h]hlinux/usb/ch9.h}(hj2hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1j0hj,ubah}(h]h ]h"]h$]h&]refdocj refdomainj<reftyperef refexplicitrefwarnj usb_chapter9uh1hhhhM2hj$ubh header file, which is standard in Linux 2.6+ kernels. These are the same types and constants used by host side drivers (and usbcore).}(hj$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM2hjhhubeh}(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}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhj`hhhhhM8ubh)}(hThese are declared in ````, and are used by gadget drivers to interact with USB peripheral controller drivers.h](hThese are declared in }(hjqhhhNhNubj)}(h````h]h}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubhT, and are used by gadget drivers to interact with USB peripheral controller drivers.}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM:hj`hhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleusb_request (C struct) c.usb_requesthNtauh1jhj`hhhNhNubhdesc)}(hhh](hdesc_signature)}(h usb_requesth]hdesc_signature_line)}(hstruct usb_requesth](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhKubh desc_name)}(h usb_requesth]h desc_sig_name)}(hjh]h usb_request}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&] xml:spacepreserveuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]jj add_permalinkuh1jsphinx_line_type declaratorhjhhhjhKubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhKhjhhubh desc_content)}(hhh]h)}(hdescribes one i/o requesth]hdescribes one i/o request}(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 hhubah}(h]h ]h"]h$]h&]uh1j hjhhhjhKubeh}(h]h ](jstructeh"]h$]h&]domainjobjtypej' desctypej' noindex noindexentrynocontentsentryuh1jhhhj`hNhNubh 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}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj7 ubh:}(hj7 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK&hj3 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; };}hjX sbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK(hj3 ubh)}(h **Members**h]j< )}(hji h]hMembers}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjg ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK>hj3 ubjq)}(hhh](jv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 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&]uh1juhj hK%hj ubjv)}(h``length`` Length of that data h](j|)}(h ``length``h]j)}(hj h]hlength}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK,hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj hK,hj ubjv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 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&]uh1juhj hK(hj ubjv)}(h1``sg`` a scatterlist for SG-capable controllers. h](j|)}(h``sg``h]j)}(hj5 h]hsg}(hj7 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj3 ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK)hj/ ubj)}(hhh]h)}(h)a scatterlist for SG-capable controllers.h]h)a scatterlist for SG-capable controllers.}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJ hK)hjK ubah}(h]h ]h"]h$]h&]uh1jhj/ ubeh}(h]h ]h"]h$]h&]uh1juhjJ hK)hj ubjv)}(h!``num_sgs`` number of SG entries h](j|)}(h ``num_sgs``h]j)}(hjn h]hnum_sgs}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjl ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK*hjh ubj)}(hhh]h)}(hnumber of SG entriesh]hnumber of SG entries}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK*hj ubah}(h]h ]h"]h$]h&]uh1jhjh ubeh}(h]h ]h"]h$]h&]uh1juhj hK*hj ubjv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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)L}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK+hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj hK+hj ubjv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK-hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj hK-hj ubjv)}(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)}(hj h]his_last}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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).}(hj2 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&]uh1juhj. hK/hj ubjv)}(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)}(hjS h]h no_interrupt}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK2hjM 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.}(hjl hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK0hji ubah}(h]h ]h"]h$]h&]uh1jhjM ubeh}(h]h ]h"]h$]h&]uh1juhjh hK2hj ubjv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 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&]uh1juhj hK4hj ubjv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 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&]uh1juhj hK6hj ubjv)}(hF``dma_mapped`` Indicates if request has been mapped to DMA (internal) h](j|)}(h``dma_mapped``h]j)}(hj h]h dma_mapped}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK7hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj hK7hj ubjv)}(hL``sg_was_mapped`` Set if the scatterlist has been mapped before the request h](j|)}(h``sg_was_mapped``h]j)}(hj: h]h sg_was_mapped}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8 ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK8hj4 ubj)}(hhh]h)}(h9Set if the scatterlist has been mapped before the requesth]h9Set if the scatterlist has been mapped before the request}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjO hK8hjP ubah}(h]h ]h"]h$]h&]uh1jhj4 ubeh}(h]h ]h"]h$]h&]uh1juhjO hK8hj ubjv)}(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)}(hjs h]hcomplete}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjq ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKAhjm 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 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&]uh1jhjm ubeh}(h]h ]h"]h$]h&]uh1juhj hKAhj ubjv)}(h/``context`` For use by the completion callback h](j|)}(h ``context``h]j)}(hj h]hcontext}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKBhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj hKBhj ubjv)}(h'``list`` For use by the gadget driver. h](j|)}(h``list``h]j)}(hj h]hlist}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKChj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj hKChj ubjv)}(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)}(hj h]h frame_number}(hj! hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKEhj 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.}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKDhj5 ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj4 hKEhj ubjv)}(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)}(hjY h]hstatus}(hj[ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKJhjS 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.}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKFhjo ubah}(h]h ]h"]h$]h&]uh1jhjS ubeh}(h]h ]h"]h$]h&]uh1juhjn hKJhj ubjv)}(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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j{ha/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 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&]uh1juhj hKPhj ubeh}(h]h ]h"]h$]h&]uh1jphj3 ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubh)}(h**Description**h]j< )}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKThj`hhubh)}(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.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKRhj`hhubh)}(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 hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKWhj`hhubh)}(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.}(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`hhubh)}(h**NOTE**h]j< )}(hjh]hNOTE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK`hj`hhubh)}(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.}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhK`hj`hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep_caps (C struct) c.usb_ep_capshNtauh1jhj`hhhNhNubj)}(hhh](j)}(h usb_ep_capsh]j)}(hstruct usb_ep_capsh](j)}(hjh]hstruct}(hjYhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjUhhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKfubj)}(h h]h }(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjUhhhjfhKfubj)}(h usb_ep_capsh]j)}(hjSh]h usb_ep_caps}(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjuubah}(h]h ](jjeh"]h$]h&]jjuh1jhjUhhhjfhKfubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjQhhhjfhKfubah}(h]jLah ](j j eh"]h$]h&]j j )j huh1jhjfhKfhjNhhubj )}(hhh]h)}(h!endpoint capabilities descriptionh]h!endpoint capabilities description}(hjhhhNhNubah}(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&]uh1j hjNhhhjfhKfubeh}(h]h ](jstructeh"]h$]h&]j+ jj, jj- jj. j/ j0 uh1jhhhj`hNhNubj2 )}(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](j< )}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubjW )}(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; };}hjsbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubh)}(h **Members**h]j< )}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubjq)}(hhh](jv)}(hD``type_control`` Endpoint supports control type (reserved for ep0). h](j|)}(h``type_control``h]j)}(hjh]h type_control}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h2Endpoint supports control type (reserved for ep0).h]h2Endpoint supports control type (reserved for ep0).}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhKhjubjv)}(h6``type_iso`` Endpoint supports isochronous transfers. h](j|)}(h ``type_iso``h]j)}(hjAh]htype_iso}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj;ubj)}(hhh]h)}(h(Endpoint supports isochronous transfers.h]h(Endpoint supports isochronous transfers.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhKhjWubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1juhjVhKhjubjv)}(h0``type_bulk`` Endpoint supports bulk transfers. h](j|)}(h ``type_bulk``h]j)}(hjzh]h type_bulk}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjtubj)}(hhh]h)}(h!Endpoint supports bulk transfers.h]h!Endpoint supports bulk transfers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1juhjhKhjubjv)}(h4``type_int`` Endpoint supports interrupt transfers. h](j|)}(h ``type_int``h]j)}(hjh]htype_int}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhKhjubjv)}(h+``dir_in`` Endpoint supports IN direction. h](j|)}(h ``dir_in``h]j)}(hjh]hdir_in}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhKhjubjv)}(h,``dir_out`` Endpoint supports OUT direction.h](j|)}(h ``dir_out``h]j)}(hj%h]hdir_out}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h Endpoint supports OUT direction.h]h Endpoint supports OUT direction.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj;ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhj:hKhjubeh}(h]h ]h"]h$]h&]uh1jphjubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep (C struct)c.usb_ephNtauh1jhj`hhhNhNubj)}(hhh](j)}(husb_eph]j)}(h struct usb_eph](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{hhhjhKubj)}(husb_eph]j)}(hjyh]husb_ep}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhj{hhhjhKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjwhhhjhKubah}(h]jrah ](j j eh"]h$]h&]j j )j huh1jhjhKhjthhubj )}(hhh]h)}(h*device side representation of USB endpointh]h*device side representation of USB endpoint}(hjhhhNhNubah}(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&]uh1j hjthhhjhKubeh}(h]h ](jstructeh"]h$]h&]j+ jj, jj- jj. j/ j0 uh1jhhhj`hNhNubj2 )}(hX**Definition**:: struct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; const struct usb_endpoint_descriptor *desc; const struct usb_ss_ep_comp_descriptor *comp_desc; struct list_head ep_list; struct usb_ep_caps caps; bool claimed; bool enabled; unsigned mult:2; unsigned maxburst:5; u8 address; u16 maxpacket; u16 maxpacket_limit; u16 max_streams; }; **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. ``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 endpoint ``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. ``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 ``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)h](h)}(h**Definition**::h](j< )}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubjW )}(hXstruct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; const struct usb_endpoint_descriptor *desc; const struct usb_ss_ep_comp_descriptor *comp_desc; struct list_head ep_list; struct usb_ep_caps caps; bool claimed; bool enabled; unsigned mult:2; unsigned maxburst:5; u8 address; u16 maxpacket; u16 maxpacket_limit; u16 max_streams; };h]hXstruct usb_ep { void *driver_data; const char *name; const struct usb_ep_ops *ops; const struct usb_endpoint_descriptor *desc; const struct usb_ss_ep_comp_descriptor *comp_desc; struct list_head ep_list; struct usb_ep_caps caps; bool claimed; bool enabled; unsigned mult:2; unsigned maxburst:5; u8 address; u16 maxpacket; u16 maxpacket_limit; u16 max_streams; };}hjsbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubh)}(h **Members**h]j< )}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubjq)}(hhh](jv)}(h.``driver_data`` for use by the gadget driver. h](j|)}(h``driver_data``h]j)}(hj.h]h driver_data}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj(ubj)}(hhh]h)}(hfor use by the gadget driver.h]hfor use by the gadget driver.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjChKhjDubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1juhjChKhj%ubjv)}(hE``name`` identifier for the endpoint, such as "ep-a" or "ep9in-bulk" h](j|)}(h``name``h]j)}(hjgh]hname}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjaubj)}(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”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|hKhj}ubah}(h]h ]h"]h$]h&]uh1jhjaubeh}(h]h ]h"]h$]h&]uh1juhj|hKhj%ubjv)}(hG``ops`` Function pointers used to access hardware-specific operations. h](j|)}(h``ops``h]j)}(hjh]hops}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhKhj%ubjv)}(h``desc`` endpoint descriptor. This pointer is set before the endpoint is enabled and remains valid until the endpoint is disabled. h](j|)}(h``desc``h]j)}(hjh]hdesc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(hzendpoint descriptor. This pointer is set before the endpoint is enabled and remains valid until the endpoint is disabled.h]hzendpoint descriptor. This pointer is set before the endpoint is enabled and remains valid until the endpoint is disabled.}(hjhhhNhNubah}(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&]uh1juhjhKhj%ubjv)}(h~``comp_desc`` In case of SuperSpeed support, this is the endpoint companion descriptor that is used to configure the endpoint h](j|)}(h ``comp_desc``h]j)}(hjh]h comp_desc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj ubj)}(hhh]h)}(hoIn case of SuperSpeed support, this is the endpoint companion descriptor that is used to configure the endpointh]hoIn case of SuperSpeed support, this is the endpoint companion descriptor that is used to configure the endpoint}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj)ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj(hKhj%ubjv)}(h<``ep_list`` the gadget's ep_list holds all of its endpoints h](j|)}(h ``ep_list``h]j)}(hjMh]hep_list}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjGubj)}(hhh]h)}(h/the gadget's ep_list holds all of its endpointsh]h1the gadget’s ep_list holds all of its endpoints}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhKhjcubah}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1juhjbhKhj%ubjv)}(hN``caps`` The structure describing types and directions supported by endpoint. h](j|)}(h``caps``h]j)}(hjh]hcaps}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(hDThe structure describing types and directions supported by endpoint.h]hDThe structure describing types and directions supported by endpoint.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhKhj%ubjv)}(h<``claimed`` True if this endpoint is claimed by a function. h](j|)}(h ``claimed``h]j)}(hjh]hclaimed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjubj)}(hhh]h)}(h/True if this endpoint is claimed by a function.h]h/True if this endpoint is claimed by a function.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhKhj%ubjv)}(h9``enabled`` The current endpoint enabled/disabled state. h](j|)}(h ``enabled``h]j)}(hjh]henabled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhj hKhj%ubjv)}(h2``mult`` multiplier, 'mult' value for SS Isoc EPs h](j|)}(h``mult``h]j)}(hj1h]hmult}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj+ubj)}(hhh]h)}(h(multiplier, 'mult' value for SS Isoc EPsh]h,multiplier, ‘mult’ value for SS Isoc EPs}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFhKhjGubah}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1juhjFhKhj%ubjv)}(hJ``maxburst`` the maximum number of bursts supported by this EP (for usb3) h](j|)}(h ``maxburst``h]j)}(hjjh]hmaxburst}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhjdubj)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhKhj`hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_gadget (C struct) c.usb_gadgethNtauh1jhj`hhhNhNubj)}(hhh](j)}(h usb_gadgeth]j)}(hstruct usb_gadgeth](j)}(hjh]hstruct}(hjhhhNhNubah}(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 }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKubj)}(h usb_gadgeth]j)}(hjh]h usb_gadget}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhjhKubah}(h]jah ](j j eh"]h$]h&]j j )j huh1jhjhKhjhhubj )}(hhh]h)}(hrepresents a usb deviceh]hrepresents a usb device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMShjhhubah}(h]h ]h"]h$]h&]uh1j hjhhhjhKubeh}(h]h ](jstructeh"]h$]h&]j+ jj, j+j- j+j. j/ j0 uh1jhhhj`hNhNubj2 )}(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](j< )}(h**Definition**h]h Definition}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj3ubh:}(hj3hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMWhj/ubjW )}(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; };}hjPsbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMYhj/ubh)}(h **Members**h]j< )}(hjah]hMembers}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj_ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj/ubjq)}(hhh](jv)}(h@``work`` (internal use) Workqueue to be used for sysfs_notify() h](j|)}(h``work``h]j)}(hjh]hwork}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMUhjzubj)}(hhh]h)}(h6(internal use) Workqueue to be used for sysfs_notify()h]h6(internal use) Workqueue to be used for sysfs_notify()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMUhjubah}(h]h ]h"]h$]h&]uh1jhjzubeh}(h]h ]h"]h$]h&]uh1juhjhMUhjwubjv)}(h/``udc`` struct usb_udc pointer for this gadget h](j|)}(h``udc``h]j)}(hjh]hudc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMVhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMVhjwubjv)}(hG``ops`` Function pointers used to access hardware-specific operations. h](j|)}(h``ops``h]j)}(hjh]hops}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMWhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMWhjwubjv)}(hY``ep0`` Endpoint zero, used when reading or writing responses to driver setup() requests h](j|)}(h``ep0``h]j)}(hj+h]hep0}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMYhj%ubj)}(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}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMXhjAubah}(h]h ]h"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]uh1juhj@hMYhjwubjv)}(h=``ep_list`` List of other endpoints supported by the device. h](j|)}(h ``ep_list``h]j)}(hjeh]hep_list}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1jhjcubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMZhj_ubj)}(hhh]h)}(h0List of other endpoints supported by the device.h]h0List of other endpoints supported by the device.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhMZhj{ubah}(h]h ]h"]h$]h&]uh1jhj_ubeh}(h]h ]h"]h$]h&]uh1juhjzhMZhjwubjv)}(h3``speed`` Speed of current connection to USB host. h](j|)}(h ``speed``h]j)}(hjh]hspeed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM[hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhM[hjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(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&]uh1juhjhM]hjwubjv)}(hN``ssp_rate`` Current connected SuperSpeed Plus signaling rate and lane count. h](j|)}(h ``ssp_rate``h]j)}(hjh]hssp_rate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM^hj ubj)}(hhh]h)}(h@Current connected SuperSpeed Plus signaling rate and lane count.h]h@Current connected SuperSpeed Plus signaling rate and lane count.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hM^hj'ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1juhj&hM^hjwubjv)}(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)}(hjJh]h max_ssp_rate}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMahjDubj)}(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.}(hjchhhNhNubah}(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&]uh1jhjDubeh}(h]h ]h"]h$]h&]uh1juhj_hMahjwubjv)}(hF``state`` the state we are now (attached, suspended, configured, etc) h](j|)}(h ``state``h]j)}(hjh]hstate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMbhj~ubj)}(hhh]h)}(h;the state we are now (attached, suspended, configured, etc)h]h;the state we are now (attached, suspended, configured, etc)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMbhjubah}(h]h ]h"]h$]h&]uh1jhj~ubeh}(h]h ]h"]h$]h&]uh1juhjhMbhjwubjv)}(hd``name`` Identifies the controller hardware type. Used in diagnostics and sometimes configuration. h](j|)}(h``name``h]j)}(hjh]hname}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(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&]uh1juhjhMdhjwubjv)}(h5``dev`` Driver model state for this abstract device. h](j|)}(h``dev``h]j)}(hjh]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMehj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhj hMehjwubjv)}(hI``isoch_delay`` value from Set Isoch Delay request. Only valid on SS/SSP h](j|)}(h``isoch_delay``h]j)}(hj0h]h isoch_delay}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMfhj*ubj)}(hhh]h)}(h8value from Set Isoch Delay request. Only valid on SS/SSPh]h8value from Set Isoch Delay request. Only valid on SS/SSP}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjEhMfhjFubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1juhjEhMfhjwubjv)}(h&``out_epnum`` last used out ep number h](j|)}(h ``out_epnum``h]j)}(hjih]h out_epnum}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjgubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMghjcubj)}(hhh]h)}(hlast used out ep numberh]hlast used out ep number}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~hMghjubah}(h]h ]h"]h$]h&]uh1jhjcubeh}(h]h ]h"]h$]h&]uh1juhj~hMghjwubjv)}(h$``in_epnum`` last used in ep number h](j|)}(h ``in_epnum``h]j)}(hjh]hin_epnum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMhhjwubjv)}(h``mA`` last set mA value h](j|)}(h``mA``h]j)}(hjh]hmA}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMihjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMihjwubjv)}(h.``otg_caps`` OTG capabilities of this gadget. h](j|)}(h ``otg_caps``h]j)}(hjh]hotg_caps}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMjhjubj)}(hhh]h)}(h OTG capabilities of this gadget.h]h OTG capabilities of this gadget.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)hMjhj*ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhj)hMjhjwubjv)}(h6``sg_supported`` true if we can handle scatter-gather h](j|)}(h``sg_supported``h]j)}(hjMh]h sg_supported}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMkhjGubj)}(hhh]h)}(h$true if we can handle scatter-gatherh]h$true if we can handle scatter-gather}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhMkhjcubah}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1juhjbhMkhjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(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&]uh1juhjhMmhjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(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&]uh1juhjhMphjwubjv)}(hZ``b_hnp_enable`` OTG device feature flag, indicating that the A-Host enabled HNP support. h](j|)}(h``b_hnp_enable``h]j)}(hjh]h b_hnp_enable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMvhjubj)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMuhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMvhjwubjv)}(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)}(hj4h]h a_hnp_support}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2ubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMqhjJubah}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]uh1juhjIhMrhjwubjv)}(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)}(hjnh]ha_alt_hnp_support}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jhjlubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMthjhubj)}(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.}(hjhhhNhNubah}(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&]uh1jhjhubeh}(h]h ]h"]h$]h&]uh1juhjhMthjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(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&]uh1juhjhMxhjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMzhjubj)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMyhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMzhjwubjv)}(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)}(hjh]hquirk_ep_out_aligned_size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM|hjubj)}(hhh]h)}(h:epout requires buffer size to be aligned to MaxPacketSize.h]h:epout requires buffer size to be aligned to MaxPacketSize.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM{hj2ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhj1hM|hjwubjv)}(hG``quirk_altset_not_supp`` UDC controller doesn't support alt settings. h](j|)}(h``quirk_altset_not_supp``h]j)}(hjVh]hquirk_altset_not_supp}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM}hjPubj)}(hhh]h)}(h,UDC controller doesn't support alt settings.h]h.UDC controller doesn’t support alt settings.}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhjkhM}hjlubah}(h]h ]h"]h$]h&]uh1jhjPubeh}(h]h ]h"]h$]h&]uh1juhjkhM}hjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM~hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhM~hjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMhjwubjv)}(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)}(hjh]hquirk_avoids_skb_reserve}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(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.}(hjhhhNhNubah}(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&]uh1juhjhMhjwubjv)}(h2``is_selfpowered`` if the gadget is self-powered. h](j|)}(h``is_selfpowered``h]j)}(hj;h]his_selfpowered}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj5ubj)}(hhh]h)}(hif the gadget is self-powered.h]hif the gadget is self-powered.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjPhMhjQubah}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1juhjPhMhjwubjv)}(h]``deactivated`` True if gadget is deactivated - in deactivated state it cannot be connected. h](j|)}(h``deactivated``h]j)}(hjth]h deactivated}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjrubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjnubj)}(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.}(hjhhhNhNubah}(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&]uh1jhjnubeh}(h]h ]h"]h$]h&]uh1juhjhMhjwubjv)}(h+``connected`` True if gadget is connected. h](j|)}(h ``connected``h]j)}(hjh]h connected}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMhjwubjv)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(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&]uh1juhjhMhjwubjv)}(hG``wakeup_capable`` True if gadget is capable of sending remote wakeup. h](j|)}(h``wakeup_capable``h]j)}(hj!h]hwakeup_capable}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(h3True if gadget is capable of sending remote wakeup.h]h3True if gadget is capable of sending remote wakeup.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6hMhj7ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhj6hMhjwubjv)}(hH``wakeup_armed`` True if gadget is armed by the host for remote wakeup. h](j|)}(h``wakeup_armed``h]j)}(hjZh]h wakeup_armed}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjTubj)}(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.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohMhjpubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1juhjohMhjwubjv)}(h4``irq`` the interrupt number for device controller. h](j|)}(h``irq``h]j)}(hjh]hirq}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMhjwubjv)}(hL``id_number`` a unique ID number for ensuring that gadget names are distincth](j|)}(h ``id_number``h]j)}(hjh]h id_number}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/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}(hjhhhNhNubah}(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&]uh1juhjhMhjwubeh}(h]h ]h"]h$]h&]uh1jphj/ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubh)}(h**Description**h]j< )}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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).}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep_align (C function)c.usb_ep_alignhNtauh1jhj`hhhNhNubj)}(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}(hjnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjkubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetjpmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}j usb_ep_alignsbc.usb_ep_alignasbuh1hhjghhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjghhhjhMubj)}(h usb_ep_alignh]j)}(hjh]h usb_ep_align}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjghhhjhMubhdesc_parameterlist)}(h(struct usb_ep *ep, size_t len)h](hdesc_parameter)}(hstruct usb_ep *eph](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(husb_eph]husb_ep}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]jc.usb_ep_alignasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjubj)}(heph]hep}(hj$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h size_t lenh](h)}(hhh]j)}(hsize_th]hsize_t}(hj@hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjBmodnameN classnameNjj)}j]jc.usb_ep_alignasbuh1hhj9ubj)}(h h]h }(hj^hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9ubj)}(hlenh]hlen}(hjlhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhjghhhjhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjchhhjhMubah}(h]j^ah ](j j eh"]h$]h&]j j )j huh1jhjhMhj`hhubj )}(hhh]h)}(h.returns **len** aligned to ep's maxpacketsize.h](hreturns }(hjhhhNhNubj< )}(h**len**h]hlen}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubh! 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&]uh1j hj`hhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jj- jj. j/ j0 uh1jhhhj`hNhNubj2 )}(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]j< )}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubjq)}(hhh](jv)}(hP``struct usb_ep *ep`` the endpoint whose maxpacketsize is used to align **len** h](j|)}(h``struct usb_ep *ep``h]j)}(hjh]hstruct usb_ep *ep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjubj)}(hhh]h)}(h9the endpoint whose maxpacketsize is used to align **len**h](h2the endpoint whose maxpacketsize is used to align }(hj hhhNhNubj< )}(h**len**h]hlen}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj ubeh}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMhjubjv)}(hG``size_t len`` buffer size's length to align to **ep**'s maxpacketsize h](j|)}(h``size_t len``h]j)}(hj0 h]h size_t len}(hj2 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj. ubah}(h]h ]h"]h$]h&]uh1j{ha/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 }(hjI hhhNhNubj< )}(h**ep**h]hep}(hjQ hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjI ubh’s maxpacketsize}(hjI hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjE hMhjF ubah}(h]h ]h"]h$]h&]uh1jhj* ubeh}(h]h ]h"]h$]h&]uh1juhjE hMhjubeh}(h]h ]h"]h$]h&]uh1jphjubh)}(h**Description**h]j< )}(hj} h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j; 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 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&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_ep_align_maybe (C function)c.usb_ep_align_maybehNtauh1jhj`hhhNhNubj)}(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}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj 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 }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMubj)}(husb_ep_align_maybeh]j)}(hj h]husb_ep_align_maybe}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hMubj)}(h5(struct usb_gadget *g, struct usb_ep *ep, size_t len)h](j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(h h]h }(hj!!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj2!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj/!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj4!modnameN classnameNjj)}j]j c.usb_ep_align_maybeasbuh1hhj!ubj)}(h h]h }(hjP!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(hjh]h*}(hj^!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj!ubj)}(hgh]hg}(hjk!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj !ubj)}(hstruct usb_ep *eph](j)}(hjh]hstruct}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(h h]h }(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubh)}(hhh]j)}(husb_eph]husb_ep}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj!modnameN classnameNjj)}j]j c.usb_ep_align_maybeasbuh1hhj!ubj)}(h h]h }(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(hjh]h*}(hj!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj!ubj)}(heph]hep}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj !ubj)}(h size_t lenh](h)}(hhh]j)}(hsize_th]hsize_t}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj!modnameN classnameNjj)}j]j c.usb_ep_align_maybeasbuh1hhj!ubj)}(h h]h }(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubj)}(hlenh]hlen}(hj#"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj !ubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hMubah}(h]j ah ](j j eh"]h$]h&]j j )j huh1jhj hMhj hhubj )}(hhh]h)}(hrreturns **len** aligned to ep's maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise returns len.h](hreturns }(hjM"hhhNhNubj< )}(h**len**h]hlen}(hjU"hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjM"ubhe aligned to ep’s maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise returns len.}(hjM"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjJ"hhubah}(h]h ]h"]h$]h&]uh1j hj hhhj hMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jw"j- jw"j. j/ j0 uh1jhhhj`hNhNubj2 )}(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]j< )}(hj"h]h Parameters}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj"ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj{"ubjq)}(hhh](jv)}(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}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1j{ha/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"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hMhj"ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1juhj"hMhj"ubjv)}(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}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1j{ha/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 }(hj"hhhNhNubj< )}(h**len**h]hlen}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj"ubeh}(h]h ]h"]h$]h&]uh1hhj"hMhj"ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1juhj"hMhj"ubjv)}(hG``size_t len`` buffer size's length to align to **ep**'s maxpacketsize h](j|)}(h``size_t len``h]j)}(hj #h]h size_t len}(hj"#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1j{ha/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 }(hj9#hhhNhNubj< )}(h**ep**h]hep}(hjA#hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj9#ubh’s maxpacketsize}(hj9#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj5#hMhj6#ubah}(h]h ]h"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]uh1juhj5#hMhj"ubeh}(h]h ]h"]h$]h&]uh1jphj{"ubh)}(h**Description**h]j< )}(hjm#h]h Description}(hjo#hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjk#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#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&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j'gadget_is_altset_supported (C function)c.gadget_is_altset_supportedhNtauh1jhj`hhhNhNubj)}(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}(hj#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 }(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#hhhj#hMubj)}(hgadget_is_altset_supportedh]j)}(hgadget_is_altset_supportedh]hgadget_is_altset_supported}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj#hhhj#hMubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubj)}(h h]h }(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj $ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj$modnameN classnameNjj)}j]j)}jj#sbc.gadget_is_altset_supportedasbuh1hhj#ubj)}(h h]h }(hj0$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubj)}(hjh]h*}(hj>$hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj#ubj)}(hjm!h]hg}(hjK$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj#ubah}(h]h ]h"]h$]h&]jjuh1jhj#hhhj#hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj#hhhj#hMubah}(h]j#ah ](j j eh"]h$]h&]j j )j huh1jhj#hMhj#hhubj )}(hhh]h)}(h1return true iff the hardware supports altsettingsh]h1return true iff the hardware supports altsettings}(hjt$hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjq$hhubah}(h]h ]h"]h$]h&]uh1j hj#hhhj#hMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j$j- j$j. j/ j0 uh1jhhhj`hNhNubj2 )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]j< )}(hj$h]h Parameters}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj$ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj$ubjq)}(hhh]jv)}(h6``struct usb_gadget *g`` controller to check for quirkh](j|)}(h``struct usb_gadget *g``h]j)}(hj$h]hstruct usb_gadget *g}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&]uh1j{ha/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$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&]uh1juhj$hMhj$ubah}(h]h ]h"]h$]h&]uh1jphj$ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&gadget_is_stall_supported (C function)c.gadget_is_stall_supportedhNtauh1jhj`hhhNhNubj)}(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}(hj%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.hhMubj)}(h h]h }(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj %hhhj%hMubj)}(hgadget_is_stall_supportedh]j)}(hgadget_is_stall_supportedh]hgadget_is_stall_supported}(hj0%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,%ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj %hhhj%hMubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hjL%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjH%ubj)}(h h]h }(hjY%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjH%ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hjj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjg%ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjl%modnameN classnameNjj)}j]j)}jj2%sbc.gadget_is_stall_supportedasbuh1hhjH%ubj)}(h h]h }(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjH%ubj)}(hjh]h*}(hj%hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjH%ubj)}(hjm!h]hg}(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjH%ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjD%ubah}(h]h ]h"]h$]h&]jjuh1jhj %hhhj%hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj%hhhj%hMubah}(h]j%ah ](j j eh"]h$]h&]j j )j huh1jhj%hMhj%hhubj )}(hhh]h)}(h.return true iff the hardware supports stallingh]h.return true iff the hardware supports stalling}(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&]uh1j hj%hhhj%hMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j%j- j%j. j/ j0 uh1jhhhj`hNhNubj2 )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]j< )}(hj%h]h Parameters}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj%ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj%ubjq)}(hhh]jv)}(h6``struct usb_gadget *g`` controller to check for quirkh](j|)}(h``struct usb_gadget *g``h]j)}(hj&h]hstruct usb_gadget *g}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj &ubah}(h]h ]h"]h$]h&]uh1j{ha/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(&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&]uh1juhj$&hMhj&ubah}(h]h ]h"]h$]h&]uh1jphj%ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$gadget_is_zlp_supported (C function)c.gadget_is_zlp_supportedhNtauh1jhj`hhhNhNubj)}(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}(hji&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.hhM$ubj)}(h h]h }(hjx&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhje&hhhjw&hM$ubj)}(hgadget_is_zlp_supportedh]j)}(hgadget_is_zlp_supportedh]hgadget_is_zlp_supported}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubah}(h]h ](jjeh"]h$]h&]jjuh1jhje&hhhjw&hM$ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubj)}(h h]h }(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj&modnameN classnameNjj)}j]j)}jj&sbc.gadget_is_zlp_supportedasbuh1hhj&ubj)}(h h]h }(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubj)}(hjh]h*}(hj&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj&ubj)}(hjm!h]hg}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj&ubah}(h]h ]h"]h$]h&]jjuh1jhje&hhhjw&hM$ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhja&hhhjw&hM$ubah}(h]j\&ah ](j j eh"]h$]h&]j j )j huh1jhjw&hM$hj^&hhubj )}(hhh]h)}(h)return true iff the hardware supports zlph]h)return true iff the hardware supports zlp}(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&]uh1j hj^&hhhjw&hM$ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j@'j- j@'j. j/ j0 uh1jhhhj`hNhNubj2 )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]j< )}(hjJ'h]h Parameters}(hjL'hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjH'ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM%hjD'ubjq)}(hhh]jv)}(h6``struct usb_gadget *g`` controller to check for quirkh](j|)}(h``struct usb_gadget *g``h]j)}(hji'h]hstruct usb_gadget *g}(hjk'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjg'ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM'hjc'ubj)}(hhh]h)}(hcontroller to check for quirkh]hcontroller to check for quirk}(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&]uh1jhjc'ubeh}(h]h ]h"]h$]h&]uh1juhj~'hM'hj`'ubah}(h]h ]h"]h$]h&]uh1jphjD'ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&gadget_avoids_skb_reserve (C function)c.gadget_avoids_skb_reservehNtauh1jhj`hhhNhNubj)}(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}(hj'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 }(hj'hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'hhhj'hM.ubj)}(hgadget_avoids_skb_reserveh]j)}(hgadget_avoids_skb_reserveh]hgadget_avoids_skb_reserve}(hj'hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj'hhhj'hM.ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hj(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubj)}(h h]h }(hj (hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj(ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj (modnameN classnameNjj)}j]j)}jj'sbc.gadget_avoids_skb_reserveasbuh1hhj'ubj)}(h h]h }(hj>(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubj)}(hjh]h*}(hjL(hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj'ubj)}(hjm!h]hg}(hjY(hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj'ubah}(h]h ]h"]h$]h&]jjuh1jhj'hhhj'hM.ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj'hhhj'hM.ubah}(h]j'ah ](j j eh"]h$]h&]j j )j huh1jhj'hM.hj'hhubj )}(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(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&]uh1j hj'hhhj'hM.ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j(j- j(j. j/ j0 uh1jhhhj`hNhNubj2 )}(hH**Parameters** ``struct usb_gadget *g`` controller to check for quirkh](h)}(h**Parameters**h]j< )}(hj(h]h Parameters}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j; 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(ubjq)}(hhh]jv)}(h6``struct usb_gadget *g`` controller to check for quirkh](j|)}(h``struct usb_gadget *g``h]j)}(hj(h]hstruct usb_gadget *g}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(ubah}(h]h ]h"]h$]h&]uh1j{ha/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(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&]uh1juhj(hM0hj(ubah}(h]h ]h"]h$]h&]uh1jphj(ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j gadget_is_dualspeed (C function)c.gadget_is_dualspeedhNtauh1jhj`hhhNhNubj)}(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}(hj)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.hhM7ubj)}(h h]h }(hj,)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj)hhhj+)hM7ubj)}(hgadget_is_dualspeedh]j)}(hgadget_is_dualspeedh]hgadget_is_dualspeed}(hj>)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj:)ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj)hhhj+)hM7ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hjZ)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV)ubj)}(h h]h }(hjg)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV)ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hjx)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhju)ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjz)modnameN classnameNjj)}j]j)}jj@)sbc.gadget_is_dualspeedasbuh1hhjV)ubj)}(h h]h }(hj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV)ubj)}(hjh]h*}(hj)hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjV)ubj)}(hjm!h]hg}(hj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV)ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjR)ubah}(h]h ]h"]h$]h&]jjuh1jhj)hhhj+)hM7ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj)hhhj+)hM7ubah}(h]j)ah ](j j eh"]h$]h&]j j )j huh1jhj+)hM7hj)hhubj )}(hhh]h)}(h/return true iff the hardware handles high speedh]h/return true iff the hardware handles high speed}(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&]uh1j hj)hhhj+)hM7ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j)j- j)j. j/ j0 uh1jhhhj`hNhNubj2 )}(hb**Parameters** ``struct usb_gadget *g`` controller that might support both high and full speedsh](h)}(h**Parameters**h]j< )}(hj)h]h Parameters}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj)ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM8hj)ubjq)}(hhh]jv)}(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}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM:hj*ubj)}(hhh]h)}(h7controller that might support both high and full speedsh]h7controller that might support both high and full speeds}(hj6*hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM5hj3*ubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1juhj2*hM:hj*ubah}(h]h ]h"]h$]h&]uh1jphj)ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!gadget_is_superspeed (C function)c.gadget_is_superspeedhNtauh1jhj`hhhNhNubj)}(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}(hjw*hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjs*hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM@ubj)}(h h]h }(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjs*hhhj*hM@ubj)}(hgadget_is_superspeedh]j)}(hgadget_is_superspeedh]hgadget_is_superspeed}(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubah}(h]h ](jjeh"]h$]h&]jjuh1jhjs*hhhj*hM@ubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj)}(h h]h }(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj*modnameN classnameNjj)}j]j)}jj*sbc.gadget_is_superspeedasbuh1hhj*ubj)}(h h]h }(hj*hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj)}(hjh]h*}(hj+hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj*ubj)}(hjm!h]hg}(hj +hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj*ubah}(h]h ]h"]h$]h&]jjuh1jhjs*hhhj*hM@ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjo*hhhj*hM@ubah}(h]jj*ah ](j j eh"]h$]h&]j j )j huh1jhj*hM@hjl*hhubj )}(hhh]h)}(h.return true if the hardware handles superspeedh]h.return true if the hardware handles superspeed}(hj6+hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM=hj3+hhubah}(h]h ]h"]h$]h&]uh1j hjl*hhhj*hM@ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jN+j- jN+j. j/ j0 uh1jhhhj`hNhNubj2 )}(hS**Parameters** ``struct usb_gadget *g`` controller that might support superspeedh](h)}(h**Parameters**h]j< )}(hjX+h]h Parameters}(hjZ+hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjV+ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMAhjR+ubjq)}(hhh]jv)}(hA``struct usb_gadget *g`` controller that might support superspeedh](j|)}(h``struct usb_gadget *g``h]j)}(hjw+h]hstruct usb_gadget *g}(hjy+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhju+ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMChjq+ubj)}(hhh]h)}(h(controller that might support superspeedh]h(controller that might support superspeed}(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&]uh1jhjq+ubeh}(h]h ]h"]h$]h&]uh1juhj+hMChjn+ubah}(h]h ]h"]h$]h&]uh1jphjR+ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&gadget_is_superspeed_plus (C function)c.gadget_is_superspeed_plushNtauh1jhj`hhhNhNubj)}(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}(hj+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.hhMJubj)}(h h]h }(hj+hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj+hhhj+hMJubj)}(hgadget_is_superspeed_plush]j)}(hgadget_is_superspeed_plush]hgadget_is_superspeed_plus}(hj+hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj+ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj+hhhj+hMJubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hj,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ,ubj)}(h h]h }(hj,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ,ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj,,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj),ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj.,modnameN classnameNjj)}j]j)}jj+sbc.gadget_is_superspeed_plusasbuh1hhj ,ubj)}(h h]h }(hjL,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ,ubj)}(hjh]h*}(hjZ,hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ,ubj)}(hjm!h]hg}(hjg,hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ,ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj,ubah}(h]h ]h"]h$]h&]jjuh1jhj+hhhj+hMJubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj+hhhj+hMJubah}(h]j+ah ](j j eh"]h$]h&]j j )j huh1jhj+hMJhj+hhubj )}(hhh]h)}(h3return true if the hardware handles superspeed plush]h3return true if the hardware handles superspeed plus}(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&]uh1j hj+hhhj+hMJubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j,j- j,j. j/ j0 uh1jhhhj`hNhNubj2 )}(hX**Parameters** ``struct usb_gadget *g`` controller that might support superspeed plush](h)}(h**Parameters**h]j< )}(hj,h]h Parameters}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj,ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMJhj,ubjq)}(hhh]jv)}(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}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]uh1j{ha/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,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&]uh1juhj,hMLhj,ubah}(h]h ]h"]h$]h&]uh1jphj,ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jgadget_is_otg (C function)c.gadget_is_otghNtauh1jhj`hhhNhNubj)}(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}(hj+-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.hhMVubj)}(h h]h }(hj:-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'-hhhj9-hMVubj)}(h gadget_is_otgh]j)}(h gadget_is_otgh]h gadget_is_otg}(hjL-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjH-ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj'-hhhj9-hMVubj)}(h(struct usb_gadget *g)h]j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hjh-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjd-ubj)}(h h]h }(hju-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjd-ubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj-ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj-modnameN classnameNjj)}j]j)}jjN-sbc.gadget_is_otgasbuh1hhjd-ubj)}(h h]h }(hj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjd-ubj)}(hjh]h*}(hj-hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjd-ubj)}(hjm!h]hg}(hj-hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjd-ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj`-ubah}(h]h ]h"]h$]h&]jjuh1jhj'-hhhj9-hMVubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj#-hhhj9-hMVubah}(h]j-ah ](j j eh"]h$]h&]j j )j huh1jhj9-hMVhj -hhubj )}(hhh]h)}(h)return true iff the hardware is OTG-readyh]h)return true iff the hardware is OTG-ready}(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&]uh1j hj -hhhj9-hMVubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j.j- j.j. j/ j0 uh1jhhhj`hNhNubj2 )}(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]j< )}(hj .h]h Parameters}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj .ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMThj.ubjq)}(hhh]jv)}(hH``struct usb_gadget *g`` controller that might have a Mini-AB connector h](j|)}(h``struct usb_gadget *g``h]j)}(hj+.h]hstruct usb_gadget *g}(hj-.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj).ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMQhj%.ubj)}(hhh]h)}(h.controller that might have a Mini-AB connectorh]Eh.controller that might have a Mini-AB connector}(hjD.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@.hMQhjA.ubah}(h]h ]h"]h$]h&]uh1jhj%.ubeh}(h]h ]h"]h$]h&]uh1juhj@.hMQhj".ubah}(h]h ]h"]h$]h&]uh1jphj.ubh)}(h**Description**h]j< )}(hjf.h]h Description}(hjh.hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjd.ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMShj.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|.hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMShj.ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_gadget_driver (C struct)c.usb_gadget_driverhNtauh1jhj`hhhNhNubj)}(hhh](j)}(husb_gadget_driverh]j)}(hstruct usb_gadget_driverh](j)}(hjh]hstruct}(hj.hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMYubj)}(h h]h }(hj.hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.hhhj.hMYubj)}(husb_gadget_driverh]j)}(hj.h]husb_gadget_driver}(hj.hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj.hhhj.hMYubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj.hhhj.hMYubah}(h]j.ah ](j j eh"]h$]h&]j j )j huh1jhj.hMYhj.hhubj )}(hhh]h)}(hdriver for usb gadget devicesh]hdriver for usb gadget devices}(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&]uh1j hj.hhhj.hMYubeh}(h]h ](jstructeh"]h$]h&]j+ jj, j/j- j/j. j/ j0 uh1jhhhj`hNhNubj2 )}(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](j< )}(h**Definition**h]h Definition}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj /ubh:}(hj /hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj /ubjW )}(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; };}hj*/sbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj /ubh)}(h **Members**h]j< )}(hj;/h]hMembers}(hj=/hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj9/ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj /ubjq)}(hhh](jv)}(h5``function`` String describing the gadget's function h](j|)}(h ``function``h]j)}(hjZ/h]hfunction}(hj\/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjX/ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjT/ubj)}(hhh]h)}(h'String describing the gadget's functionh]h)String describing the gadget’s function}(hjs/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjo/hMhjp/ubah}(h]h ]h"]h$]h&]uh1jhjT/ubeh}(h]h ]h"]h$]h&]uh1juhjo/hMhjQ/ubjv)}(h0``max_speed`` Highest speed the driver handles. h](j|)}(h ``max_speed``h]j)}(hj/h]h max_speed}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1j{ha/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/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/hMhj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1juhj/hMhjQ/ubjv)}(h$``bind`` the driver's bind callback h](j|)}(h``bind``h]j)}(hj/h]hbind}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj/ubj)}(hhh]h)}(hthe driver's bind callbackh]hthe driver’s bind callback}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/hMhj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1juhj/hMhjQ/ubjv)}(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)}(hj0h]hunbind}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj/ubj)}(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.}(hj0hhhNhNubah}(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/ubeh}(h]h ]h"]h$]h&]uh1juhj0hMhjQ/ubjv)}(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)}(hj?0h]hsetup}(hjA0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=0ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj90ubj)}(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.}(hjX0hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjU0ubah}(h]h ]h"]h$]h&]uh1jhj90ubeh}(h]h ]h"]h$]h&]uh1juhjT0hMhjQ/ubjv)}(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)}(hjy0h]h disconnect}(hj{0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjw0ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjs0ubj)}(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.}(hj0hhhNhNubah}(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&]uh1jhjs0ubeh}(h]h ]h"]h$]h&]uh1juhj0hMhjQ/ubjv)}(hA``suspend`` Invoked on USB suspend. May be called in_interrupt. h](j|)}(h ``suspend``h]j)}(hj0h]hsuspend}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj0hMhj0ubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1juhj0hMhjQ/ubjv)}(h?``resume`` Invoked on USB resume. May be called in_interrupt. h](j|)}(h ``resume``h]j)}(hj0h]hresume}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj0ubj)}(hhh]h)}(h3Invoked on USB resume. May be called in_interrupt.h]h3Invoked on USB resume. May be called in_interrupt.}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1hMhj1ubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1juhj1hMhjQ/ubjv)}(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)}(hj%1h]hreset}(hj'1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#1ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj1ubj)}(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.}(hj>1hhhNhNubah}(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&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1juhj:1hMhjQ/ubjv)}(h/``driver`` Driver model state for this driver. h](j|)}(h ``driver``h]j)}(hj_1h]hdriver}(hja1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]1ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjY1ubj)}(hhh]h)}(h#Driver model state for this driver.h]h#Driver model state for this driver.}(hjx1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjt1hMhju1ubah}(h]h ]h"]h$]h&]uh1jhjY1ubeh}(h]h ]h"]h$]h&]uh1juhjt1hMhjQ/ubjv)}(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}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1j{ha/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.}(hj1hhhNhNubah}(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&]uh1juhj1hMhjQ/ubjv)}(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)}(hj1h]hmatch_existing_only}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj1ubj)}(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}(hj1hhhNhNubah}(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&]uh1juhj1hMhjQ/ubjv)}(h:``is_bound`` Allow a driver to be bound to only one gadgeth](j|)}(h ``is_bound``h]j)}(hj 2h]his_bound}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj 2ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj2ubj)}(hhh]h)}(h-Allow a driver to be bound to only one gadgeth]h-Allow a driver to be bound to only one gadget}(hj%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&]uh1juhj!2hMhjQ/ubeh}(h]h ]h"]h$]h&]uh1jphj /ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubh)}(h**Description**h]j< )}(hjO2h]h Description}(hjQ2hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjM2ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hje2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hjt2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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).}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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).}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.)}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(h**NOTE**h]j< )}(hj2h]hNOTE}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj2ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubh)}(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.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj`hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j-usb_gadget_register_driver_owner (C function)"c.usb_gadget_register_driver_ownerhNtauh1jhj`hhhNhNubj)}(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}(hj;3hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj73hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMubj)}(h h]h }(hjJ3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj73hhhjI3hMubj)}(h usb_gadget_register_driver_ownerh]j)}(h usb_gadget_register_driver_ownerh]h usb_gadget_register_driver_owner}(hj\3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjX3ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj73hhhjI3hMubj)}(hN(struct usb_gadget_driver *driver, struct module *owner, const char *mod_name)h](j)}(h struct usb_gadget_driver *driverh](j)}(hjh]hstruct}(hjx3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt3ubj)}(h h]h }(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt3ubh)}(hhh]j)}(husb_gadget_driverh]husb_gadget_driver}(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj3modnameN classnameNjj)}j]j)}jj^3sb"c.usb_gadget_register_driver_ownerasbuh1hhjt3ubj)}(h h]h }(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt3ubj)}(hjh]h*}(hj3hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjt3ubj)}(hdriverh]hdriver}(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt3ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjp3ubj)}(hstruct module *ownerh](j)}(hjh]hstruct}(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubj)}(h h]h }(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubh)}(hhh]j)}(hmoduleh]hmodule}(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj 4modnameN classnameNjj)}j]j3"c.usb_gadget_register_driver_ownerasbuh1hhj3ubj)}(h h]h }(hj&4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubj)}(hjh]h*}(hj44hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj3ubj)}(hownerh]howner}(hjA4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjp3ubj)}(hconst char *mod_nameh](j)}(hconsth]hconst}(hjZ4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV4ubj)}(h h]h }(hjh4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV4ubj#)}(hcharh]hchar}(hjv4hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjV4ubj)}(h h]h }(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV4ubj)}(hjh]h*}(hj4hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjV4ubj)}(hmod_nameh]hmod_name}(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjV4ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjp3ubeh}(h]h ]h"]h$]h&]jjuh1jhj73hhhjI3hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj33hhhjI3hMubah}(h]j.3ah ](j j eh"]h$]h&]j j )j huh1jhjI3hMhj03hhubj )}(hhh]h)}(hregister a gadget driverh]hregister a gadget driver}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj4hhubah}(h]h ]h"]h$]h&]uh1j hj03hhhjI3hMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j4j- j4j. j/ j0 uh1jhhhj`hNhNubj2 )}(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]j< )}(hj4h]h Parameters}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj4ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj4ubjq)}(hhh](jv)}(hA``struct usb_gadget_driver *driver`` the driver being registered h](j|)}(h$``struct usb_gadget_driver *driver``h]j)}(hj 5h]h struct usb_gadget_driver *driver}(hj 5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj5ubj)}(hhh]h)}(hthe driver being registeredh]hthe driver being registered}(hj#5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hMhj 5ubah}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1juhj5hMhj5ubjv)}(h+``struct module *owner`` the driver module h](j|)}(h``struct module *owner``h]j)}(hjC5h]hstruct module *owner}(hjE5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA5ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj=5ubj)}(hhh]h)}(hthe driver moduleh]hthe driver module}(hj\5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjX5hMhjY5ubah}(h]h ]h"]h$]h&]uh1jhj=5ubeh}(h]h ]h"]h$]h&]uh1juhjX5hMhj5ubjv)}(h8``const char *mod_name`` the driver module's build name h](j|)}(h``const char *mod_name``h]j)}(hj|5h]hconst char *mod_name}(hj~5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjz5ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjv5ubj)}(hhh]h)}(hthe driver module's build nameh]h the driver module’s build name}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hMhj5ubah}(h]h ]h"]h$]h&]uh1jhjv5ubeh}(h]h ]h"]h$]h&]uh1juhj5hMhj5ubeh}(h]h ]h"]h$]h&]uh1jphj4ubh)}(h **Context**h]j< )}(hj5h]hContext}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj5ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj4ubh)}(h can sleeph]h can sleep}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj4ubh)}(h**Description**h]j< )}(hj5h]h Description}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj5ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj4ubh)}(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 }(hj5hhhNhNubj< )}(h **bind\(\)**h]hbind()}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj5ubhq function will be called to bind it to a gadget before this registration call returns. It’s expected that the }(hj5hhhNhNubj< )}(h **bind\(\)**h]hbind()}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj5ubh# function will be in init sections.}(hj5hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj4ubh)}(h=Use the macro defined below instead of calling this directly.h]h=Use the macro defined below instead of calling this directly.}(hj'6hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM hj4ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j)usb_gadget_unregister_driver (C function)c.usb_gadget_unregister_driverhNtauh1jhj`hhhNhNubj)}(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}(hjV6hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjR6hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM"ubj)}(h h]h }(hje6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjR6hhhjd6hM"ubj)}(husb_gadget_unregister_driverh]j)}(husb_gadget_unregister_driverh]husb_gadget_unregister_driver}(hjw6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjs6ubah}(h]h ](jjeh"]h$]h&]jjuh1jhjR6hhhjd6hM"ubj)}(h"(struct usb_gadget_driver *driver)h]j)}(h struct usb_gadget_driver *driverh](j)}(hjh]hstruct}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubj)}(h h]h }(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubh)}(hhh]j)}(husb_gadget_driverh]husb_gadget_driver}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj6modnameN classnameNjj)}j]j)}jjy6sbc.usb_gadget_unregister_driverasbuh1hhj6ubj)}(h h]h }(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubj)}(hjh]h*}(hj6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj6ubj)}(hdriverh]hdriver}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj6ubah}(h]h ]h"]h$]h&]jjuh1jhjR6hhhjd6hM"ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjN6hhhjd6hM"ubah}(h]jI6ah ](j j eh"]h$]h&]j j )j huh1jhjd6hM"hjK6hhubj )}(hhh]h)}(hunregister a gadget driverh]hunregister a gadget driver}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj7hhubah}(h]h ]h"]h$]h&]uh1j hjK6hhhjd6hM"ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j.7j- j.7j. j/ j0 uh1jhhhj`hNhNubj2 )}(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]j< )}(hj87h]h Parameters}(hj:7hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj67ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj27ubjq)}(hhh]jv)}(hC``struct usb_gadget_driver *driver`` the driver being unregistered h](j|)}(h$``struct usb_gadget_driver *driver``h]j)}(hjW7h]h struct usb_gadget_driver *driver}(hjY7hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjU7ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhjQ7ubj)}(hhh]h)}(hthe driver being unregisteredh]hthe driver being unregistered}(hjp7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjl7hMhjm7ubah}(h]h ]h"]h$]h&]uh1jhjQ7ubeh}(h]h ]h"]h$]h&]uh1juhjl7hMhjN7ubah}(h]h ]h"]h$]h&]uh1jphj27ubh)}(h **Context**h]j< )}(hj7h]hContext}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj7ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj27ubh)}(h can sleeph]h can sleep}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj27ubh)}(h**Description**h]j< )}(hj7h]h Description}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj7ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj27ubh)}(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.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMhj27ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string (C struct) c.usb_stringhNtauh1jhj`hhhNhNubj)}(hhh](j)}(h usb_stringh]j)}(hstruct usb_stringh](j)}(hjh]hstruct}(hj7hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj7hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM$ubj)}(h h]h }(hj 8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj7hhhj 8hM$ubj)}(h usb_stringh]j)}(hj7h]h usb_string}(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj7hhhj 8hM$ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj7hhhj 8hM$ubah}(h]j7ah ](j j eh"]h$]h&]j j )j huh1jhj 8hM$hj7hhubj )}(hhh]h)}(hwraps a C string and its USB idh]hwraps a C string and its USB id}(hj@8hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM)hj=8hhubah}(h]h ]h"]h$]h&]uh1j hj7hhhj 8hM$ubeh}(h]h ](jstructeh"]h$]h&]j+ jj, jX8j- jX8j. j/ j0 uh1jhhhj`hNhNubj2 )}(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](j< )}(h**Definition**h]h Definition}(hjd8hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj`8ubh:}(hj`8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM-hj\8ubjW )}(hAstruct usb_string { u8 id; const char *s; };h]hAstruct usb_string { u8 id; const char *s; };}hj}8sbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM/hj\8ubh)}(h **Members**h]j< )}(hj8h]hMembers}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj8ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM4hj\8ubjq)}(hhh](jv)}(h(``id`` the (nonzero) ID for this string h](j|)}(h``id``h]j)}(hj8h]hid}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]uh1j{ha/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}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hM+hj8ubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1juhj8hM+hj8ubjv)}(h#``s`` the string, in UTF-8 encodingh](j|)}(h``s``h]j)}(hj8h]hs}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM+hj8ubj)}(hhh]h)}(hthe string, in UTF-8 encodingh]hthe string, in UTF-8 encoding}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM,hj8ubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1juhj8hM+hj8ubeh}(h]h ]h"]h$]h&]uh1jphj\8ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubh)}(h**Description**h]j< )}(hj)9h]h Description}(hj+9hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj'9ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM/hj`hhubh)}(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.}(hj?9hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM-hj`hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_gadget_strings (C struct)c.usb_gadget_stringshNtauh1jhj`hhhNhNubj)}(hhh](j)}(husb_gadget_stringsh]j)}(hstruct usb_gadget_stringsh](j)}(hjh]hstruct}(hjg9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjc9hhha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM3ubj)}(h h]h }(hju9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjc9hhhjt9hM3ubj)}(husb_gadget_stringsh]j)}(hja9h]husb_gadget_strings}(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9ubah}(h]h ](jjeh"]h$]h&]jjuh1jhjc9hhhjt9hM3ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj_9hhhjt9hM3ubah}(h]jZ9ah ](j j eh"]h$]h&]j j )j huh1jhjt9hM3hj\9hhubj )}(hhh]h)}(h(a set of USB strings in a given languageh]h(a set of USB strings in a given language}(hj9hhhNhNubah}(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&]uh1j hj\9hhhjt9hM3ubeh}(h]h ](jstructeh"]h$]h&]j+ jj, j9j- j9j. j/ j0 uh1jhhhj`hNhNubj2 )}(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](j< )}(h**Definition**h]h Definition}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj9ubh:}(hj9hhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM:hj9ubjW )}(hVstruct usb_gadget_strings { u16 language; struct usb_string *strings; };h]hVstruct usb_gadget_strings { u16 language; struct usb_string *strings; };}hj9sbah}(h]h ]h"]h$]h&]jjuh1jV ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM<hj9ubh)}(h **Members**h]j< )}(hj9h]hMembers}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj9ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhMAhj9ubjq)}(hhh](jv)}(hA``language`` identifies the strings' language (0x0409 for en-us) h](j|)}(h ``language``h]j)}(hj:h]hlanguage}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM8hj:ubj)}(hhh]h)}(h3identifies the strings' language (0x0409 for en-us)h]h5identifies the strings’ language (0x0409 for en-us)}(hj/:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+:hM8hj,:ubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1juhj+:hM8hj :ubjv)}(h+``strings`` array of strings with their idsh](j|)}(h ``strings``h]j)}(hjO:h]hstrings}(hjQ:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjM:ubah}(h]h ]h"]h$]h&]uh1j{ha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM8hjI:ubj)}(hhh]h)}(harray of strings with their idsh]harray of strings with their ids}(hjh:hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM9hje:ubah}(h]h ]h"]h$]h&]uh1jhjI:ubeh}(h]h ]h"]h$]h&]uh1juhjd:hM8hj :ubeh}(h]h ]h"]h$]h&]uh1jphj9ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj`hhhNhNubh)}(h**Description**h]j< )}(hj:h]h Description}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1j; 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`hhubh)}(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:hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:317: ./include/linux/usb/gadget.hhM:hj`hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!usb_free_descriptors (C function)c.usb_free_descriptorshNtauh1jhj`hhhNhNubj)}(hhh](j)}(hh]h&const struct usb_gadget_strings *table}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj=ubj)}(hhh]h)}(h of c strings encoded using UTF-8h]h of c strings encoded using UTF-8}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hKhj>ubah}(h]h ]h"]h$]h&]uh1jhj=ubeh}(h]h ]h"]h$]h&]uh1juhj>hKhj=ubjv)}(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}(hj@>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<>ubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhj8>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}(hjW>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjS>hKhjT>ubah}(h]h ]h"]h$]h&]uh1jhj8>ubeh}(h]h ]h"]h$]h&]uh1juhjS>hKhj=ubjv)}(h7``u8 *buf`` at least 256 bytes, must be 16-bit aligned h](j|)}(h ``u8 *buf``h]j)}(hjw>h]hu8 *buf}(hjy>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhju>ubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKhjq>ubj)}(hhh]h)}(h*at least 256 bytes, must be 16-bit alignedh]h*at least 256 bytes, must be 16-bit aligned}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hKhj>ubah}(h]h ]h"]h$]h&]uh1jhjq>ubeh}(h]h ]h"]h$]h&]uh1juhj>hKhj=ubeh}(h]h ]h"]h$]h&]uh1jphj=ubh)}(h**Description**h]j< )}(hj>h]h Description}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1j; 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>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>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&]uh1j1 hj'<hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j usb_validate_langid (C function)c.usb_validate_langidhNtauh1jhj'<hhhNhNubj)}(hhh](j)}(h%bool usb_validate_langid (u16 langid)h]j)}(h$bool usb_validate_langid(u16 langid)h](j#)}(hboolh]hbool}(hj?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.chKKubj)}(h h]h }(hj?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?hhhj?hKKubj)}(husb_validate_langidh]j)}(husb_validate_langidh]husb_validate_langid}(hj'?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#?ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj?hhhj?hKKubj)}(h (u16 langid)h]j)}(h u16 langidh](h)}(hhh]j)}(hu16h]hu16}(hjF?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjC?ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjH?modnameN classnameNjj)}j]j)}jj)?sbc.usb_validate_langidasbuh1hhj??ubj)}(h h]h }(hjf?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj??ubj)}(hlangidh]hlangid}(hjt?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj??ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj;?ubah}(h]h ]h"]h$]h&]jjuh1jhj?hhhj?hKKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj>hhhj?hKKubah}(h]j>ah ](j j eh"]h$]h&]j j )j huh1jhj?hKKhj>hhubj )}(hhh]h)}(h!validate usb language identifiersh]h!validate usb language identifiers}(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&]uh1j hj>hhhj?hKKubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, j?j- j?j. j/ j0 uh1jhhhj'<hNhNubj2 )}(h**Parameters** ``u16 langid`` usb language identifier **Description** Returns true for valid language identifier, otherwise false.h](h)}(h**Parameters**h]j< )}(hj?h]h Parameters}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj?ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKJhj?ubjq)}(hhh]jv)}(h'``u16 langid`` usb language identifier h](j|)}(h``u16 langid``h]j)}(hj?h]h u16 langid}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]uh1j{he/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}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?hKGhj?ubah}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1juhj?hKGhj?ubah}(h]h ]h"]h$]h&]uh1jphj?ubh)}(h**Description**h]j< )}(hj@h]h Description}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj@ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:327: ./drivers/usb/gadget/usbstring.chKIhj?ubh)}(hhjEubj)}(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.}(hjEhhhNhNubah}(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&]uh1juhjEhK>hjEubjv)}(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)}(hjEh]h)const struct usb_descriptor_header **desc}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]uh1j{hb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chK@hjEubj)}(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.}(hjEhhhNhNubah}(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&]uh1juhjEhK@hjEubeh}(h]h ]h"]h$]h&]uh1jphjDubh)}(h**Description**h]j< )}(hjFh]h Description}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjFubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKBhjDubh)}(hXDThis 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.h]hXDThis 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.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKBhjDubh)}(hGadget 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]hGadget 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.}(hj*FhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKHhjDubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj'<hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!usb_copy_descriptors (C function)c.usb_copy_descriptorshNtauh1jhj'<hhhNhNubj)}(hhh](j)}(hYstruct usb_descriptor_header ** usb_copy_descriptors (struct usb_descriptor_header **src)h]j)}(hWstruct usb_descriptor_header **usb_copy_descriptors(struct usb_descriptor_header **src)h](j)}(hjh]hstruct}(hjYFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjUFhhhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKyubj)}(h h]h }(hjgFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjUFhhhjfFhKyubh)}(hhh]j)}(husb_descriptor_headerh]husb_descriptor_header}(hjxFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjuFubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjzFmodnameN classnameNjj)}j]j)}jusb_copy_descriptorssbc.usb_copy_descriptorsasbuh1hhjUFhhhjfFhKyubj)}(h h]h }(hjFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjUFhhhjfFhKyubj)}(hjh]h*}(hjFhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjUFhhhjfFhKyubj)}(hjh]h*}(hjFhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjUFhhhjfFhKyubj)}(husb_copy_descriptorsh]j)}(hjFh]husb_copy_descriptors}(hjFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubah}(h]h ](jjeh"]h$]h&]jjuh1jhjUFhhhjfFhKyubj)}(h$(struct usb_descriptor_header **src)h]j)}(h"struct usb_descriptor_header **srch](j)}(hjh]hstruct}(hjFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubj)}(h h]h }(hjFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubh)}(hhh]j)}(husb_descriptor_headerh]husb_descriptor_header}(hjFhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjGmodnameN classnameNjj)}j]jFc.usb_copy_descriptorsasbuh1hhjFubj)}(h h]h }(hjGhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubj)}(hjh]h*}(hj*GhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjFubj)}(hjh]h*}(hj7GhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjFubj)}(hsrch]hsrc}(hjDGhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjFubah}(h]h ]h"]h$]h&]jjuh1jhjUFhhhjfFhKyubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjQFhhhjfFhKyubah}(h]jLFah ](j j eh"]h$]h&]j j )j huh1jhjfFhKyhjNFhhubj )}(hhh]h)}(h copy a vector of USB descriptorsh]h copy a vector of USB descriptors}(hjnGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKnhjkGhhubah}(h]h ]h"]h$]h&]uh1j hjNFhhhjfFhKyubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jGj- jGj. j/ j0 uh1jhhhj'<hNhNubj2 )}(hX **Parameters** ``struct usb_descriptor_header **src`` null-terminated vector to copy **Context** initialization code, which may sleep **Description** This makes a copy of a vector of USB descriptors. Its primary use is to support usb_function objects which can have multiple copies, each needing different descriptors. Functions may have static tables of descriptors, which are used as templates and customized with identifiers (for interfaces, strings, endpoints, and more) as needed by a given function instance.h](h)}(h**Parameters**h]j< )}(hjGh]h Parameters}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjGubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKrhjGubjq)}(hhh]jv)}(hF``struct usb_descriptor_header **src`` null-terminated vector to copy h](j|)}(h&``struct usb_descriptor_header **src``h]j)}(hjGh]h"struct usb_descriptor_header **src}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]uh1j{hb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKohjGubj)}(hhh]h)}(hnull-terminated vector to copyh]hnull-terminated vector to copy}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGhKohjGubah}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1juhjGhKohjGubah}(h]h ]h"]h$]h&]uh1jphjGubh)}(h **Context**h]j< )}(hjGh]hContext}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjGubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKqhjGubh)}(h$initialization code, which may sleeph]h$initialization code, which may sleep}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKphjGubh)}(h**Description**h]j< )}(hjHh]h Description}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjHubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKrhjGubh)}(hXnThis makes a copy of a vector of USB descriptors. Its primary use is to support usb_function objects which can have multiple copies, each needing different descriptors. Functions may have static tables of descriptors, which are used as templates and customized with identifiers (for interfaces, strings, endpoints, and more) as needed by a given function instance.h]hXnThis makes a copy of a vector of USB descriptors. Its primary use is to support usb_function objects which can have multiple copies, each needing different descriptors. Functions may have static tables of descriptors, which are used as templates and customized with identifiers (for interfaces, strings, endpoints, and more) as needed by a given function instance.}(hj'HhhhNhNubah}(h]h ]h"]h$]h&]uh1hhb/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:330: ./drivers/usb/gadget/config.chKqhjGubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hj'<hhhNhNubeh}(h]optional-utilitiesah ]h"]optional utilitiesah$]h&]uh1hhjhhhhhMAubh)}(hhh](h)}(hComposite Device Frameworkh]hComposite Device Framework}(hjHHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjEHhhhhhMNubh)}(hXTThe core API is sufficient for writing drivers for composite USB devices (with more than one function in a given configuration), and also multi-configuration devices (also more than one function, but not necessarily sharing a given configuration). There is however an optional framework which makes it easier to reuse and combine functions.h]hXTThe core API is sufficient for writing drivers for composite USB devices (with more than one function in a given configuration), and also multi-configuration devices (also more than one function, but not necessarily sharing a given configuration). There is however an optional framework which makes it easier to reuse and combine functions.}(hjVHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMPhjEHhhubh)}(hXsDevices using this framework provide a struct usb_composite_driver, which in turn provides one or more struct usb_configuration instances. Each such configuration includes at least one struct :c:type:`usb_function`, which packages a user visible role such as "network link" or "mass storage device". Management functions may also exist, such as "Device Firmware Upgrade".h](hDevices using this framework provide a struct usb_composite_driver, which in turn provides one or more struct usb_configuration instances. Each such configuration includes at least one struct }(hjdHhhhNhNubh)}(h:c:type:`usb_function`h]j)}(hjnHh]h usb_function}(hjpHhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhjlHubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjj)}j]sbj usb_functionuh1hhhhMVhjdHubh, which packages a user visible role such as “network link” or “mass storage device”. Management functions may also exist, such as “Device Firmware Upgrade”.}(hjdHhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMVhjEHhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_os_desc_ext_prop (C struct)c.usb_os_desc_ext_prophNtauh1jhjEHhhhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhNubj)}(hhh](j)}(husb_os_desc_ext_proph]j)}(hstruct usb_os_desc_ext_proph](j)}(hjh]hstruct}(hjHhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjHhhhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKubj)}(h h]h }(hjHhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjHhhhjHhKubj)}(husb_os_desc_ext_proph]j)}(hjHh]husb_os_desc_ext_prop}(hjHhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjHubah}(h]h ](jjeh"]h$]h&]jjuh1jhjHhhhjHhKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjHhhhjHhKubah}(h]jHah ](j j eh"]h$]h&]j j )j huh1jhjHhKhjHhhubj )}(hhh]h)}(h!describes one "Extended Property"h]h%describes one “Extended Property”}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK;hjHhhubah}(h]h ]h"]h$]h&]uh1j hjHhhhjHhKubeh}(h]h ](jstructeh"]h$]h&]j+ jj, j Ij- j Ij. j/ j0 uh1jhhhjEHhjHhNubj2 )}(hXd**Definition**:: struct usb_os_desc_ext_prop { struct list_head entry; u8 type; int name_len; char *name; int data_len; char *data; struct config_item item; }; **Members** ``entry`` used to keep a list of extended properties ``type`` Extended Property type ``name_len`` Extended Property unicode name length, including terminating '\0' ``name`` Extended Property name ``data_len`` Length of Extended Property blob (for unicode store double len) ``data`` Extended Property blob ``item`` Represents this Extended Property in configfsh](h)}(h**Definition**::h](j< )}(h**Definition**h]h Definition}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjIubh:}(hjIhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK?hjIubjW )}(hstruct usb_os_desc_ext_prop { struct list_head entry; u8 type; int name_len; char *name; int data_len; char *data; struct config_item item; };h]hstruct usb_os_desc_ext_prop { struct list_head entry; u8 type; int name_len; char *name; int data_len; char *data; struct config_item item; };}hj1Isbah}(h]h ]h"]h$]h&]jjuh1jV hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKAhjIubh)}(h **Members**h]j< )}(hjBIh]hMembers}(hjDIhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj@Iubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKKhjIubjq)}(hhh](jv)}(h5``entry`` used to keep a list of extended properties h](j|)}(h ``entry``h]j)}(hjaIh]hentry}(hjcIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_Iubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK=hj[Iubj)}(hhh]h)}(h*used to keep a list of extended propertiesh]h*used to keep a list of extended properties}(hjzIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjvIhK=hjwIubah}(h]h ]h"]h$]h&]uh1jhj[Iubeh}(h]h ]h"]h$]h&]uh1juhjvIhK=hjXIubjv)}(h ``type`` Extended Property type h](j|)}(h``type``h]j)}(hjIh]htype}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjIubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK>hjIubj)}(hhh]h)}(hExtended Property typeh]hExtended Property type}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhK>hjIubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1juhjIhK>hjXIubjv)}(hO``name_len`` Extended Property unicode name length, including terminating '\0' h](j|)}(h ``name_len``h]j)}(hjIh]hname_len}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjIubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK?hjIubj)}(hhh]h)}(hAExtended Property unicode name length, including terminating '\0'h]hEExtended Property unicode name length, including terminating ‘0’}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhK?hjIubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1juhjIhK?hjXIubjv)}(h ``name`` Extended Property name h](j|)}(h``name``h]j)}(hj Jh]hname}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj Jubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK@hjJubj)}(hhh]h)}(hExtended Property nameh]hExtended Property name}(hj%JhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!JhK@hj"Jubah}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1juhj!JhK@hjXIubjv)}(hM``data_len`` Length of Extended Property blob (for unicode store double len) h](j|)}(h ``data_len``h]j)}(hjEJh]hdata_len}(hjGJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCJubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKAhj?Jubj)}(hhh]h)}(h?Length of Extended Property blob (for unicode store double len)h]h?Length of Extended Property blob (for unicode store double len)}(hj^JhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZJhKAhj[Jubah}(h]h ]h"]h$]h&]uh1jhj?Jubeh}(h]h ]h"]h$]h&]uh1juhjZJhKAhjXIubjv)}(h ``data`` Extended Property blob h](j|)}(h``data``h]j)}(hj~Jh]hdata}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj|Jubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKBhjxJubj)}(hhh]h)}(hExtended Property blobh]hExtended Property blob}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJhKBhjJubah}(h]h ]h"]h$]h&]uh1jhjxJubeh}(h]h ]h"]h$]h&]uh1juhjJhKBhjXIubjv)}(h6``item`` Represents this Extended Property in configfsh](j|)}(h``item``h]j)}(hjJh]hitem}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjJubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKBhjJubj)}(hhh]h)}(h-Represents this Extended Property in configfsh]h-Represents this Extended Property in configfs}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKChjJubah}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1juhjJhKBhjXIubeh}(h]h ]h"]h$]h&]uh1jphjIubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhjHhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_os_desc (C struct) c.usb_os_deschNtauh1jhjEHhhhjHhNubj)}(hhh](j)}(h usb_os_desch]j)}(hstruct usb_os_desch](j)}(hjh]hstruct}(hjKhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj Khhhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKIubj)}(h h]h }(hjKhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj KhhhjKhKIubj)}(h usb_os_desch]j)}(hj Kh]h usb_os_desc}(hj1KhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj-Kubah}(h]h ](jjeh"]h$]h&]jjuh1jhj KhhhjKhKIubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj KhhhjKhKIubah}(h]jKah ](j j eh"]h$]h&]j j )j huh1jhjKhKIhjKhhubj )}(hhh]h)}(h6describes OS descriptors associated with one interfaceh]h6describes OS descriptors associated with one interface}(hjSKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKOhjPKhhubah}(h]h ]h"]h$]h&]uh1j hjKhhhjKhKIubeh}(h]h ](jstructeh"]h$]h&]j+ jj, jkKj- jkKj. j/ j0 uh1jhhhjEHhjHhNubj2 )}(hX**Definition**:: struct usb_os_desc { char *ext_compat_id; struct list_head ext_prop; int ext_prop_len; int ext_prop_count; struct mutex *opts_mutex; struct config_group group; struct module *owner; }; **Members** ``ext_compat_id`` 16 bytes of "Compatible ID" and "Subcompatible ID" ``ext_prop`` Extended Properties list ``ext_prop_len`` Total length of Extended Properties blobs ``ext_prop_count`` Number of Extended Properties ``opts_mutex`` Optional mutex protecting config data of a usb_function_instance ``group`` Represents OS descriptors associated with an interface in configfs ``owner`` Module associated with this OS descriptorh](h)}(h**Definition**::h](j< )}(h**Definition**h]h Definition}(hjwKhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjsKubh:}(hjsKhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKShjoKubjW )}(hstruct usb_os_desc { char *ext_compat_id; struct list_head ext_prop; int ext_prop_len; int ext_prop_count; struct mutex *opts_mutex; struct config_group group; struct module *owner; };h]hstruct usb_os_desc { char *ext_compat_id; struct list_head ext_prop; int ext_prop_len; int ext_prop_count; struct mutex *opts_mutex; struct config_group group; struct module *owner; };}hjKsbah}(h]h ]h"]h$]h&]jjuh1jV hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKUhjoKubh)}(h **Members**h]j< )}(hjKh]hMembers}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjKubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK_hjoKubjq)}(hhh](jv)}(hE``ext_compat_id`` 16 bytes of "Compatible ID" and "Subcompatible ID" h](j|)}(h``ext_compat_id``h]j)}(hjKh]h ext_compat_id}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKQhjKubj)}(hhh]h)}(h216 bytes of "Compatible ID" and "Subcompatible ID"h]h:16 bytes of “Compatible ID” and “Subcompatible ID”}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhKQhjKubah}(h]h ]h"]h$]h&]uh1jhjKubeh}(h]h ]h"]h$]h&]uh1juhjKhKQhjKubjv)}(h&``ext_prop`` Extended Properties list h](j|)}(h ``ext_prop``h]j)}(hjKh]hext_prop}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKRhjKubj)}(hhh]h)}(hExtended Properties listh]hExtended Properties list}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhKRhjLubah}(h]h ]h"]h$]h&]uh1jhjKubeh}(h]h ]h"]h$]h&]uh1juhjLhKRhjKubjv)}(h;``ext_prop_len`` Total length of Extended Properties blobs h](j|)}(h``ext_prop_len``h]j)}(hj2Lh]h ext_prop_len}(hj4LhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0Lubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKShj,Lubj)}(hhh]h)}(h)Total length of Extended Properties blobsh]h)Total length of Extended Properties blobs}(hjKLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGLhKShjHLubah}(h]h ]h"]h$]h&]uh1jhj,Lubeh}(h]h ]h"]h$]h&]uh1juhjGLhKShjKubjv)}(h1``ext_prop_count`` Number of Extended Properties h](j|)}(h``ext_prop_count``h]j)}(hjkLh]hext_prop_count}(hjmLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjiLubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKThjeLubj)}(hhh]h)}(hNumber of Extended Propertiesh]hNumber of Extended Properties}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhKThjLubah}(h]h ]h"]h$]h&]uh1jhjeLubeh}(h]h ]h"]h$]h&]uh1juhjLhKThjKubjv)}(hP``opts_mutex`` Optional mutex protecting config data of a usb_function_instance h](j|)}(h``opts_mutex``h]j)}(hjLh]h opts_mutex}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjLubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKUhjLubj)}(hhh]h)}(h@Optional mutex protecting config data of a usb_function_instanceh]h@Optional mutex protecting config data of a usb_function_instance}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhKUhjLubah}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1juhjLhKUhjKubjv)}(hM``group`` Represents OS descriptors associated with an interface in configfs h](j|)}(h ``group``h]j)}(hjLh]hgroup}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjLubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKVhjLubj)}(hhh]h)}(hBRepresents OS descriptors associated with an interface in configfsh]hBRepresents OS descriptors associated with an interface in configfs}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhKVhjLubah}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1juhjLhKVhjKubjv)}(h3``owner`` Module associated with this OS descriptorh](j|)}(h ``owner``h]j)}(hjMh]howner}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKVhjMubj)}(hhh]h)}(h)Module associated with this OS descriptorh]h)Module associated with this OS descriptor}(hj/MhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKWhj,Mubah}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]uh1juhj+MhKVhjKubeh}(h]h ]h"]h$]h&]uh1jphjoKubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhjHhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_os_desc_table (C struct)c.usb_os_desc_tablehNtauh1jhjEHhhhjHhNubj)}(hhh](j)}(husb_os_desc_tableh]j)}(hstruct usb_os_desc_tableh](j)}(hjh]hstruct}(hjpMhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjlMhhhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK]ubj)}(h h]h }(hj~MhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjlMhhhj}MhK]ubj)}(husb_os_desc_tableh]j)}(hjjMh]husb_os_desc_table}(hjMhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMubah}(h]h ](jjeh"]h$]h&]jjuh1jhjlMhhhj}MhK]ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhMhhhj}MhK]ubah}(h]jcMah ](j j eh"]h$]h&]j j )j huh1jhj}MhK]hjeMhhubj )}(hhh]h)}(hHdescribes OS descriptors associated with one interface of a usb_functionh]hHdescribes OS descriptors associated with one interface of a usb_function}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKchjMhhubah}(h]h ]h"]h$]h&]uh1j hjeMhhhj}MhK]ubeh}(h]h ](jstructeh"]h$]h&]j+ jj, jMj- jMj. j/ j0 uh1jhhhjEHhjHhNubj2 )}(h**Definition**:: struct usb_os_desc_table { int if_id; struct usb_os_desc *os_desc; }; **Members** ``if_id`` Interface id ``os_desc`` "Extended Compatibility ID" and "Extended Properties" of the interfaceh](h)}(h**Definition**::h](j< )}(h**Definition**h]h Definition}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjMubh:}(hjMhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKghjMubjW )}(hRstruct usb_os_desc_table { int if_id; struct usb_os_desc *os_desc; };h]hRstruct usb_os_desc_table { int if_id; struct usb_os_desc *os_desc; };}hjMsbah}(h]h ]h"]h$]h&]jjuh1jV hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKihjMubh)}(h **Members**h]j< )}(hjNh]hMembers}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjMubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKnhjMubjq)}(hhh](jv)}(h``if_id`` Interface id h](j|)}(h ``if_id``h]j)}(hjNh]hif_id}(hj!NhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKfhjNubj)}(hhh]h)}(h Interface idh]h Interface id}(hj8NhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4NhKfhj5Nubah}(h]h ]h"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]uh1juhj4NhKfhjNubjv)}(hR``os_desc`` "Extended Compatibility ID" and "Extended Properties" of the interfaceh](j|)}(h ``os_desc``h]j)}(hjXNh]hos_desc}(hjZNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjVNubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKghjRNubj)}(hhh]h)}(hF"Extended Compatibility ID" and "Extended Properties" of the interfaceh]hN“Extended Compatibility ID” and “Extended Properties” of the interface}(hjqNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjmNhKghjnNubah}(h]h ]h"]h$]h&]uh1jhjRNubeh}(h]h ]h"]h$]h&]uh1juhjmNhKghjNubeh}(h]h ]h"]h$]h&]uh1jphjMubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhjHhNubh)}(h**Description**h]j< )}(hjNh]h Description}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKkhjEHhhubh)}(hfEach interface can have at most one "Extended Compatibility ID" and a number of "Extended Properties".h]hnEach interface can have at most one “Extended Compatibility ID” and a number of “Extended Properties”.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKihjEHhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_function (C struct)c.usb_functionhNtauh1jhjEHhhhjHhNubj)}(hhh](j)}(h usb_functionh]j)}(hstruct usb_functionh](j)}(hjh]hstruct}(hjNhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjNhhhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKoubj)}(h h]h }(hjNhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjNhhhjNhKoubj)}(h usb_functionh]j)}(hjNh]h usb_function}(hjNhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjNubah}(h]h ](jjeh"]h$]h&]jjuh1jhjNhhhjNhKoubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjNhhhjNhKoubah}(h]jNah ](j j eh"]h$]h&]j j )j huh1jhjNhKohjNhhubj )}(hhh]h)}(h)describes one function of a configurationh]h)describes one function of a configuration}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKrhjOhhubah}(h]h ]h"]h$]h&]uh1j hjNhhhjNhKoubeh}(h]h ](jstructeh"]h$]h&]j+ jj, j2Oj- j2Oj. j/ j0 uh1jhhhjEHhjHhNubj2 )}(hX**Definition**:: struct usb_function { const char *name; struct usb_gadget_strings **strings; struct usb_descriptor_header **fs_descriptors; struct usb_descriptor_header **hs_descriptors; struct usb_descriptor_header **ss_descriptors; struct usb_descriptor_header **ssp_descriptors; struct usb_configuration *config; struct usb_os_desc_table *os_desc_table; unsigned os_desc_n; int (*bind)(struct usb_configuration *, struct usb_function *); void (*unbind)(struct usb_configuration *, struct usb_function *); void (*free_func)(struct usb_function *f); struct module *mod; int (*set_alt)(struct usb_function *, unsigned interface, unsigned alt); int (*get_alt)(struct usb_function *, unsigned interface); void (*disable)(struct usb_function *); int (*setup)(struct usb_function *, const struct usb_ctrlrequest *); bool (*req_match)(struct usb_function *,const struct usb_ctrlrequest *, bool config0); void (*suspend)(struct usb_function *); void (*resume)(struct usb_function *); int (*get_status)(struct usb_function *); int (*func_suspend)(struct usb_function *, u8 suspend_opt); bool func_suspended; bool func_wakeup_armed; }; **Members** ``name`` For diagnostics, identifies the function. ``strings`` tables of strings, keyed by identifiers assigned during bind() and by language IDs provided in control requests ``fs_descriptors`` Table of full (or low) speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null, the function will not be available at full speed (or at low speed). ``hs_descriptors`` Table of high speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null, the function will not be available at high speed. ``ss_descriptors`` Table of super speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null after initiation, the function will not be available at super speed. ``ssp_descriptors`` Table of super speed plus descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null after initiation, the function will not be available at super speed plus. ``config`` assigned when **usb_add_function\(\)** is called; this is the configuration with which this function is associated. ``os_desc_table`` Table of (interface id, os descriptors) pairs. The function can expose more than one interface. If an interface is a member of an IAD, only the first interface of IAD has its entry in the table. ``os_desc_n`` Number of entries in os_desc_table ``bind`` Before the gadget can register, all of its functions bind() to the available resources including string and interface identifiers used in interface or class descriptors; endpoints; I/O buffers; and so on. ``unbind`` Reverses **bind**; called as a side effect of unregistering the driver which added this function. ``free_func`` free the struct usb_function. ``mod`` (internal) points to the module that created this structure. ``set_alt`` (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. ``get_alt`` Returns the active altsetting. If this is not provided, then only altsetting zero is supported. ``disable`` (REQUIRED) Indicates the function should be disabled. Reasons include host resetting or reconfiguring the gadget, and disconnection. ``setup`` Used for interface-specific control requests. ``req_match`` Tests if a given class request can be handled by this function. ``suspend`` Notifies functions when the host stops sending USB traffic. ``resume`` Notifies functions when the host restarts USB traffic. ``get_status`` Returns function status as a reply to GetStatus() request when the recipient is Interface. ``func_suspend`` callback to be called when SetFeature(FUNCTION_SUSPEND) is reseived ``func_suspended`` Indicates whether the function is in function suspend state. ``func_wakeup_armed`` Indicates whether the function is armed by the host for wakeup signaling.h](h)}(h**Definition**::h](j< )}(h**Definition**h]h Definition}(hj>OhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj:Oubh:}(hj:OhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKvhj6OubjW )}(hXstruct usb_function { const char *name; struct usb_gadget_strings **strings; struct usb_descriptor_header **fs_descriptors; struct usb_descriptor_header **hs_descriptors; struct usb_descriptor_header **ss_descriptors; struct usb_descriptor_header **ssp_descriptors; struct usb_configuration *config; struct usb_os_desc_table *os_desc_table; unsigned os_desc_n; int (*bind)(struct usb_configuration *, struct usb_function *); void (*unbind)(struct usb_configuration *, struct usb_function *); void (*free_func)(struct usb_function *f); struct module *mod; int (*set_alt)(struct usb_function *, unsigned interface, unsigned alt); int (*get_alt)(struct usb_function *, unsigned interface); void (*disable)(struct usb_function *); int (*setup)(struct usb_function *, const struct usb_ctrlrequest *); bool (*req_match)(struct usb_function *,const struct usb_ctrlrequest *, bool config0); void (*suspend)(struct usb_function *); void (*resume)(struct usb_function *); int (*get_status)(struct usb_function *); int (*func_suspend)(struct usb_function *, u8 suspend_opt); bool func_suspended; bool func_wakeup_armed; };h]hXstruct usb_function { const char *name; struct usb_gadget_strings **strings; struct usb_descriptor_header **fs_descriptors; struct usb_descriptor_header **hs_descriptors; struct usb_descriptor_header **ss_descriptors; struct usb_descriptor_header **ssp_descriptors; struct usb_configuration *config; struct usb_os_desc_table *os_desc_table; unsigned os_desc_n; int (*bind)(struct usb_configuration *, struct usb_function *); void (*unbind)(struct usb_configuration *, struct usb_function *); void (*free_func)(struct usb_function *f); struct module *mod; int (*set_alt)(struct usb_function *, unsigned interface, unsigned alt); int (*get_alt)(struct usb_function *, unsigned interface); void (*disable)(struct usb_function *); int (*setup)(struct usb_function *, const struct usb_ctrlrequest *); bool (*req_match)(struct usb_function *,const struct usb_ctrlrequest *, bool config0); void (*suspend)(struct usb_function *); void (*resume)(struct usb_function *); int (*get_status)(struct usb_function *); int (*func_suspend)(struct usb_function *, u8 suspend_opt); bool func_suspended; bool func_wakeup_armed; };}hjWOsbah}(h]h ]h"]h$]h&]jjuh1jV hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKxhj6Oubh)}(h **Members**h]j< )}(hjhOh]hMembers}(hjjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjfOubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj6Oubjq)}(hhh](jv)}(h3``name`` For diagnostics, identifies the function. h](j|)}(h``name``h]j)}(hjOh]hname}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKthjOubj)}(hhh]h)}(h)For diagnostics, identifies the function.h]h)For diagnostics, identifies the function.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjOhKthjOubah}(h]h ]h"]h$]h&]uh1jhjOubeh}(h]h ]h"]h$]h&]uh1juhjOhKthj~Oubjv)}(h|``strings`` tables of strings, keyed by identifiers assigned during bind() and by language IDs provided in control requests h](j|)}(h ``strings``h]j)}(hjOh]hstrings}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKvhjOubj)}(hhh]h)}(hotables of strings, keyed by identifiers assigned during bind() and by language IDs provided in control requestsh]hotables of strings, keyed by identifiers assigned during bind() and by language IDs provided in control requests}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKuhjOubah}(h]h ]h"]h$]h&]uh1jhjOubeh}(h]h ]h"]h$]h&]uh1juhjOhKvhj~Oubjv)}(h``fs_descriptors`` Table of full (or low) speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null, the function will not be available at full speed (or at low speed). h](j|)}(h``fs_descriptors``h]j)}(hjOh]hfs_descriptors}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKyhjOubj)}(hhh]h)}(hTable of full (or low) speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null, the function will not be available at full speed (or at low speed).h](haTable of full (or low) speed descriptors, using interface and string identifiers assigned during }(hjPhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjPubh_. If this pointer is null, the function will not be available at full speed (or at low speed).}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKwhjPubah}(h]h ]h"]h$]h&]uh1jhjOubeh}(h]h ]h"]h$]h&]uh1juhjPhKyhj~Oubjv)}(h``hs_descriptors`` Table of high speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null, the function will not be available at high speed. h](j|)}(h``hs_descriptors``h]j)}(hjFPh]hhs_descriptors}(hjHPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDPubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK|hj@Pubj)}(hhh]h)}(hTable of high speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null, the function will not be available at high speed.h](hXTable of high speed descriptors, using interface and string identifiers assigned during }(hj_PhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjgPhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj_PubhM. If this pointer is null, the function will not be available at high speed.}(hj_PhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKzhj\Pubah}(h]h ]h"]h$]h&]uh1jhj@Pubeh}(h]h ]h"]h$]h&]uh1juhj[PhK|hj~Oubjv)}(h``ss_descriptors`` Table of super speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null after initiation, the function will not be available at super speed. h](j|)}(h``ss_descriptors``h]j)}(hjPh]hss_descriptors}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjPubj)}(hhh]h)}(hTable of super speed descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null after initiation, the function will not be available at super speed.h](hYTable of super speed descriptors, using interface and string identifiers assigned during }(hjPhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjPubh^. If this pointer is null after initiation, the function will not be available at super speed.}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhK}hjPubah}(h]h ]h"]h$]h&]uh1jhjPubeh}(h]h ]h"]h$]h&]uh1juhjPhKhj~Oubjv)}(h``ssp_descriptors`` Table of super speed plus descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null after initiation, the function will not be available at super speed plus. h](j|)}(h``ssp_descriptors``h]j)}(hjPh]hssp_descriptors}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjPubj)}(hhh]h)}(hTable of super speed plus descriptors, using interface and string identifiers assigned during **bind\(\)**. If this pointer is null after initiation, the function will not be available at super speed plus.h](h^Table of super speed plus descriptors, using interface and string identifiers assigned during }(hjPhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjPubhc. If this pointer is null after initiation, the function will not be available at super speed plus.}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjPubah}(h]h ]h"]h$]h&]uh1jhjPubeh}(h]h ]h"]h$]h&]uh1juhjPhKhj~Oubjv)}(h``config`` assigned when **usb_add_function\(\)** is called; this is the configuration with which this function is associated. h](j|)}(h ``config``h]j)}(hj*Qh]hconfig}(hj,QhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(Qubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj$Qubj)}(hhh]h)}(hsassigned when **usb_add_function\(\)** is called; this is the configuration with which this function is associated.h](hassigned when }(hjCQhhhNhNubj< )}(h**usb_add_function\(\)**h]husb_add_function()}(hjKQhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjCQubhM is called; this is the configuration with which this function is associated.}(hjCQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhj@Qubah}(h]h ]h"]h$]h&]uh1jhj$Qubeh}(h]h ]h"]h$]h&]uh1juhj?QhKhj~Oubjv)}(h``os_desc_table`` Table of (interface id, os descriptors) pairs. The function can expose more than one interface. If an interface is a member of an IAD, only the first interface of IAD has its entry in the table. h](j|)}(h``os_desc_table``h]j)}(hjvQh]h os_desc_table}(hjxQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjtQubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjpQubj)}(hhh]h)}(hTable of (interface id, os descriptors) pairs. The function can expose more than one interface. If an interface is a member of an IAD, only the first interface of IAD has its entry in the table.h]hTable of (interface id, os descriptors) pairs. The function can expose more than one interface. If an interface is a member of an IAD, only the first interface of IAD has its entry in the table.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjQubah}(h]h ]h"]h$]h&]uh1jhjpQubeh}(h]h ]h"]h$]h&]uh1juhjQhKhj~Oubjv)}(h1``os_desc_n`` Number of entries in os_desc_table h](j|)}(h ``os_desc_n``h]j)}(hjQh]h os_desc_n}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjQubj)}(hhh]h)}(h"Number of entries in os_desc_tableh]h"Number of entries in os_desc_table}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhKhjQubah}(h]h ]h"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]uh1juhjQhKhj~Oubjv)}(h``bind`` Before the gadget can register, all of its functions bind() to the available resources including string and interface identifiers used in interface or class descriptors; endpoints; I/O buffers; and so on. h](j|)}(h``bind``h]j)}(hjQh]hbind}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjQubj)}(hhh]h)}(hBefore the gadget can register, all of its functions bind() to the available resources including string and interface identifiers used in interface or class descriptors; endpoints; I/O buffers; and so on.h]hBefore the gadget can register, all of its functions bind() to the available resources including string and interface identifiers used in interface or class descriptors; endpoints; I/O buffers; and so on.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjQubah}(h]h ]h"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]uh1juhjQhKhj~Oubjv)}(hm``unbind`` Reverses **bind**; called as a side effect of unregistering the driver which added this function. h](j|)}(h ``unbind``h]j)}(hj#Rh]hunbind}(hj%RhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!Rubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhKhjRubj)}(hhh]h)}(haReverses **bind**; called as a side effect of unregistering the driver which added this function.h](h Reverses }(hj``bConfigurationValue`` Copied into configuration descriptor. h](j|)}(h``bConfigurationValue``h]j)}(hj Xh]hbConfigurationValue}(hj XhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]uh1j{hd/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.}(hj"XhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhMhjXubah}(h]h ]h"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]uh1juhjXhMhjVubjv)}(h9``iConfiguration`` Copied into configuration descriptor. h](j|)}(h``iConfiguration``h]j)}(hjBXh]hiConfiguration}(hjDXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@Xubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj_hhubah}(h]h ]h"]h$]h&]uh1j hj^hhhj _hMubeh}(h]h ](jstructeh"]h$]h&]j+ jj, jY_j- jY_j. j/ j0 uh1jhhhjEHhjHhNubj2 )}(hXg**Definition**:: struct usb_composite_dev { struct usb_gadget *gadget; struct usb_request *req; struct usb_request *os_desc_req; struct usb_configuration *config; u8 qw_sign[OS_STRING_QW_SIGN_LEN]; u8 b_vendor_code; struct usb_configuration *os_desc_config; unsigned int use_os_string:1; u16 bcd_webusb_version; u8 b_webusb_vendor_code; char landing_page[WEBUSB_URL_RAW_MAX_LENGTH]; unsigned int use_webusb:1; unsigned int setup_pending:1; unsigned int os_desc_pending:1; }; **Members** ``gadget`` read-only, abstracts the gadget's usb peripheral controller ``req`` used for control responses; buffer is pre-allocated ``os_desc_req`` used for OS descriptors responses; buffer is pre-allocated ``config`` the currently active configuration ``qw_sign`` qwSignature part of the OS string ``b_vendor_code`` bMS_VendorCode part of the OS string ``os_desc_config`` the configuration to be used with OS descriptors ``use_os_string`` false by default, interested gadgets set it ``bcd_webusb_version`` 0x0100 by default, WebUSB specification version ``b_webusb_vendor_code`` 0x0 by default, vendor code for WebUSB ``landing_page`` empty by default, landing page to announce in WebUSB ``use_webusb`` false by default, interested gadgets set it ``setup_pending`` true when setup request is queued but not completed ``os_desc_pending`` true when os_desc request is queued but not completedh](h)}(h**Definition**::h](j< )}(h**Definition**h]h Definition}(hje_hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hja_ubh:}(hja_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj]_ubjW )}(hXstruct usb_composite_dev { struct usb_gadget *gadget; struct usb_request *req; struct usb_request *os_desc_req; struct usb_configuration *config; u8 qw_sign[OS_STRING_QW_SIGN_LEN]; u8 b_vendor_code; struct usb_configuration *os_desc_config; unsigned int use_os_string:1; u16 bcd_webusb_version; u8 b_webusb_vendor_code; char landing_page[WEBUSB_URL_RAW_MAX_LENGTH]; unsigned int use_webusb:1; unsigned int setup_pending:1; unsigned int os_desc_pending:1; };h]hXstruct usb_composite_dev { struct usb_gadget *gadget; struct usb_request *req; struct usb_request *os_desc_req; struct usb_configuration *config; u8 qw_sign[OS_STRING_QW_SIGN_LEN]; u8 b_vendor_code; struct usb_configuration *os_desc_config; unsigned int use_os_string:1; u16 bcd_webusb_version; u8 b_webusb_vendor_code; char landing_page[WEBUSB_URL_RAW_MAX_LENGTH]; unsigned int use_webusb:1; unsigned int setup_pending:1; unsigned int os_desc_pending:1; };}hj~_sbah}(h]h ]h"]h$]h&]jjuh1jV hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj]_ubh)}(h **Members**h]j< )}(hj_h]hMembers}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj_ubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj]_ubjq)}(hhh](jv)}(hG``gadget`` read-only, abstracts the gadget's usb peripheral controller h](j|)}(h ``gadget``h]j)}(hj_h]hgadget}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj_ubj)}(hhh]h)}(h;read-only, abstracts the gadget's usb peripheral controllerh]h=read-only, abstracts the gadget’s usb peripheral controller}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_hMhj_ubah}(h]h ]h"]h$]h&]uh1jhj_ubeh}(h]h ]h"]h$]h&]uh1juhj_hMhj_ubjv)}(h<``req`` used for control responses; buffer is pre-allocated h](j|)}(h``req``h]j)}(hj_h]hreq}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj_ubj)}(hhh]h)}(h3used for control responses; buffer is pre-allocatedh]h3used for control responses; buffer is pre-allocated}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_hMhj_ubah}(h]h ]h"]h$]h&]uh1jhj_ubeh}(h]h ]h"]h$]h&]uh1juhj_hMhj_ubjv)}(hK``os_desc_req`` used for OS descriptors responses; buffer is pre-allocated h](j|)}(h``os_desc_req``h]j)}(hj `h]h os_desc_req}(hj"`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj`ubj)}(hhh]h)}(h:used for OS descriptors responses; buffer is pre-allocatedh]h:used for OS descriptors responses; buffer is pre-allocated}(hj9`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5`hMhj6`ubah}(h]h ]h"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]uh1juhj5`hMhj_ubjv)}(h.``config`` the currently active configuration h](j|)}(h ``config``h]j)}(hjY`h]hconfig}(hj[`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW`ubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjS`ubj)}(hhh]h)}(h"the currently active configurationh]h"the currently active configuration}(hjr`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjn`hMhjo`ubah}(h]h ]h"]h$]h&]uh1jhjS`ubeh}(h]h ]h"]h$]h&]uh1juhjn`hMhj_ubjv)}(h.``qw_sign`` qwSignature part of the OS string h](j|)}(h ``qw_sign``h]j)}(hj`h]hqw_sign}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj`ubj)}(hhh]h)}(h!qwSignature part of the OS stringh]h!qwSignature part of the OS string}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj`hMhj`ubah}(h]h ]h"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]uh1juhj`hMhj_ubjv)}(h7``b_vendor_code`` bMS_VendorCode part of the OS string h](j|)}(h``b_vendor_code``h]j)}(hj`h]h b_vendor_code}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj`ubj)}(hhh]h)}(h$bMS_VendorCode part of the OS stringh]h$bMS_VendorCode part of the OS string}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj`hMhj`ubah}(h]h ]h"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]uh1juhj`hMhj_ubjv)}(hD``os_desc_config`` the configuration to be used with OS descriptors h](j|)}(h``os_desc_config``h]j)}(hjah]hos_desc_config}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj`ubj)}(hhh]h)}(h0the configuration to be used with OS descriptorsh]h0the configuration to be used with OS descriptors}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahMhjaubah}(h]h ]h"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]uh1juhjahMhj_ubjv)}(h>``use_os_string`` false by default, interested gadgets set it h](j|)}(h``use_os_string``h]j)}(hj=ah]h use_os_string}(hj?ahhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;aubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhj7aubj)}(hhh]h)}(h+false by default, interested gadgets set ith]h+false by default, interested gadgets set it}(hjVahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRahMhjSaubah}(h]h ]h"]h$]h&]uh1jhj7aubeh}(h]h ]h"]h$]h&]uh1juhjRahMhj_ubjv)}(hG``bcd_webusb_version`` 0x0100 by default, WebUSB specification version h](j|)}(h``bcd_webusb_version``h]j)}(hjvah]hbcd_webusb_version}(hjxahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjtaubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjpaubj)}(hhh]h)}(h/0x0100 by default, WebUSB specification versionh]h/0x0100 by default, WebUSB specification version}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahMhjaubah}(h]h ]h"]h$]h&]uh1jhjpaubeh}(h]h ]h"]h$]h&]uh1juhjahMhj_ubjv)}(h@``b_webusb_vendor_code`` 0x0 by default, vendor code for WebUSB h](j|)}(h``b_webusb_vendor_code``h]j)}(hjah]hb_webusb_vendor_code}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjaubj)}(hhh]h)}(h&0x0 by default, vendor code for WebUSBh]h&0x0 by default, vendor code for WebUSB}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahMhjaubah}(h]h ]h"]h$]h&]uh1jhjaubeh}(h]h ]h"]h$]h&]uh1juhjahMhj_ubjv)}(hF``landing_page`` empty by default, landing page to announce in WebUSB h](j|)}(h``landing_page``h]j)}(hjah]h landing_page}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjaubj)}(hhh]h)}(h4empty by default, landing page to announce in WebUSBh]h4empty by default, landing page to announce in WebUSB}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahMhjaubah}(h]h ]h"]h$]h&]uh1jhjaubeh}(h]h ]h"]h$]h&]uh1juhjahMhj_ubjv)}(h;``use_webusb`` false by default, interested gadgets set it h](j|)}(h``use_webusb``h]j)}(hj!bh]h use_webusb}(hj#bhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]uh1j{hd/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}(hj:bhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6bhMhj7bubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1juhj6bhMhj_ubjv)}(hF``setup_pending`` true when setup request is queued but not completed h](j|)}(h``setup_pending``h]j)}(hjZbh]h setup_pending}(hj\bhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXbubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjTbubj)}(hhh]h)}(h3true when setup request is queued but not completedh]h3true when setup request is queued but not completed}(hjsbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjobhMhjpbubah}(h]h ]h"]h$]h&]uh1jhjTbubeh}(h]h ]h"]h$]h&]uh1juhjobhMhj_ubjv)}(hI``os_desc_pending`` true when os_desc request is queued but not completedh](j|)}(h``os_desc_pending``h]j)}(hjbh]hos_desc_pending}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]uh1j{hd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjbubj)}(hhh]h)}(h5true when os_desc request is queued but not completedh]h5true when os_desc request is queued but not completed}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjbubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1juhjbhMhj_ubeh}(h]h ]h"]h$]h&]uh1jphj]_ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhjHhNubh)}(h**Description**h]j< )}(hjbh]h Description}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjbubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjEHhhubh)}(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.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:349: ./include/linux/usb/composite.hhMhjEHhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j'config_ep_by_speed_and_alt (C function)c.config_ep_by_speed_and_althNtauh1jhjEHhhhNhNubj)}(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}(hjchhhNhNubah}(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 }(hj#chhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjchhhj"chKubj)}(hconfig_ep_by_speed_and_alth]j)}(hconfig_ep_by_speed_and_alth]hconfig_ep_by_speed_and_alt}(hj5chhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj1cubah}(h]h ](jjeh"]h$]h&]jjuh1jhjchhhj"chKubj)}(hJ(struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep, u8 alt)h](j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hjQchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMcubj)}(h h]h }(hj^chhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMcubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hjochhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjlcubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjqcmodnameN classnameNjj)}j]j)}jj7csbc.config_ep_by_speed_and_altasbuh1hhjMcubj)}(h h]h }(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMcubj)}(hjh]h*}(hjchhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjMcubj)}(hjm!h]hg}(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMcubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjIcubj)}(hstruct usb_function *fh](j)}(hjh]hstruct}(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubj)}(h h]h }(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubh)}(hhh]j)}(h usb_functionh]h usb_function}(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjcmodnameN classnameNjj)}j]jcc.config_ep_by_speed_and_altasbuh1hhjcubj)}(h h]h }(hjchhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubj)}(hjh]h*}(hj dhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjcubj)}(hfh]hf}(hjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjcubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjIcubj)}(hstruct usb_ep *_eph](j)}(hjh]hstruct}(hj2dhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.dubj)}(h h]h }(hj?dhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.dubh)}(hhh]j)}(husb_eph]husb_ep}(hjPdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMdubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjRdmodnameN classnameNjj)}j]jcc.config_ep_by_speed_and_altasbuh1hhj.dubj)}(h h]h }(hjndhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.dubj)}(hjh]h*}(hj|dhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj.dubj)}(h_eph]h_ep}(hjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.dubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjIcubj)}(hu8 alth](h)}(hhh]j)}(hu8h]hu8}(hjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjdmodnameN classnameNjj)}j]jcc.config_ep_by_speed_and_altasbuh1hhjdubj)}(h h]h }(hjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubj)}(halth]halt}(hjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjIcubeh}(h]h ]h"]h$]h&]jjuh1jhjchhhj"chKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj chhhj"chKubah}(h]jcah ](j j eh"]h$]h&]j j )j huh1jhj"chKhj chhubj )}(hhh]h)}(h8configures the given endpoint according to gadget speed.h]h8configures the given endpoint according to gadget speed.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjdhhubah}(h]h ]h"]h$]h&]uh1j hj chhhj"chKubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jej- jej. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjeh]h Parameters}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjeubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubjq)}(hhh](jv)}(h/``struct usb_gadget *g`` pointer to the gadget h](j|)}(h``struct usb_gadget *g``h]j)}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:eubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhj6eubj)}(hhh]h)}(hpointer to the gadgeth]hpointer to the gadget}(hjUehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQehKhjReubah}(h]h ]h"]h$]h&]uh1jhj6eubeh}(h]h ]h"]h$]h&]uh1juhjQehKhj3eubjv)}(h(``struct usb_function *f`` usb function h](j|)}(h``struct usb_function *f``h]j)}(hjueh]hstruct usb_function *f}(hjwehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjseubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjoeubj)}(hhh]h)}(h usb functionh]h usb function}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehKhjeubah}(h]h ]h"]h$]h&]uh1jhjoeubeh}(h]h ]h"]h$]h&]uh1juhjehKhj3eubjv)}(h1``struct usb_ep *_ep`` the endpoint to configure h](j|)}(h``struct usb_ep *_ep``h]j)}(hjeh]hstruct usb_ep *_ep}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubj)}(hhh]h)}(hthe endpoint to configureh]hthe endpoint to configure}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehKhjeubah}(h]h ]h"]h$]h&]uh1jhjeubeh}(h]h ]h"]h$]h&]uh1juhjehKhj3eubjv)}(h$``u8 alt`` alternate setting number h](j|)}(h ``u8 alt``h]j)}(hjeh]hu8 alt}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chKhjeubj)}(hhh]h)}(halternate setting numberh]halternate setting number}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehKhjeubah}(h]h ]h"]h$]h&]uh1jhjeubeh}(h]h ]h"]h$]h&]uh1juhjehKhj3eubeh}(h]h ]h"]h$]h&]uh1jphjeubh)}(h **Return**h]j< )}(hj"fh]hReturn}(hj$fhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj fubah}(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}(hj8fhhhNhNubah}(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]j< )}(hjIfh]h Description}(hjKfhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjGfubah}(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.}(hj_fhhhNhNubah}(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]j< )}(hjpfh]hNote}(hjrfhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjnfubah}(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}(hjfhhhNhNubah}(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&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jconfig_ep_by_speed (C function)c.config_ep_by_speedhNtauh1jhjEHhhhNhNubj)}(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}(hjfhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjfhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM ubj)}(h h]h }(hjfhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfhhhjfhM ubj)}(hconfig_ep_by_speedh]j)}(hconfig_ep_by_speedh]hconfig_ep_by_speed}(hjfhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfubah}(h]h ](jjeh"]h$]h&]jjuh1jhjfhhhjfhM ubj)}(hB(struct usb_gadget *g, struct usb_function *f, struct usb_ep *_ep)h](j)}(hstruct usb_gadget *gh](j)}(hjh]hstruct}(hjfhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfubj)}(h h]h }(hjfhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfubh)}(hhh]j)}(h usb_gadgeth]h usb_gadget}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj gubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjgmodnameN classnameNjj)}j]j)}jjfsbc.config_ep_by_speedasbuh1hhjfubj)}(h h]h }(hj0ghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfubj)}(hjh]h*}(hj>ghhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjfubj)}(hjm!h]hg}(hjKghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjfubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjfubj)}(hstruct usb_function *fh](j)}(hjh]hstruct}(hjcghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_gubj)}(h h]h }(hjpghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_gubh)}(hhh]j)}(h usb_functionh]h usb_function}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~gubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjgmodnameN classnameNjj)}j]j,gc.config_ep_by_speedasbuh1hhj_gubj)}(h h]h }(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_gubj)}(hjh]h*}(hjghhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj_gubj)}(hjdh]hf}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_gubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjfubj)}(hstruct usb_ep *_eph](j)}(hjh]hstruct}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubj)}(h h]h }(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubh)}(hhh]j)}(husb_eph]husb_ep}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjgmodnameN classnameNjj)}j]j,gc.config_ep_by_speedasbuh1hhjgubj)}(h h]h }(hjhhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubj)}(hjh]h*}(hjhhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjgubj)}(h_eph]h_ep}(hj)hhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjgubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjfubeh}(h]h ]h"]h$]h&]jjuh1jhjfhhhjfhM ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjfhhhjfhM ubah}(h]jfah ](j j eh"]h$]h&]j j )j huh1jhjfhM hjfhhubj )}(hhh]h)}(h8configures the given endpoint according to gadget speed.h]h8configures the given endpoint according to gadget speed.}(hjShhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjPhhhubah}(h]h ]h"]h$]h&]uh1j hjfhhhjfhM ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jkhj- jkhj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjuhh]h Parameters}(hjwhhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjshubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubjq)}(hhh](jv)}(h/``struct usb_gadget *g`` pointer to the gadget h](j|)}(h``struct usb_gadget *g``h]j)}(hjhh]hstruct usb_gadget *g}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubj)}(hhh]h)}(hpointer to the gadgeth]hpointer to the gadget}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhMhjhubah}(h]h ]h"]h$]h&]uh1jhjhubeh}(h]h ]h"]h$]h&]uh1juhjhhMhjhubjv)}(h(``struct usb_function *f`` usb function h](j|)}(h``struct usb_function *f``h]j)}(hjhh]hstruct usb_function *f}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjhubj)}(hhh]h)}(h usb functionh]h usb function}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhMhjhubah}(h]h ]h"]h$]h&]uh1jhjhubeh}(h]h ]h"]h$]h&]uh1juhjhhMhjhubjv)}(h1``struct usb_ep *_ep`` the endpoint to configure h](j|)}(h``struct usb_ep *_ep``h]j)}(hjih]hstruct usb_ep *_ep}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjiubah}(h]h ]h"]h$]h&]uh1j{he/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}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihMhjiubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1juhjihMhjhubeh}(h]h ]h"]h$]h&]uh1jphjohubh)}(h **Return**h]j< )}(hjAih]hReturn}(hjCihhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj?iubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubh)}(herror code, 0 on successh]herror code, 0 on success}(hjWihhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubh)}(h**Description**h]j< )}(hjhih]h Description}(hjjihhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjfiubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubh)}(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.}(hj~ihhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubh)}(h**Note**h]j< )}(hjih]hNote}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjiubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubh)}(hJthe supplied function should hold all the descriptors for supported speedsh]hJthe supplied function should hold all the descriptors for supported speeds}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjohubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_add_function (C function)c.usb_add_functionhNtauh1jhjEHhhhNhNubj)}(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}(hjihhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjihhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM6ubj)}(h h]h }(hjihhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjihhhjihM6ubj)}(husb_add_functionh]j)}(husb_add_functionh]husb_add_function}(hjihhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjiubah}(h]h ](jjeh"]h$]h&]jjuh1jhjihhhjihM6ubj)}(hA(struct usb_configuration *config, struct usb_function *function)h](j)}(h struct usb_configuration *configh](j)}(hjh]hstruct}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj jubj)}(h h]h }(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj jubh)}(hhh]j)}(husb_configurationh]husb_configuration}(hj/jhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,jubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj1jmodnameN classnameNjj)}j]j)}jjisbc.usb_add_functionasbuh1hhj jubj)}(h h]h }(hjOjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj jubj)}(hjh]h*}(hj]jhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj jubj)}(hconfigh]hconfig}(hjjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj jubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj jubj)}(hstruct usb_function *functionh](j)}(hjh]hstruct}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubj)}(h h]h }(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubh)}(hhh]j)}(h usb_functionh]h usb_function}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjjmodnameN classnameNjj)}j]jKjc.usb_add_functionasbuh1hhjjubj)}(h h]h }(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubj)}(hjh]h*}(hjjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjjubj)}(hfunctionh]hfunction}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj jubeh}(h]h ]h"]h$]h&]jjuh1jhjihhhjihM6ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjihhhjihM6ubah}(h]jiah ](j j eh"]h$]h&]j j )j huh1jhjihM6hjihhubj )}(hhh]h)}(h!add a function to a configurationh]h!add a function to a configuration}(hjkhhhNhNubah}(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&]uh1j hjihhhjihM6ubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jkj- jkj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hj&kh]h Parameters}(hj(khhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj$kubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM-hj kubjq)}(hhh](jv)}(h7``struct usb_configuration *config`` the configuration h](j|)}(h$``struct usb_configuration *config``h]j)}(hjEkh]h struct usb_configuration *config}(hjGkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCkubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM*hj?kubj)}(hhh]h)}(hthe configurationh]hthe configuration}(hj^khhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZkhM*hj[kubah}(h]h ]h"]h$]h&]uh1jhj?kubeh}(h]h ]h"]h$]h&]uh1juhjZkhM*hjlhhhjTlhMubah}(h]j9lah ](j j eh"]h$]h&]j j )j huh1jhjTlhMhj;lhhubj )}(hhh]h)}(h'prevent function and gadget enumerationh]h'prevent function and gadget enumeration}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM{hjmhhubah}(h]h ]h"]h$]h&]uh1j hj;lhhhjTlhMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jmj- jmj. j/ j0 uh1jhhhjEHhNhNubj2 )}(hX**Parameters** ``struct usb_function *function`` the function that isn't yet ready to respond **Description** Blocks response of the gadget driver to host enumeration by preventing the data line pullup from being activated. This is normally called during **bind\(\)** processing to change from the initial "ready to respond" state, or when a required resource becomes available. For example, drivers that serve as a passthrough to a userspace daemon can block enumeration unless that daemon (such as an OBEX, MTP, or print server) is ready to handle host requests. Not all systems support software control of their USB peripheral data pullups. Returns zero on success, else negative errno.h](h)}(h**Parameters**h]j< )}(hj(mh]h Parameters}(hj*mhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj&mubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj"mubjq)}(hhh]jv)}(hO``struct usb_function *function`` the function that isn't yet ready to respond h](j|)}(h!``struct usb_function *function``h]j)}(hjGmh]hstruct usb_function *function}(hjImhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjEmubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM|hjAmubj)}(hhh]h)}(h,the function that isn't yet ready to respondh]h.the function that isn’t yet ready to respond}(hj`mhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj\mhM|hj]mubah}(h]h ]h"]h$]h&]uh1jhjAmubeh}(h]h ]h"]h$]h&]uh1juhj\mhM|hj>mubah}(h]h ]h"]h$]h&]uh1jphj"mubh)}(h**Description**h]j< )}(hjmh]h Description}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjmubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM~hj"mubh)}(hX Blocks response of the gadget driver to host enumeration by preventing the data line pullup from being activated. This is normally called during **bind\(\)** processing to change from the initial "ready to respond" state, or when a required resource becomes available.h](hBlocks response of the gadget driver to host enumeration by preventing the data line pullup from being activated. This is normally called during }(hjmhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjmubhs processing to change from the initial “ready to respond” state, or when a required resource becomes available.}(hjmhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM~hj"mubh)}(hFor example, drivers that serve as a passthrough to a userspace daemon can block enumeration unless that daemon (such as an OBEX, MTP, or print server) is ready to handle host requests.h]hFor example, drivers that serve as a passthrough to a userspace daemon can block enumeration unless that daemon (such as an OBEX, MTP, or print server) is ready to handle host requests.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj"mubh)}(hNNot all systems support software control of their USB peripheral data pullups.h]hNNot all systems support software control of their USB peripheral data pullups.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj"mubh)}(h-Returns zero on success, else negative errno.h]h-Returns zero on success, else negative errno.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj"mubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"usb_function_activate (C function)c.usb_function_activatehNtauh1jhjEHhhhNhNubj)}(hhh](j)}(h9int usb_function_activate (struct usb_function *function)h]j)}(h8int usb_function_activate(struct usb_function *function)h](j#)}(hinth]hint}(hjnhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjnhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hjnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnhhhjnhMubj)}(husb_function_activateh]j)}(husb_function_activateh]husb_function_activate}(hj'nhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#nubah}(h]h ](jjeh"]h$]h&]jjuh1jhjnhhhjnhMubj)}(h(struct usb_function *function)h]j)}(hstruct usb_function *functionh](j)}(hjh]hstruct}(hjCnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?nubj)}(h h]h }(hjPnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?nubh)}(hhh]j)}(h usb_functionh]h usb_function}(hjanhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj^nubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjcnmodnameN classnameNjj)}j]j)}jj)nsbc.usb_function_activateasbuh1hhj?nubj)}(h h]h }(hjnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?nubj)}(hjh]h*}(hjnhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj?nubj)}(hfunctionh]hfunction}(hjnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj?nubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj;nubah}(h]h ]h"]h$]h&]jjuh1jhjnhhhjnhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjmhhhjnhMubah}(h]jmah ](j j eh"]h$]h&]j j )j huh1jhjnhMhjmhhubj )}(hhh]h)}(h%allow function and gadget enumerationh]h%allow function and gadget enumeration}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnhhubah}(h]h ]h"]h$]h&]uh1j hjmhhhjnhMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jnj- jnj. j/ j0 uh1jhhhjEHhNhNubj2 )}(hXK**Parameters** ``struct usb_function *function`` function on which usb_function_activate() was called **Description** Reverses effect of usb_function_deactivate(). If no more functions are delaying their activation, the gadget driver will respond to host enumeration procedures. Returns zero on success, else negative errno.h](h)}(h**Parameters**h]j< )}(hjnh]h Parameters}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjnubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnubjq)}(hhh]jv)}(hW``struct usb_function *function`` function on which usb_function_activate() was called h](j|)}(h!``struct usb_function *function``h]j)}(hjoh]hstruct usb_function *function}(hj ohhhNhNubah}(h]h ]h"]h$]h&]uh1jhjoubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjoubj)}(hhh]h)}(h4function on which usb_function_activate() was calledh]h4function on which usb_function_activate() was called}(hj ohhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohMhjoubah}(h]h ]h"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]uh1juhjohMhjnubah}(h]h ]h"]h$]h&]uh1jphjnubh)}(h**Description**h]j< )}(hjBoh]h Description}(hjDohhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj@oubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnubh)}(hReverses effect of usb_function_deactivate(). If no more functions are delaying their activation, the gadget driver will respond to host enumeration procedures.h]hReverses effect of usb_function_deactivate(). If no more functions are delaying their activation, the gadget driver will respond to host enumeration procedures.}(hjXohhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnubh)}(h-Returns zero on success, else negative errno.h]h-Returns zero on success, else negative errno.}(hjgohhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjnubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_interface_id (C function)c.usb_interface_idhNtauh1jhjEHhhhNhNubj)}(hhh](j)}(hVint usb_interface_id (struct usb_configuration *config, struct usb_function *function)h]j)}(hUint usb_interface_id(struct usb_configuration *config, struct usb_function *function)h](j#)}(hinth]hint}(hjohhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjohhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hjohhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjohhhjohMubj)}(husb_interface_idh]j)}(husb_interface_idh]husb_interface_id}(hjohhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubah}(h]h ](jjeh"]h$]h&]jjuh1jhjohhhjohMubj)}(hA(struct usb_configuration *config, struct usb_function *function)h](j)}(h struct usb_configuration *configh](j)}(hjh]hstruct}(hjohhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubj)}(h h]h }(hjohhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubh)}(hhh]j)}(husb_configurationh]husb_configuration}(hjohhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjomodnameN classnameNjj)}j]j)}jjosbc.usb_interface_idasbuh1hhjoubj)}(h h]h }(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubj)}(hjh]h*}(hjphhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjoubj)}(hconfigh]hconfig}(hj,phhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjoubj)}(hstruct usb_function *functionh](j)}(hjh]hstruct}(hjEphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjApubj)}(h h]h }(hjRphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjApubh)}(hhh]j)}(h usb_functionh]h usb_function}(hjcphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj`pubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjepmodnameN classnameNjj)}j]j pc.usb_interface_idasbuh1hhjApubj)}(h h]h }(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjApubj)}(hjh]h*}(hjphhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjApubj)}(hfunctionh]hfunction}(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjApubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjoubeh}(h]h ]h"]h$]h&]jjuh1jhjohhhjohMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjohhhjohMubah}(h]joah ](j j eh"]h$]h&]j j )j huh1jhjohMhjohhubj )}(hhh]h)}(hallocate an unused interface IDh]hallocate an unused interface ID}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjphhubah}(h]h ]h"]h$]h&]uh1j hjohhhjohMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jpj- jpj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjph]h Parameters}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjpubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubjq)}(hhh](jv)}(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}(hj qhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubah}(h]h ]h"]h$]h&]uh1j{he/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}(hj qhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqhMhjqubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1juhjqhMhjpubjv)}(hB``struct usb_function *function`` function handling the interface h](j|)}(h!``struct usb_function *function``h]j)}(hj@qh]hstruct usb_function *function}(hjBqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>qubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.cPhMhj:qubj)}(hhh]h)}(hfunction handling the interfaceh]hfunction handling the interface}(hjYqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUqhMhjVqubah}(h]h ]h"]h$]h&]uh1jhj:qubeh}(h]h ]h"]h$]h&]uh1juhjUqhMhjpubeh}(h]h ]h"]h$]h&]uh1jphjpubh)}(h **Context**h]j< )}(hj{qh]hContext}(hj}qhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjyqubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubh)}(h**Description**h]j< )}(hjqh]h Description}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjqubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubh)}(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.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubh)}(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.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubh)}(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.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjpubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_func_wakeup (C function)c.usb_func_wakeuphNtauh1jhjEHhhhNhNubj)}(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}(hjrhhhNhNubah}(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 }(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjrhhhjrhMubj)}(husb_func_wakeuph]j)}(husb_func_wakeuph]husb_func_wakeup}(hj&rhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"rubah}(h]h ](jjeh"]h$]h&]jjuh1jhjrhhhjrhMubj)}(h(struct usb_function *func)h]j)}(hstruct usb_function *funch](j)}(hjh]hstruct}(hjBrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>rubj)}(h h]h }(hjOrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>rubh)}(hhh]j)}(h usb_functionh]h usb_function}(hj`rhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj]rubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjbrmodnameN classnameNjj)}j]j)}jj(rsbc.usb_func_wakeupasbuh1hhj>rubj)}(h h]h }(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>rubj)}(hjh]h*}(hjrhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj>rubj)}(hfunch]hfunc}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>rubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj:rubah}(h]h ]h"]h$]h&]jjuh1jhjrhhhjrhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjqhhhjrhMubah}(h]jqah ](j j eh"]h$]h&]j j )j huh1jhjrhMhjqhhubj )}(hhh]h)}(h-sends function wake notification to the host.h]h-sends function wake notification to the host.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjrhhubah}(h]h ]h"]h$]h&]uh1j hjqhhhjrhMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jrj- jrj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjrh]h Parameters}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjrubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjrubjq)}(hhh]jv)}(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}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhjsubah}(h]h ]h"]h$]h&]uh1j{he/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.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjshMhjsubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1juhjshMhjrubah}(h]h ]h"]h$]h&]uh1jphjrubh)}(h**Description**h]j< )}(hjAsh]h Description}(hjCshhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj?subah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjrubh)}(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.}(hjWshhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjrubh)}(h-Returns zero on success, else negative errno.h]h-Returns zero on success, else negative errno.}(hjfshhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjrubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_add_config (C function)c.usb_add_confighNtauh1jhjEHhhhNhNubj)}(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}(hjshhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjshhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMQubj)}(h h]h }(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjshhhjshMQubj)}(husb_add_configh]j)}(husb_add_configh]husb_add_config}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubah}(h]h ](jjeh"]h$]h&]jjuh1jhjshhhjshMQubj)}(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}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubj)}(h h]h }(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubh)}(hhh]j)}(husb_composite_devh]husb_composite_dev}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjsmodnameN classnameNjj)}j]j)}jjssbc.usb_add_configasbuh1hhjsubj)}(h h]h }(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubj)}(hjh]h*}(hjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjsubj)}(hcdevh]hcdev}(hj+thhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjsubj)}(h struct usb_configuration *configh](j)}(hjh]hstruct}(hjDthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@tubj)}(h h]h }(hjQthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@tubh)}(hhh]j)}(husb_configurationh]husb_configuration}(hjbthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj_tubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjdtmodnameN classnameNjj)}j]j tc.usb_add_configasbuh1hhj@tubj)}(h h]h }(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@tubj)}(hjh]h*}(hjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj@tubj)}(hconfigh]hconfig}(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@tubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjsubj)}(h&int (*bind)(struct usb_configuration*)h](j#)}(hinth]hint}(hjthhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjtubj)}(h h]h }(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubj)}(h(h]h(}(hjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjtubj)}(hjh]h*}(hjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjtubj)}(hbindh]hbind}(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubj)}(h)h]h)}(hjthhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjtubj)}(hjth]h(}(hjuhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjtubj)}(hjh]hstruct}(hjuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubj)}(h h]h }(hj!uhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjtubh)}(hhh]j)}(husb_configurationh]husb_configuration}(hj2uhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj/uubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj4umodnameN classnameNjj)}j]j tc.usb_add_configasbuh1hhjtubj)}(hjh]h*}(hjPuhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjtubj)}(hjth]h)}(hj]uhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjsubeh}(h]h ]h"]h$]h&]jjuh1jhjshhhjshMQubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjshhhjshMQubah}(h]jsah ](j j eh"]h$]h&]j j )j huh1jhjshMQhjshhubj )}(hhh]h)}(h add a configuration to a device.h]h add a configuration to a device.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMChjuhhubah}(h]h ]h"]h$]h&]uh1j hjshhhjshMQubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, juj- juj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjuh]h Parameters}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjuubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMGhjuubjq)}(hhh](jv)}(h8``struct usb_composite_dev *cdev`` wraps the USB gadget h](j|)}(h"``struct usb_composite_dev *cdev``h]j)}(hjuh]hstruct usb_composite_dev *cdev}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMDhjuubj)}(hhh]h)}(hwraps the USB gadgeth]hwraps the USB gadget}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuhMDhjuubah}(h]h ]h"]h$]h&]uh1jhjuubeh}(h]h ]h"]h$]h&]uh1juhjuhMDhjuubjv)}(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}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMEhjuubj)}(hhh]h)}(h4the configuration, with bConfigurationValue assignedh]h4the configuration, with bConfigurationValue assigned}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjvhMEhjvubah}(h]h ]h"]h$]h&]uh1jhjuubeh}(h]h ]h"]h$]h&]uh1juhjvhMEhjuubjv)}(hN``int (*bind)(struct usb_configuration *)`` the configuration's bind function h](j|)}(h+``int (*bind)(struct usb_configuration *)``h]j)}(hj9vh]h'int (*bind)(struct usb_configuration *)}(hj;vhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7vubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMFhj3vubj)}(hhh]h)}(h!the configuration's bind functionh]h#the configuration’s bind function}(hjRvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNvhMFhjOvubah}(h]h ]h"]h$]h&]uh1jhj3vubeh}(h]h ]h"]h$]h&]uh1juhjNvhMFhjuubeh}(h]h ]h"]h$]h&]uh1jphjuubh)}(h **Context**h]j< )}(hjtvh]hContext}(hjvvhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjrvubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMHhjuubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMGhjuubh)}(h**Description**h]j< )}(hjvh]h Description}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjvubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMIhjuubh)}(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 }(hjvhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjvubhN routine is to add each of the configurations it supports, using this routine.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMHhjuubh)}(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 }(hjvhhhNhNubj< )}(h **bind\(\)**h]hbind()}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjvubh, 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.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMKhjuubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string_id (C function)c.usb_string_idhNtauh1jhjEHhhhNhNubj)}(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}(hjwhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjwhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhubj)}(h h]h }(hj"whhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjwhhhj!whMhubj)}(h usb_string_idh]j)}(h usb_string_idh]h usb_string_id}(hj4whhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0wubah}(h]h ](jjeh"]h$]h&]jjuh1jhjwhhhj!whMhubj)}(h (struct usb_composite_dev *cdev)h]j)}(hstruct usb_composite_dev *cdevh](j)}(hjh]hstruct}(hjPwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjLwubj)}(h h]h }(hj]whhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjLwubh)}(hhh]j)}(husb_composite_devh]husb_composite_dev}(hjnwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjkwubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjpwmodnameN classnameNjj)}j]j)}jj6wsbc.usb_string_idasbuh1hhjLwubj)}(h h]h }(hjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjLwubj)}(hjh]h*}(hjwhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjLwubj)}(hcdevh]hcdev}(hjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjLwubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjHwubah}(h]h ]h"]h$]h&]jjuh1jhjwhhhj!whMhubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj whhhj!whMhubah}(h]jwah ](j j eh"]h$]h&]j j )j huh1jhj!whMhhjwhhubj )}(hhh]h)}(hallocate an unused string IDh]hallocate an unused string ID}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM[hjwhhubah}(h]h ]h"]h$]h&]uh1j hjwhhhj!whMhubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jwj- jwj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjwh]h Parameters}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjwubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM_hjwubjq)}(hhh]jv)}(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}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1j{he/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}(hj-xhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)xhM\hj*xubah}(h]h ]h"]h$]h&]uh1jhjxubeh}(h]h ]h"]h$]h&]uh1juhj)xhM\hj xubah}(h]h ]h"]h$]h&]uh1jphjwubh)}(h **Context**h]j< )}(hjOxh]hContext}(hjQxhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjMxubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM^hjwubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjexhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM]hjwubh)}(h**Description**h]j< )}(hjvxh]h Description}(hjxxhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjtxubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM_hjwubh)}(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](j< )}(h**usb_string_id\(\)**h]husb_string_id()}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjxubh 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.}(hjxhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM^hjwubh)}(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, }(hjxhhhNhNubj< )}(h**usb_string_ids_tab\(\)**h]husb_string_ids_tab()}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjxubh or }(hjxhhhNhNubj< )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjxubhz routine, to ensure that for example different functions don’t wrongly assign different meanings to the same identifier.}(hjxhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMbhjwubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string_ids_tab (C function)c.usb_string_ids_tabhNtauh1jhjEHhhhNhNubj)}(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}(hjxhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjxhhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hj yhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxhhhj yhMubj)}(husb_string_ids_tabh]j)}(husb_string_ids_tabh]husb_string_ids_tab}(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubah}(h]h ](jjeh"]h$]h&]jjuh1jhjxhhhj yhMubj)}(h8(struct usb_composite_dev *cdev, struct usb_string *str)h](j)}(hstruct usb_composite_dev *cdevh](j)}(hjh]hstruct}(hj9yhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5yubj)}(h h]h }(hjFyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5yubh)}(hhh]j)}(husb_composite_devh]husb_composite_dev}(hjWyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjTyubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjYymodnameN classnameNjj)}j]j)}jjysbc.usb_string_ids_tabasbuh1hhj5yubj)}(h h]h }(hjwyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5yubj)}(hjh]h*}(hjyhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj5yubj)}(hcdevh]hcdev}(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5yubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj1yubj)}(hstruct usb_string *strh](j)}(hjh]hstruct}(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubj)}(h h]h }(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubh)}(hhh]j)}(h usb_stringh]h usb_string}(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjymodnameN classnameNjj)}j]jsyc.usb_string_ids_tabasbuh1hhjyubj)}(h h]h }(hjyhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubj)}(hjh]h*}(hjyhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjyubj)}(hstrh]hstr}(hjzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjyubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj1yubeh}(h]h ]h"]h$]h&]jjuh1jhjxhhhj yhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjxhhhj yhMubah}(h]jxah ](j j eh"]h$]h&]j j )j huh1jhj yhMhjxhhubj )}(hhh]h)}(h#allocate unused string IDs in batchh]h#allocate unused string IDs in batch}(hj,zhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMvhj)zhhubah}(h]h ]h"]h$]h&]uh1j hjxhhhj yhMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jDzj- jDzj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjNzh]h Parameters}(hjPzhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjLzubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMzhjHzubjq)}(hhh](jv)}(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)}(hjmzh]hstruct usb_composite_dev *cdev}(hjozhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjkzubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMwhjgzubj)}(hhh]h)}(h:the device whose string descriptor IDs are being allocatedh]h:the device whose string descriptor IDs are being allocated}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhMwhjzubah}(h]h ]h"]h$]h&]uh1jhjgzubeh}(h]h ]h"]h$]h&]uh1juhjzhMwhjdzubjv)}(hO``struct usb_string *str`` an array of usb_string objects to assign numbers to h](j|)}(h``struct usb_string *str``h]j)}(hjzh]hstruct usb_string *str}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjzubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMxhjzubj)}(hhh]h)}(h3an array of usb_string objects to assign numbers toh]h3an array of usb_string objects to assign numbers to}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhMxhjzubah}(h]h ]h"]h$]h&]uh1jhjzubeh}(h]h ]h"]h$]h&]uh1juhjzhMxhjdzubeh}(h]h ]h"]h$]h&]uh1jphjHzubh)}(h **Context**h]j< )}(hjzh]hContext}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjzubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMzhjHzubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMyhjHzubh)}(h**Description**h]j< )}(hj{h]h Description}(hj {hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj{ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM{hjHzubh)}(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](j< )}(h**usb_string_ids\(\)**h]husb_string_ids()}(hj"{hhhNhNubah}(h]h ]h"]h$]h&]uh1j; 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.}(hj{hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMzhjHzubh)}(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, }(hj;{hhhNhNubj< )}(h**usb_string_id\(\)**h]husb_string_id()}(hjC{hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj;{ubh or }(hj;{hhhNhNubj< )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hjU{hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj;{ubhz 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.chMhjHzubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j usb_gstrings_attach (C function)c.usb_gstrings_attachhNtauh1jhjEHhhhNhNubj)}(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}(hj{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 }(hj{hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{hhhj{hMubh)}(hhh]j)}(h usb_stringh]h usb_string}(hj{hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj{modnameN classnameNjj)}j]j)}jusb_gstrings_attachsbc.usb_gstrings_attachasbuh1hhj{hhhj{hMubj)}(h h]h }(hj{hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{hhhj{hMubj)}(hjh]h*}(hj{hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj{hhhj{hMubj)}(husb_gstrings_attachh]j)}(hj{h]husb_gstrings_attach}(hj{hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj{hhhj{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}(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubj)}(h h]h }(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubh)}(hhh]j)}(husb_composite_devh]husb_composite_dev}(hj&|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#|ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj(|modnameN classnameNjj)}j]j{c.usb_gstrings_attachasbuh1hhj|ubj)}(h h]h }(hjD|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubj)}(hjh]h*}(hjR|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj|ubj)}(hcdevh]hcdev}(hj_|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj|ubj)}(hstruct usb_gadget_strings **sph](j)}(hjh]hstruct}(hjx|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt|ubj)}(h h]h }(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt|ubh)}(hhh]j)}(husb_gadget_stringsh]husb_gadget_strings}(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj|modnameN classnameNjj)}j]j{c.usb_gstrings_attachasbuh1hhjt|ubj)}(h h]h }(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt|ubj)}(hjh]h*}(hj|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjt|ubj)}(hjh]h*}(hj|hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjt|ubj)}(hsph]hsp}(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjt|ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj|ubj)}(hunsigned n_stringsh](j#)}(hunsignedh]hunsigned}(hj|hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hj|ubj)}(h h]h }(hj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubj)}(h n_stringsh]h n_strings}(hj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj|ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj|ubeh}(h]h ]h"]h$]h&]jjuh1jhj{hhhj{hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj{hhhj{hMubah}(h]j{ah ](j j eh"]h$]h&]j j )j huh1jhj{hMhj{hhubj )}(hhh]h)}(h.attach gadget strings to a cdev and assign idsh]h.attach gadget strings to a cdev and assign ids}(hj;}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj8}hhubah}(h]h ]h"]h$]h&]uh1j hj{hhhj{hMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jS}j- jS}j. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hj]}h]h Parameters}(hj_}hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj[}ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjW}ubjq)}(hhh](jv)}(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}(hj~}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjz}ubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjv}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.}(hj}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&]uh1jhjv}ubeh}(h]h ]h"]h$]h&]uh1juhj}hMhjs}ubjv)}(hM``struct usb_gadget_strings **sp`` an array of usb_gadget_strings to attach. h](j|)}(h"``struct usb_gadget_strings **sp``h]j)}(hj}h]hstruct usb_gadget_strings **sp}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj}ubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj}ubj)}(hhh]h)}(h)an array of usb_gadget_strings to attach.h]h)an array of usb_gadget_strings to attach.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj}hMhj}ubah}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1juhj}hMhjs}ubjv)}(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}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj}ubah}(h]h ]h"]h$]h&]uh1j{he/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~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~hMhj~ubah}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1juhj~hMhjs}ubeh}(h]h ]h"]h$]h&]uh1jphjW}ubh)}(h**Description**h]j< )}(hj*~h]h Description}(hj,~hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj(~ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjW}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@~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjW}ubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jusb_string_ids_n (C function)c.usb_string_ids_nhNtauh1jhjEHhhhNhNubj)}(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}(hjo~hhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjk~hhhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMubj)}(h h]h }(hj~~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjk~hhhj}~hMubj)}(husb_string_ids_nh]j)}(husb_string_ids_nh]husb_string_ids_n}(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ubah}(h]h ](jjeh"]h$]h&]jjuh1jhjk~hhhj}~hMubj)}(h)(struct usb_composite_dev *c, unsigned n)h](j)}(hstruct usb_composite_dev *ch](j)}(hjh]hstruct}(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ubj)}(h h]h }(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ubh)}(hhh]j)}(husb_composite_devh]husb_composite_dev}(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj~modnameN classnameNjj)}j]j)}jj~sbc.usb_string_ids_nasbuh1hhj~ubj)}(h h]h }(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ubj)}(hjh]h*}(hj~hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj~ubj)}(hjh]hc}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj~ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj~ubj)}(h unsigned nh](j#)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]j#ah"]h$]h&]uh1j#hjubj)}(h h]h }(hj+hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]hn}(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhj~ubeh}(h]h ]h"]h$]h&]jjuh1jhjk~hhhj}~hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjg~hhhj}~hMubah}(h]jb~ah ](j j eh"]h$]h&]j j )j huh1jhj}~hMhjd~hhubj )}(hhh]h)}(h#allocate unused string IDs in batchh]h#allocate unused string IDs in batch}(hjbhhhNhNubah}(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&]uh1j hjd~hhhj}~hMubeh}(h]h ](jfunctioneh"]h$]h&]j+ jj, jzj- jzj. j/ j0 uh1jhhhjEHhNhNubj2 )}(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]j< )}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hj~ubjq)}(hhh](jv)}(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)}(hjh]hstruct usb_composite_dev *c}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhjubj)}(hhh]h)}(h:the device whose string descriptor IDs are being allocatedh]h:the device whose string descriptor IDs are being allocated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhMhjubjv)}(h0``unsigned n`` number of string IDs to allocate h](j|)}(h``unsigned n``h]j)}(hjh]h unsigned n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j{he/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubj)}(hhh]h)}(h number of string IDs to allocateh]h number of string IDs to allocate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhjhM hjubeh}(h]h ]h"]h$]h&]uh1jphj~ubh)}(h **Context**h]j< )}(hjh]hContext}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hj~ubh)}(h#single threaded during gadget setuph]h#single threaded during gadget setup}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hj~ubh)}(h**Description**h]j< )}(hj>h]h Description}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hj<ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hj~ubh)}(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 }(hjThhhNhNubj< )}(h**n**h]hn}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjTubh2-1 IDs are now valid IDs. At least provided that }(hjThhhNhNubj< )}(h**n**h]hn}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjTubh^ is non-zero because if it is, returns last requested ID which is now very useful information.}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hj~ubh)}(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](j< )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubh 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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chMhj~ubh)}(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, }(hjhhhNhNubj< )}(h**usb_string_id\(\)**h]husb_string_id()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubh or }(hjhhhNhNubj< )}(h**usb_string_ids_n\(\)**h]husb_string_ids_n()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; hjubhz routine, to ensure that for example different functions don’t wrongly assign different meanings to the same identifier.}(hjhhhNhNubeh}(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&]uh1j1 hjEHhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j usb_composite_probe (C function)c.usb_composite_probehNtauh1jhjEHhhhNhNubj)}(hhh](j)}(h=int usb_composite_probe (struct usb_composite_driver *driver)h]j)}(hthe composite device who’s control transfer was kept waiting}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjWhM hjXubah}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1juhjWhM hj9ubah}(h]h ]h"]h$]h&]uh1jphjubh)}(h**Description**h]j< )}(hj}h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j; 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)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/driver-api/usb/gadget:352: ./drivers/usb/gadget/composite.chM hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j1 hjEHhhhNhNubeh}(h]composite-device-frameworkah ]h"]composite device frameworkah$]h&]uh1hhjhhhhhMNubh)}(hhh](h)}(hComposite Device Functionsh]hComposite Device Functions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMdubh)}(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 }(hj…hhhNhNubj)}(h ``gadgetfs``h]hgadgetfs}(hjʅhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj…ubh.}(hj…hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMfhjhhubeh}(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}(hjhhhNhNubah}(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 }(hjhhhNhNubj)}(h ``net2280``h]hnet2280}(hj hhhNhNubah}(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.}(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 }(hj#hhhNhNubj)}(h ``gadget``h]hgadget}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubhE framework includes: Intel’s PXA 25x and IXP42x series processors (}(hj#hhhNhNubj)}(h``pxa2xx_udc``h]h pxa2xx_udc}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh"), Toshiba TC86c001 “Goku-S” (}(hj#hhhNhNubj)}(h ``goku_udc``h]hgoku_udc}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh), Renesas SH7705/7727 (}(hj#hhhNhNubj)}(h ``sh_udc``h]hsh_udc}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh), MediaQ 11xx (}(hj#hhhNhNubj)}(h``mq11xx_udc``h]h mq11xx_udc}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh), Hynix HMS30C7202 (}(hj#hhhNhNubj)}(h ``h7202_udc``h]h h7202_udc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh), National 9303/4 (}(hj#hhhNhNubj)}(h ``n9604_udc``h]h n9604_udc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh), Texas Instruments OMAP (}(hj#hhhNhNubj)}(h ``omap_udc``h]homap_udc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh), Sharp LH7A40x (}(hj#hhhNhNubj)}(h``lh7a40x_udc``h]h lh7a40x_udc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh6), 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.}(hjӆhhhNhNubah}(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 }(hjhhhNhNubj)}(h ``dummy_hcd``h]h dummy_hcd}(hjhhhNhNubah}(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.}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]peripheral-controller-driversah ]h"]peripheral controller driversah$]h&]uh1hhhhhhhhMkubh)}(hhh](h)}(hGadget Driversh]hGadget Drivers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(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 }(hj(hhhNhNubj)}(h *Gadget Zero*h]h Gadget Zero}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(ubhs (used primarily for testing and development with drivers for usb controller hardware), other gadget drivers exist.}(hj(hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(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 }(hjHhhhNhNubj)}(h ``ethernet``h]hethernet}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubh8 gadget driver, which implements one of the most useful }(hjHhhhNhNubj)}(h*Communications Device Class*h]hCommunications Device Class}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubhXh (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.)}(hjHhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(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 }(hjzhhhNhNubj)}(h ``RNDIS``h]hRNDIS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjzubhXj 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.}(hjzhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(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 }(hjhhhNhNubj)}(h ``gadgetfs``h]hgadgetfs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. This provides a }(hjhhhNhNubj)}(h*User Mode API*h]h User Mode API}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhS that presents each endpoint as a single file descriptor. I/O is done using normal }(hjhhhNhNubj)}(h ``read()``h]hread()}(hjƇhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h ``read()``h]hread()}(hj؇hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh 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 }(hjhhhNhNubj)}(h*Async I/O (AIO)*h]hAsync I/O (AIO)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhx support is available, so that user mode software can stream data with only slightly more overhead than a kernel driver.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(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 }(hjhhhNhNubj)}(h*Mass Storage*h]h Mass Storage}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhK driver uses a file or block device as backing store for a drive, like the }(hjhhhNhNubj)}(h``loop``h]hloop}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh 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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(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.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(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.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]gadget-driversah ]h"]gadget driversah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hUSB On-The-GO (OTG)h]hUSB On-The-GO (OTG)}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhhhhhMubh)}(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 }(hjihhhNhNubh reference)}(h`OMAP `__h]hOMAP}(hjshhhNhNubah}(h]h ]h"]h$]h&]nameOMAPrefurihttp://www.omap.comuh1jqhjiubh 16xx and 17xx series processors. Other OTG systems should work in similar ways, but the hardware level details could be very different.}(hjihhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjXhhubh)}(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 }(hjhhhNhNubj)}(h *Mini-AB*h]hMini-AB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, jack and associated transceiver to support }(hjhhhNhNubj)}(h *Dual-Role*h]h Dual-Role}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh operation: they can act either as a host, using the standard Linux-USB host side driver stack, or as a peripheral, using this }(hjhhhNhNubj)}(h ``gadget``h]hgadget}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhXk 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 (}(hjhhhNhNubh)}(h:c:type:`usb_bus`h]j)}(hjψh]husb_bus}(hjшhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhj͈ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjHjusb_busuh1hhhhMhjubh or }(hjhhhNhNubh)}(h:c:type:`usb_gadget`h]j)}(hjh]h usb_gadget}(hjhhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjHj usb_gadgetuh1hhhhMhjubhy). Such drivers need at most minor changes, and most of the calls added to support OTG can also benefit non-OTG products.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjXhhubjG)}(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 }(hj hhhNhNubj)}(h ``is_otg``h]his_otg}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhk flag, and use it to determine whether or not to include an OTG descriptor in each of their configurations.}(hj hhhNhNubeh}(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 }(hjJhhhNhNubj)}(h``b_hnp_enable``h]h b_hnp_enable}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjJubh 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.}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjFubah}(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 }(hjthhhNhNubj)}(h``usb_suspend_device()``h]husb_suspend_device()}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjtubhU. That also conserves battery power, which is useful even for non-OTG configurations.}(hjthhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjpubah}(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. }(hjhhhNhNubj)}(h>*This whitelist is product-specific; each product must modify*h]hj>jR@jW@jBjBjLFjQFjjEHjHjHjKj KjcMjhMjNjNjVj VjYjYj]j]j^j^jcj cjfjfjijij9lj>ljmjmjojojqjqjsjsjwj wjxjxj{j{jb~jg~jjjjj4j9jjjjjRjj`jXu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.