Andrzej Pietrasiewicz | e38eb2c | 2014-12-16 14:56:25 +0100 | [diff] [blame] | 1 | This file summarizes information on basic testing of USB functions |
| 2 | provided by gadgets. |
| 3 | |
| 4 | 1. ACM function |
Andrzej Pietrasiewicz | d5862ca | 2014-12-16 14:56:26 +0100 | [diff] [blame] | 5 | 2. ECM function |
Andrzej Pietrasiewicz | 7bfbc6e | 2014-12-16 14:56:27 +0100 | [diff] [blame] | 6 | 3. ECM subset function |
Andrzej Pietrasiewicz | 4ca560a | 2014-12-16 14:56:28 +0100 | [diff] [blame] | 7 | 4. EEM function |
Andrzej Pietrasiewicz | 2c0f62f | 2014-12-16 14:56:29 +0100 | [diff] [blame^] | 8 | 5. FFS function |
Andrzej Pietrasiewicz | e38eb2c | 2014-12-16 14:56:25 +0100 | [diff] [blame] | 9 | |
| 10 | |
| 11 | 1. ACM function |
| 12 | =============== |
| 13 | |
| 14 | The function is provided by usb_f_acm.ko module. |
| 15 | |
| 16 | Function-specific configfs interface |
| 17 | ------------------------------------ |
| 18 | |
| 19 | The function name to use when creating the function directory is "acm". |
| 20 | The ACM function provides just one attribute in its function directory: |
| 21 | |
| 22 | port_num |
| 23 | |
| 24 | The attribute is read-only. |
| 25 | |
| 26 | There can be at most 4 ACM/generic serial/OBEX ports in the system. |
| 27 | |
| 28 | |
| 29 | Testing the ACM function |
| 30 | ------------------------ |
| 31 | |
| 32 | On the host: cat > /dev/ttyACM<X> |
| 33 | On the device : cat /dev/ttyGS<Y> |
| 34 | |
| 35 | then the other way round |
| 36 | |
| 37 | On the device: cat > /dev/ttyGS<Y> |
| 38 | On the host: cat /dev/ttyACM<X> |
Andrzej Pietrasiewicz | d5862ca | 2014-12-16 14:56:26 +0100 | [diff] [blame] | 39 | |
| 40 | 2. ECM function |
| 41 | =============== |
| 42 | |
| 43 | The function is provided by usb_f_ecm.ko module. |
| 44 | |
| 45 | Function-specific configfs interface |
| 46 | ------------------------------------ |
| 47 | |
| 48 | The function name to use when creating the function directory is "ecm". |
| 49 | The 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 | |
| 59 | and after creating the functions/ecm.<instance name> they contain default |
| 60 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
| 61 | Except for ifname they can be written to until the function is linked to a |
| 62 | configuration. The ifname is read-only and contains the name of the interface |
| 63 | which was assigned by the net core, e. g. usb0. |
| 64 | |
| 65 | Testing the ECM function |
| 66 | ------------------------ |
| 67 | |
| 68 | Configure IP addresses of the device and the host. Then: |
| 69 | |
| 70 | On the device: ping <host's IP> |
| 71 | On the host: ping <device's IP> |
Andrzej Pietrasiewicz | 7bfbc6e | 2014-12-16 14:56:27 +0100 | [diff] [blame] | 72 | |
| 73 | 3. ECM subset function |
| 74 | ====================== |
| 75 | |
| 76 | The function is provided by usb_f_ecm_subset.ko module. |
| 77 | |
| 78 | Function-specific configfs interface |
| 79 | ------------------------------------ |
| 80 | |
| 81 | The function name to use when creating the function directory is "geth". |
| 82 | The 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 | |
| 92 | and after creating the functions/ecm.<instance name> they contain default |
| 93 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
| 94 | Except for ifname they can be written to until the function is linked to a |
| 95 | configuration. The ifname is read-only and contains the name of the interface |
| 96 | which was assigned by the net core, e. g. usb0. |
| 97 | |
| 98 | Testing the ECM subset function |
| 99 | ------------------------------- |
| 100 | |
| 101 | Configure IP addresses of the device and the host. Then: |
| 102 | |
| 103 | On the device: ping <host's IP> |
| 104 | On the host: ping <device's IP> |
Andrzej Pietrasiewicz | 4ca560a | 2014-12-16 14:56:28 +0100 | [diff] [blame] | 105 | |
| 106 | 4. EEM function |
| 107 | =============== |
| 108 | |
| 109 | The function is provided by usb_f_eem.ko module. |
| 110 | |
| 111 | Function-specific configfs interface |
| 112 | ------------------------------------ |
| 113 | |
| 114 | The function name to use when creating the function directory is "eem". |
| 115 | The 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 | |
| 125 | and after creating the functions/eem.<instance name> they contain default |
| 126 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
| 127 | Except for ifname they can be written to until the function is linked to a |
| 128 | configuration. The ifname is read-only and contains the name of the interface |
| 129 | which was assigned by the net core, e. g. usb0. |
| 130 | |
| 131 | Testing the EEM function |
| 132 | ------------------------ |
| 133 | |
| 134 | Configure IP addresses of the device and the host. Then: |
| 135 | |
| 136 | On the device: ping <host's IP> |
| 137 | On the host: ping <device's IP> |
Andrzej Pietrasiewicz | 2c0f62f | 2014-12-16 14:56:29 +0100 | [diff] [blame^] | 138 | |
| 139 | 5. FFS function |
| 140 | =============== |
| 141 | |
| 142 | The function is provided by usb_f_fs.ko module. |
| 143 | |
| 144 | Function-specific configfs interface |
| 145 | ------------------------------------ |
| 146 | |
| 147 | The function name to use when creating the function directory is "ffs". |
| 148 | The function directory is intentionally empty and not modifiable. |
| 149 | |
| 150 | After creating the directory there is a new instance (a "device") of FunctionFS |
| 151 | available in the system. Once a "device" is available, the user should follow |
| 152 | the standard procedure for using FunctionFS (mount it, run the userspace |
| 153 | process which implements the function proper). The gadget should be enabled |
| 154 | by writing a suitable string to usb_gadget/<gadget>/UDC. |
| 155 | |
| 156 | Testing the FFS function |
| 157 | ------------------------ |
| 158 | |
| 159 | On the device: start the function's userspace daemon, enable the gadget |
| 160 | On the host: use the USB function provided by the device |