Android USB Gadget » History » Version 1
laforge, 12/17/2016 11:27 AM
1 | 1 | laforge | h1. Android USB Gadget |
---|---|---|---|
2 | |||
3 | 'struct android_usb_function' implements a given function |
||
4 | |||
5 | h2. Gadgets |
||
6 | |||
7 | h3. ffs (function FS) |
||
8 | |||
9 | * userspace process can implement USB functions |
||
10 | * used e.g. by adbd |
||
11 | |||
12 | h3. acm (CDC "astract control model") |
||
13 | |||
14 | * USB-IF standardized version of serial-type ports |
||
15 | * exposed via /dev/ttyGS* device |
||
16 | |||
17 | h3. rmnet |
||
18 | |||
19 | usb gadget driver to implement a rmnet gadget, f_rmnet.c |
||
20 | Documentation/usb/gadget_rmnet.txt |
||
21 | |||
22 | * drivers/net/ethernet/msm/msm_rmnet_mhi.c |
||
23 | * interface descriptor: class/subclass/proto = 0xff, numEP=3 |
||
24 | ** stringdescriptor en-us, string 0 == "RmNet" |
||
25 | ** full speed descriptors (notify/in/out) |
||
26 | ** high speed descriptors (notify/in/out) |
||
27 | ** super speed descriptors (notify/in/out + comp) |
||
28 | |||
29 | * rmnet has ports |
||
30 | * control ports can map to SMD, QTY, HSIC,HSUART |
||
31 | * data ports can map to BAM2BAM, BAM_DMUX, BAM2BAM_IPA, HSIC, HSUART, ETHER |
||
32 | ** BAM2BAM is normal case? |
||
33 | ** ETHER exposes the data pipe as usb_rmnet%d device on Linux (EC25 only) |
||
34 | * frmnet_init_port() establishes connections |
||
35 | |||
36 | |||
37 | h3. gps |
||
38 | |||
39 | * IF class/sub/proto = 0xff |
||
40 | * only one endpoint (notify) |
||
41 | * string[0] (en-us) is "GPS" |
||
42 | |||
43 | h3. ncm (CDC Netowrk (NCM) link function) |
||
44 | |||
45 | h3. ecm_qc (CDC Ethernet) |
||
46 | |||
47 | h3. usb_mbim (Mobile Broadband Interface Model) |
||
48 | |||
49 | h3. audio (uac1?) |
||
50 | |||
51 | h3. diag |
||
52 | |||
53 | * class/sub/proto = 0xff |
||
54 | * num-ep 2 |
||
55 | * max-packet 512 |
||
56 | * some special assumption only if bInterfaceNumber==0 |
||
57 | |||
58 | h3. qdss (Qualcomm Debug Sub-System) |
||
59 | |||
60 | * has QDSS DATA / QDSS CTRL string descriptor |
||
61 | * somehow connects to BAM |
||
62 | |||
63 | h3. serial |
||
64 | |||
65 | * class=0xff, sub/proto = 0 |
||
66 | * num_endpoints = 3 |
||
67 | * string descroptor "Generic Serial" |
||
68 | * transports |
||
69 | ** tty (-> gserial) |
||
70 | ** smd (shared memory) |
||
71 | ** char_bridge (?) |
||
72 | ** hsic |
||
73 | |||
74 | h3. ccid (chipcard reader) |
||
75 | |||
76 | * /dev/ccid_ctrl |
||
77 | * /dev/ccid_bulk |
||
78 | * probably intended to be used with userspace progam translating USB CCID requests into QMI requests to access SIM card(s) |
||
79 | |||
80 | h3. charging |
||
81 | |||
82 | * usb charger support |
||
83 | |||
84 | h3. mtp |
||
85 | |||
86 | h3. ptp |
||
87 | |||
88 | h3. rndis |
||
89 | |||
90 | h3. rndis_qc |
||
91 | |||
92 | h3. ecm |
||
93 | |||
94 | h3. mass_storage |
||
95 | |||
96 | h3. accessory |
||
97 | |||
98 | h3. audio_source |
||
99 | |||
100 | h3. midi |
||
101 | |||
102 | h3. rndis_gsi |
||
103 | |||
104 | h3. rmnet_gsi |
||
105 | |||
106 | h3. ecm_gsi |
||
107 | |||
108 | h3. mbim_gsi |
||
109 | |||
110 | h3. dpl_gsi |
||
111 | |||
112 | |||
113 | h2. modem detection / EC20 re-using same usb device id / interface numbers |
||
114 | |||
115 | The idea here is to dynamically detect which interface number exposes a certain interface, |
||
116 | regardless what order / qty / interface number |
||
117 | |||
118 | * ADB: 255/66/1, 2 EP |
||
119 | * Diag: 255/255/255, 2 EP |
||
120 | * TTY: 255/0/0, 3 EP, unrecognized descriptors |
||
121 | * RMNET: 255/255/255, 3EP |