blob: 141a1d01f31273efbb39813e3456a45f99424e30 [file] [log] [blame]
Andrzej Pietrasiewicze38eb2c2014-12-16 14:56:25 +01001This file summarizes information on basic testing of USB functions
2provided by gadgets.
3
41. ACM function
Andrzej Pietrasiewiczd5862ca2014-12-16 14:56:26 +010052. ECM function
Andrzej Pietrasiewicz7bfbc6e2014-12-16 14:56:27 +010063. ECM subset function
Andrzej Pietrasiewicz4ca560a2014-12-16 14:56:28 +010074. EEM function
Andrzej Pietrasiewicz2c0f62f2014-12-16 14:56:29 +010085. FFS function
Andrzej Pietrasiewicze38eb2c2014-12-16 14:56:25 +01009
10
111. ACM function
12===============
13
14The function is provided by usb_f_acm.ko module.
15
16Function-specific configfs interface
17------------------------------------
18
19The function name to use when creating the function directory is "acm".
20The ACM function provides just one attribute in its function directory:
21
22 port_num
23
24The attribute is read-only.
25
26There can be at most 4 ACM/generic serial/OBEX ports in the system.
27
28
29Testing the ACM function
30------------------------
31
32On the host: cat > /dev/ttyACM<X>
33On the device : cat /dev/ttyGS<Y>
34
35then the other way round
36
37On the device: cat > /dev/ttyGS<Y>
38On the host: cat /dev/ttyACM<X>
Andrzej Pietrasiewiczd5862ca2014-12-16 14:56:26 +010039
402. ECM function
41===============
42
43The function is provided by usb_f_ecm.ko module.
44
45Function-specific configfs interface
46------------------------------------
47
48The function name to use when creating the function directory is "ecm".
49The ECM function provides these attributes in its function directory:
50
51 ifname - network device interface name associated with this
52 function instance
53 qmult - queue length multiplier for high and super speed
54 host_addr - MAC address of host's end of this
55 Ethernet over USB link
56 dev_addr - MAC address of device's end of this
57 Ethernet over USB link
58
59and after creating the functions/ecm.<instance name> they contain default
60values: qmult is 5, dev_addr and host_addr are randomly selected.
61Except for ifname they can be written to until the function is linked to a
62configuration. The ifname is read-only and contains the name of the interface
63which was assigned by the net core, e. g. usb0.
64
65Testing the ECM function
66------------------------
67
68Configure IP addresses of the device and the host. Then:
69
70On the device: ping <host's IP>
71On the host: ping <device's IP>
Andrzej Pietrasiewicz7bfbc6e2014-12-16 14:56:27 +010072
733. ECM subset function
74======================
75
76The function is provided by usb_f_ecm_subset.ko module.
77
78Function-specific configfs interface
79------------------------------------
80
81The function name to use when creating the function directory is "geth".
82The ECM subset function provides these attributes in its function directory:
83
84 ifname - network device interface name associated with this
85 function instance
86 qmult - queue length multiplier for high and super speed
87 host_addr - MAC address of host's end of this
88 Ethernet over USB link
89 dev_addr - MAC address of device's end of this
90 Ethernet over USB link
91
92and after creating the functions/ecm.<instance name> they contain default
93values: qmult is 5, dev_addr and host_addr are randomly selected.
94Except for ifname they can be written to until the function is linked to a
95configuration. The ifname is read-only and contains the name of the interface
96which was assigned by the net core, e. g. usb0.
97
98Testing the ECM subset function
99-------------------------------
100
101Configure IP addresses of the device and the host. Then:
102
103On the device: ping <host's IP>
104On the host: ping <device's IP>
Andrzej Pietrasiewicz4ca560a2014-12-16 14:56:28 +0100105
1064. EEM function
107===============
108
109The function is provided by usb_f_eem.ko module.
110
111Function-specific configfs interface
112------------------------------------
113
114The function name to use when creating the function directory is "eem".
115The EEM function provides these attributes in its function directory:
116
117 ifname - network device interface name associated with this
118 function instance
119 qmult - queue length multiplier for high and super speed
120 host_addr - MAC address of host's end of this
121 Ethernet over USB link
122 dev_addr - MAC address of device's end of this
123 Ethernet over USB link
124
125and after creating the functions/eem.<instance name> they contain default
126values: qmult is 5, dev_addr and host_addr are randomly selected.
127Except for ifname they can be written to until the function is linked to a
128configuration. The ifname is read-only and contains the name of the interface
129which was assigned by the net core, e. g. usb0.
130
131Testing the EEM function
132------------------------
133
134Configure IP addresses of the device and the host. Then:
135
136On the device: ping <host's IP>
137On the host: ping <device's IP>
Andrzej Pietrasiewicz2c0f62f2014-12-16 14:56:29 +0100138
1395. FFS function
140===============
141
142The function is provided by usb_f_fs.ko module.
143
144Function-specific configfs interface
145------------------------------------
146
147The function name to use when creating the function directory is "ffs".
148The function directory is intentionally empty and not modifiable.
149
150After creating the directory there is a new instance (a "device") of FunctionFS
151available in the system. Once a "device" is available, the user should follow
152the standard procedure for using FunctionFS (mount it, run the userspace
153process which implements the function proper). The gadget should be enabled
154by writing a suitable string to usb_gadget/<gadget>/UDC.
155
156Testing the FFS function
157------------------------
158
159On the device: start the function's userspace daemon, enable the gadget
160On the host: use the USB function provided by the device