Documentation: usb: ECM function testing
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / Documentation / usb / gadget-testing.txt
CommitLineData
e38eb2c8
AP
1This file summarizes information on basic testing of USB functions
2provided by gadgets.
3
41. ACM function
d5862ca6 52. ECM function
e38eb2c8
AP
6
7
81. ACM function
9===============
10
11The function is provided by usb_f_acm.ko module.
12
13Function-specific configfs interface
14------------------------------------
15
16The function name to use when creating the function directory is "acm".
17The ACM function provides just one attribute in its function directory:
18
19 port_num
20
21The attribute is read-only.
22
23There can be at most 4 ACM/generic serial/OBEX ports in the system.
24
25
26Testing the ACM function
27------------------------
28
29On the host: cat > /dev/ttyACM<X>
30On the device : cat /dev/ttyGS<Y>
31
32then the other way round
33
34On the device: cat > /dev/ttyGS<Y>
35On the host: cat /dev/ttyACM<X>
d5862ca6
AP
36
372. ECM function
38===============
39
40The function is provided by usb_f_ecm.ko module.
41
42Function-specific configfs interface
43------------------------------------
44
45The function name to use when creating the function directory is "ecm".
46The ECM function provides these attributes in its function directory:
47
48 ifname - network device interface name associated with this
49 function instance
50 qmult - queue length multiplier for high and super speed
51 host_addr - MAC address of host's end of this
52 Ethernet over USB link
53 dev_addr - MAC address of device's end of this
54 Ethernet over USB link
55
56and after creating the functions/ecm.<instance name> they contain default
57values: qmult is 5, dev_addr and host_addr are randomly selected.
58Except for ifname they can be written to until the function is linked to a
59configuration. The ifname is read-only and contains the name of the interface
60which was assigned by the net core, e. g. usb0.
61
62Testing the ECM function
63------------------------
64
65Configure IP addresses of the device and the host. Then:
66
67On the device: ping <host's IP>
68On the host: ping <device's IP>