1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Core Objects and Methods</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="USB Gadget API for Linux"><link rel="up" href="api.html" title="Chapter 3. Kernel Mode Gadget API"><link rel="prev" href="API-usb-state-string.html" title="usb_state_string"><link rel="next" href="API-struct-usb-request.html" title="struct usb_request"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Core Objects and Methods</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-state-string.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Kernel Mode Gadget API</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-usb-request.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="core"></a>Core Objects and Methods</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-usb-request.html"><span class="phrase">struct usb_request</span></a></span><span class="refpurpose"> — 
2  describes one i/o request
3 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-ep-caps.html"><span class="phrase">struct usb_ep_caps</span></a></span><span class="refpurpose"> — 
4     endpoint capabilities description
5 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-ep.html"><span class="phrase">struct usb_ep</span></a></span><span class="refpurpose"> — 
6     device side representation of USB endpoint
7 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-set-maxpacket-limit.html"><span class="phrase">usb_ep_set_maxpacket_limit</span></a></span><span class="refpurpose"> — 
8     set maximum packet size limit for endpoint
9 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-enable.html"><span class="phrase">usb_ep_enable</span></a></span><span class="refpurpose"> — 
10     configure endpoint, making it usable
11 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-disable.html"><span class="phrase">usb_ep_disable</span></a></span><span class="refpurpose"> — 
12     endpoint is no longer usable
13 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-alloc-request.html"><span class="phrase">usb_ep_alloc_request</span></a></span><span class="refpurpose"> — 
14     allocate a request object to use with this endpoint
15 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-free-request.html"><span class="phrase">usb_ep_free_request</span></a></span><span class="refpurpose"> — 
16     frees a request object
17 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-queue.html"><span class="phrase">usb_ep_queue</span></a></span><span class="refpurpose"> — 
18     queues (submits) an I/O request to an endpoint.
19 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-dequeue.html"><span class="phrase">usb_ep_dequeue</span></a></span><span class="refpurpose"> — 
20     dequeues (cancels, unlinks) an I/O request from an endpoint
21 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-set-halt.html"><span class="phrase">usb_ep_set_halt</span></a></span><span class="refpurpose"> — 
22     sets the endpoint halt feature.
23 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-clear-halt.html"><span class="phrase">usb_ep_clear_halt</span></a></span><span class="refpurpose"> — 
24     clears endpoint halt, and resets toggle
25 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-set-wedge.html"><span class="phrase">usb_ep_set_wedge</span></a></span><span class="refpurpose"> — 
26     sets the halt feature and ignores clear requests
27 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-fifo-status.html"><span class="phrase">usb_ep_fifo_status</span></a></span><span class="refpurpose"> — 
28     returns number of bytes in fifo, or error
29 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-fifo-flush.html"><span class="phrase">usb_ep_fifo_flush</span></a></span><span class="refpurpose"> — 
30     flushes contents of a fifo
31 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-gadget.html"><span class="phrase">struct usb_gadget</span></a></span><span class="refpurpose"> — 
32     represents a usb slave device
33 </span></dt><dt><span class="refentrytitle"><a href="API-usb-ep-align-maybe.html"><span class="phrase">usb_ep_align_maybe</span></a></span><span class="refpurpose"> — 
34     returns <em class="parameter"><code>len</code></em> aligned to ep's maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise reguens len.
35 </span></dt><dt><span class="refentrytitle"><a href="API-gadget-is-altset-supported.html"><span class="phrase">gadget_is_altset_supported</span></a></span><span class="refpurpose"> — 
36     return true iff the hardware supports altsettings
37 </span></dt><dt><span class="refentrytitle"><a href="API-gadget-is-stall-supported.html"><span class="phrase">gadget_is_stall_supported</span></a></span><span class="refpurpose"> — 
38     return true iff the hardware supports stalling
39 </span></dt><dt><span class="refentrytitle"><a href="API-gadget-is-zlp-supported.html"><span class="phrase">gadget_is_zlp_supported</span></a></span><span class="refpurpose"> — 
40     return true iff the hardware supports zlp
41 </span></dt><dt><span class="refentrytitle"><a href="API-gadget-is-dualspeed.html"><span class="phrase">gadget_is_dualspeed</span></a></span><span class="refpurpose"> — 
42     return true iff the hardware handles high speed
43 </span></dt><dt><span class="refentrytitle"><a href="API-gadget-is-superspeed.html"><span class="phrase">gadget_is_superspeed</span></a></span><span class="refpurpose"> — 
44     return true if the hardware handles superspeed
45 </span></dt><dt><span class="refentrytitle"><a href="API-gadget-is-otg.html"><span class="phrase">gadget_is_otg</span></a></span><span class="refpurpose"> — 
46     return true iff the hardware is OTG-ready
47 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-frame-number.html"><span class="phrase">usb_gadget_frame_number</span></a></span><span class="refpurpose"> — 
48     returns the current frame number
49 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-wakeup.html"><span class="phrase">usb_gadget_wakeup</span></a></span><span class="refpurpose"> — 
50     tries to wake up the host connected to this gadget
51 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-set-selfpowered.html"><span class="phrase">usb_gadget_set_selfpowered</span></a></span><span class="refpurpose"> — 
52     sets the device selfpowered feature.
53 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-clear-selfpowered.html"><span class="phrase">usb_gadget_clear_selfpowered</span></a></span><span class="refpurpose"> — 
54     clear the device selfpowered feature.
55 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-vbus-connect.html"><span class="phrase">usb_gadget_vbus_connect</span></a></span><span class="refpurpose"> — 
56     Notify controller that VBUS is powered
57 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-vbus-draw.html"><span class="phrase">usb_gadget_vbus_draw</span></a></span><span class="refpurpose"> — 
58     constrain controller's VBUS power usage
59 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-vbus-disconnect.html"><span class="phrase">usb_gadget_vbus_disconnect</span></a></span><span class="refpurpose"> — 
60     notify controller about VBUS session end
61 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-connect.html"><span class="phrase">usb_gadget_connect</span></a></span><span class="refpurpose"> — 
62     software-controlled connect to USB host
63 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-disconnect.html"><span class="phrase">usb_gadget_disconnect</span></a></span><span class="refpurpose"> — 
64     software-controlled disconnect from USB host
65 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-deactivate.html"><span class="phrase">usb_gadget_deactivate</span></a></span><span class="refpurpose"> — 
66     deactivate function which is not ready to work
67 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-activate.html"><span class="phrase">usb_gadget_activate</span></a></span><span class="refpurpose"> — 
68     activate function which is not ready to work
69 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-gadget-driver.html"><span class="phrase">struct usb_gadget_driver</span></a></span><span class="refpurpose"> — 
70     driver for usb 'slave' devices
71 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-probe-driver.html"><span class="phrase">usb_gadget_probe_driver</span></a></span><span class="refpurpose"> — 
72     probe a gadget driver
73 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gadget-unregister-driver.html"><span class="phrase">usb_gadget_unregister_driver</span></a></span><span class="refpurpose"> — 
74     unregister a gadget driver
75 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-string.html"><span class="phrase">struct usb_string</span></a></span><span class="refpurpose"> — 
76     wraps a C string and its USB id
77 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-gadget-strings.html"><span class="phrase">struct usb_gadget_strings</span></a></span><span class="refpurpose"> — 
78     a set of USB strings in a given language
79 </span></dt><dt><span class="refentrytitle"><a href="API-usb-free-descriptors.html"><span class="phrase">usb_free_descriptors</span></a></span><span class="refpurpose">
80     free descriptors returned by usb_copy_descriptors
81 </span></dt></dl></div><p>These are declared in
82<code class="filename">&lt;linux/usb/gadget.h&gt;</code>,
83and are used by gadget drivers to interact with
84USB peripheral controller drivers.
85</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-usb-state-string.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="api.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-usb-request.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_state_string</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct usb_request</span></td></tr></table></div></body></html>
86