1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><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&#160;3.&#160;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>&#160;</td><th width="60%" align="center">Chapter&#160;3.&#160;Kernel Mode Gadget API</th><td width="20%" align="right">&#160;<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"> &#8212; 
2  describes one i/o request
3 </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"> &#8212; 
4     device side representation of USB endpoint
5 </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"> &#8212; 
6     set maximum packet size limit for endpoint
7 </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"> &#8212; 
8     configure endpoint, making it usable
9 </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"> &#8212; 
10     endpoint is no longer usable
11 </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"> &#8212; 
12     allocate a request object to use with this endpoint
13 </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"> &#8212; 
14     frees a request object
15 </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"> &#8212; 
16     queues (submits) an I/O request to an endpoint.
17 </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"> &#8212; 
18     dequeues (cancels, unlinks) an I/O request from an endpoint
19 </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"> &#8212; 
20     sets the endpoint halt feature.
21 </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"> &#8212; 
22     clears endpoint halt, and resets toggle
23 </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"> &#8212; 
24     sets the halt feature and ignores clear requests
25 </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"> &#8212; 
26     returns number of bytes in fifo, or error
27 </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"> &#8212; 
28     flushes contents of a fifo
29 </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"> &#8212; 
30     represents a usb slave device
31 </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"> &#8212; 
32     returns <em class="parameter"><code>len</code></em> aligned to ep's maxpacketsize if gadget requires quirk_ep_out_aligned_size, otherwise reguens len.
33 </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"> &#8212; 
34     return true iff the hardware handles high speed
35 </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"> &#8212; 
36     return true if the hardware handles superspeed
37 </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"> &#8212; 
38     return true iff the hardware is OTG-ready
39 </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"> &#8212; 
40     returns the current frame number
41 </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"> &#8212; 
42     tries to wake up the host connected to this gadget
43 </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"> &#8212; 
44     sets the device selfpowered feature.
45 </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"> &#8212; 
46     clear the device selfpowered feature.
47 </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"> &#8212; 
48     Notify controller that VBUS is powered
49 </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"> &#8212; 
50     constrain controller's VBUS power usage
51 </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"> &#8212; 
52     notify controller about VBUS session end
53 </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"> &#8212; 
54     software-controlled connect to USB host
55 </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"> &#8212; 
56     software-controlled disconnect from USB host
57 </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"> &#8212; 
58     driver for usb 'slave' devices
59 </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"> &#8212; 
60     probe a gadget driver
61 </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"> &#8212; 
62     unregister a gadget driver
63 </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"> &#8212; 
64     wraps a C string and its USB id
65 </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"> &#8212; 
66     a set of USB strings in a given language
67 </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"> &#8212; 
68     free descriptors returned by <code class="function">usb_copy_descriptors</code>
69 </span></dt></dl></div><p>These are declared in
70<code class="filename">&lt;linux/usb/gadget.h&gt;</code>,
71and are used by gadget drivers to interact with
72USB peripheral controller drivers.
73</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>&#160;</td><td width="20%" align="center"><a accesskey="u" href="api.html">Up</a></td><td width="40%" align="right">&#160;<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>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">struct usb_request</span></td></tr></table></div></body></html>
74