gadget-testing.txt 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. This file summarizes information on basic testing of USB functions
  2. provided by gadgets.
  3. 1. ACM function
  4. 2. ECM function
  5. 3. ECM subset function
  6. 4. EEM function
  7. 5. FFS function
  8. 6. HID function
  9. 7. LOOPBACK function
  10. 8. MASS STORAGE function
  11. 9. MIDI function
  12. 10. NCM function
  13. 11. OBEX function
  14. 12. PHONET function
  15. 13. RNDIS function
  16. 14. SERIAL function
  17. 15. SOURCESINK function
  18. 16. UAC1 function
  19. 17. UAC2 function
  20. 18. UVC function
  21. 19. PRINTER function
  22. 1. ACM function
  23. ===============
  24. The function is provided by usb_f_acm.ko module.
  25. Function-specific configfs interface
  26. ------------------------------------
  27. The function name to use when creating the function directory is "acm".
  28. The ACM function provides just one attribute in its function directory:
  29. port_num
  30. The attribute is read-only.
  31. There can be at most 4 ACM/generic serial/OBEX ports in the system.
  32. Testing the ACM function
  33. ------------------------
  34. On the host: cat > /dev/ttyACM<X>
  35. On the device : cat /dev/ttyGS<Y>
  36. then the other way round
  37. On the device: cat > /dev/ttyGS<Y>
  38. On the host: cat /dev/ttyACM<X>
  39. 2. ECM function
  40. ===============
  41. The function is provided by usb_f_ecm.ko module.
  42. Function-specific configfs interface
  43. ------------------------------------
  44. The function name to use when creating the function directory is "ecm".
  45. The ECM function provides these attributes in its function directory:
  46. ifname - network device interface name associated with this
  47. function instance
  48. qmult - queue length multiplier for high and super speed
  49. host_addr - MAC address of host's end of this
  50. Ethernet over USB link
  51. dev_addr - MAC address of device's end of this
  52. Ethernet over USB link
  53. and after creating the functions/ecm.<instance name> they contain default
  54. values: qmult is 5, dev_addr and host_addr are randomly selected.
  55. Except for ifname they can be written to until the function is linked to a
  56. configuration. The ifname is read-only and contains the name of the interface
  57. which was assigned by the net core, e. g. usb0.
  58. Testing the ECM function
  59. ------------------------
  60. Configure IP addresses of the device and the host. Then:
  61. On the device: ping <host's IP>
  62. On the host: ping <device's IP>
  63. 3. ECM subset function
  64. ======================
  65. The function is provided by usb_f_ecm_subset.ko module.
  66. Function-specific configfs interface
  67. ------------------------------------
  68. The function name to use when creating the function directory is "geth".
  69. The ECM subset function provides these attributes in its function directory:
  70. ifname - network device interface name associated with this
  71. function instance
  72. qmult - queue length multiplier for high and super speed
  73. host_addr - MAC address of host's end of this
  74. Ethernet over USB link
  75. dev_addr - MAC address of device's end of this
  76. Ethernet over USB link
  77. and after creating the functions/ecm.<instance name> they contain default
  78. values: qmult is 5, dev_addr and host_addr are randomly selected.
  79. Except for ifname they can be written to until the function is linked to a
  80. configuration. The ifname is read-only and contains the name of the interface
  81. which was assigned by the net core, e. g. usb0.
  82. Testing the ECM subset function
  83. -------------------------------
  84. Configure IP addresses of the device and the host. Then:
  85. On the device: ping <host's IP>
  86. On the host: ping <device's IP>
  87. 4. EEM function
  88. ===============
  89. The function is provided by usb_f_eem.ko module.
  90. Function-specific configfs interface
  91. ------------------------------------
  92. The function name to use when creating the function directory is "eem".
  93. The EEM function provides these attributes in its function directory:
  94. ifname - network device interface name associated with this
  95. function instance
  96. qmult - queue length multiplier for high and super speed
  97. host_addr - MAC address of host's end of this
  98. Ethernet over USB link
  99. dev_addr - MAC address of device's end of this
  100. Ethernet over USB link
  101. and after creating the functions/eem.<instance name> they contain default
  102. values: qmult is 5, dev_addr and host_addr are randomly selected.
  103. Except for ifname they can be written to until the function is linked to a
  104. configuration. The ifname is read-only and contains the name of the interface
  105. which was assigned by the net core, e. g. usb0.
  106. Testing the EEM function
  107. ------------------------
  108. Configure IP addresses of the device and the host. Then:
  109. On the device: ping <host's IP>
  110. On the host: ping <device's IP>
  111. 5. FFS function
  112. ===============
  113. The function is provided by usb_f_fs.ko module.
  114. Function-specific configfs interface
  115. ------------------------------------
  116. The function name to use when creating the function directory is "ffs".
  117. The function directory is intentionally empty and not modifiable.
  118. After creating the directory there is a new instance (a "device") of FunctionFS
  119. available in the system. Once a "device" is available, the user should follow
  120. the standard procedure for using FunctionFS (mount it, run the userspace
  121. process which implements the function proper). The gadget should be enabled
  122. by writing a suitable string to usb_gadget/<gadget>/UDC.
  123. Testing the FFS function
  124. ------------------------
  125. On the device: start the function's userspace daemon, enable the gadget
  126. On the host: use the USB function provided by the device
  127. 6. HID function
  128. ===============
  129. The function is provided by usb_f_hid.ko module.
  130. Function-specific configfs interface
  131. ------------------------------------
  132. The function name to use when creating the function directory is "hid".
  133. The HID function provides these attributes in its function directory:
  134. protocol - HID protocol to use
  135. report_desc - data to be used in HID reports, except data
  136. passed with /dev/hidg<X>
  137. report_length - HID report length
  138. subclass - HID subclass to use
  139. For a keyboard the protocol and the subclass are 1, the report_length is 8,
  140. while the report_desc is:
  141. $ hd my_report_desc
  142. 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.|
  143. 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.|
  144. 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....|
  145. 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...|
  146. 0000003f
  147. Such a sequence of bytes can be stored to the attribute with echo:
  148. $ echo -ne \\x05\\x01\\x09\\x06\\xa1.....
  149. Testing the HID function
  150. ------------------------
  151. Device:
  152. - create the gadget
  153. - connect the gadget to a host, preferably not the one used
  154. to control the gadget
  155. - run a program which writes to /dev/hidg<N>, e.g.
  156. a userspace program found in Documentation/usb/gadget_hid.txt:
  157. $ ./hid_gadget_test /dev/hidg0 keyboard
  158. Host:
  159. - observe the keystrokes from the gadget
  160. 7. LOOPBACK function
  161. ====================
  162. The function is provided by usb_f_ss_lb.ko module.
  163. Function-specific configfs interface
  164. ------------------------------------
  165. The function name to use when creating the function directory is "Loopback".
  166. The LOOPBACK function provides these attributes in its function directory:
  167. qlen - depth of loopback queue
  168. bulk_buflen - buffer length
  169. Testing the LOOPBACK function
  170. -----------------------------
  171. device: run the gadget
  172. host: test-usb (tools/usb/testusb.c)
  173. 8. MASS STORAGE function
  174. ========================
  175. The function is provided by usb_f_mass_storage.ko module.
  176. Function-specific configfs interface
  177. ------------------------------------
  178. The function name to use when creating the function directory is "mass_storage".
  179. The MASS STORAGE function provides these attributes in its directory:
  180. files:
  181. stall - Set to permit function to halt bulk endpoints.
  182. Disabled on some USB devices known not to work
  183. correctly. You should set it to true.
  184. num_buffers - Number of pipeline buffers. Valid numbers
  185. are 2..4. Available only if
  186. CONFIG_USB_GADGET_DEBUG_FILES is set.
  187. and a default lun.0 directory corresponding to SCSI LUN #0.
  188. A new lun can be added with mkdir:
  189. $ mkdir functions/mass_storage.0/partition.5
  190. Lun numbering does not have to be continuous, except for lun #0 which is
  191. created by default. A maximum of 8 luns can be specified and they all must be
  192. named following the <name>.<number> scheme. The numbers can be 0..8.
  193. Probably a good convention is to name the luns "lun.<number>",
  194. although it is not mandatory.
  195. In each lun directory there are the following attribute files:
  196. file - The path to the backing file for the LUN.
  197. Required if LUN is not marked as removable.
  198. ro - Flag specifying access to the LUN shall be
  199. read-only. This is implied if CD-ROM emulation
  200. is enabled as well as when it was impossible
  201. to open "filename" in R/W mode.
  202. removable - Flag specifying that LUN shall be indicated as
  203. being removable.
  204. cdrom - Flag specifying that LUN shall be reported as
  205. being a CD-ROM.
  206. nofua - Flag specifying that FUA flag
  207. in SCSI WRITE(10,12)
  208. Testing the MASS STORAGE function
  209. ---------------------------------
  210. device: connect the gadget, enable it
  211. host: dmesg, see the USB drives appear (if system configured to automatically
  212. mount)
  213. 9. MIDI function
  214. ================
  215. The function is provided by usb_f_midi.ko module.
  216. Function-specific configfs interface
  217. ------------------------------------
  218. The function name to use when creating the function directory is "midi".
  219. The MIDI function provides these attributes in its function directory:
  220. buflen - MIDI buffer length
  221. id - ID string for the USB MIDI adapter
  222. in_ports - number of MIDI input ports
  223. index - index value for the USB MIDI adapter
  224. out_ports - number of MIDI output ports
  225. qlen - USB read request queue length
  226. Testing the MIDI function
  227. -------------------------
  228. There are two cases: playing a mid from the gadget to
  229. the host and playing a mid from the host to the gadget.
  230. 1) Playing a mid from the gadget to the host
  231. host)
  232. $ arecordmidi -l
  233. Port Client name Port name
  234. 14:0 Midi Through Midi Through Port-0
  235. 24:0 MIDI Gadget MIDI Gadget MIDI 1
  236. $ arecordmidi -p 24:0 from_gadget.mid
  237. gadget)
  238. $ aplaymidi -l
  239. Port Client name Port name
  240. 20:0 f_midi f_midi
  241. $ aplaymidi -p 20:0 to_host.mid
  242. 2) Playing a mid from the host to the gadget
  243. gadget)
  244. $ arecordmidi -l
  245. Port Client name Port name
  246. 20:0 f_midi f_midi
  247. $ arecordmidi -p 20:0 from_host.mid
  248. host)
  249. $ aplaymidi -l
  250. Port Client name Port name
  251. 14:0 Midi Through Midi Through Port-0
  252. 24:0 MIDI Gadget MIDI Gadget MIDI 1
  253. $ aplaymidi -p24:0 to_gadget.mid
  254. The from_gadget.mid should sound identical to the to_host.mid.
  255. The from_host.id should sound identical to the to_gadget.mid.
  256. MIDI files can be played to speakers/headphones with e.g. timidity installed
  257. $ aplaymidi -l
  258. Port Client name Port name
  259. 14:0 Midi Through Midi Through Port-0
  260. 24:0 MIDI Gadget MIDI Gadget MIDI 1
  261. 128:0 TiMidity TiMidity port 0
  262. 128:1 TiMidity TiMidity port 1
  263. 128:2 TiMidity TiMidity port 2
  264. 128:3 TiMidity TiMidity port 3
  265. $ aplaymidi -p 128:0 file.mid
  266. MIDI ports can be logically connected using the aconnect utility, e.g.:
  267. $ aconnect 24:0 128:0 # try it on the host
  268. After the gadget's MIDI port is connected to timidity's MIDI port,
  269. whatever is played at the gadget side with aplaymidi -l is audible
  270. in host's speakers/headphones.
  271. 10. NCM function
  272. ================
  273. The function is provided by usb_f_ncm.ko module.
  274. Function-specific configfs interface
  275. ------------------------------------
  276. The function name to use when creating the function directory is "ncm".
  277. The NCM function provides these attributes in its function directory:
  278. ifname - network device interface name associated with this
  279. function instance
  280. qmult - queue length multiplier for high and super speed
  281. host_addr - MAC address of host's end of this
  282. Ethernet over USB link
  283. dev_addr - MAC address of device's end of this
  284. Ethernet over USB link
  285. and after creating the functions/ncm.<instance name> they contain default
  286. values: qmult is 5, dev_addr and host_addr are randomly selected.
  287. Except for ifname they can be written to until the function is linked to a
  288. configuration. The ifname is read-only and contains the name of the interface
  289. which was assigned by the net core, e. g. usb0.
  290. Testing the NCM function
  291. ------------------------
  292. Configure IP addresses of the device and the host. Then:
  293. On the device: ping <host's IP>
  294. On the host: ping <device's IP>
  295. 11. OBEX function
  296. =================
  297. The function is provided by usb_f_obex.ko module.
  298. Function-specific configfs interface
  299. ------------------------------------
  300. The function name to use when creating the function directory is "obex".
  301. The OBEX function provides just one attribute in its function directory:
  302. port_num
  303. The attribute is read-only.
  304. There can be at most 4 ACM/generic serial/OBEX ports in the system.
  305. Testing the OBEX function
  306. -------------------------
  307. On device: seriald -f /dev/ttyGS<Y> -s 1024
  308. On host: serialc -v <vendorID> -p <productID> -i<interface#> -a1 -s1024 \
  309. -t<out endpoint addr> -r<in endpoint addr>
  310. where seriald and serialc are Felipe's utilities found here:
  311. https://git.gitorious.org/usb/usb-tools.git master
  312. 12. PHONET function
  313. ===================
  314. The function is provided by usb_f_phonet.ko module.
  315. Function-specific configfs interface
  316. ------------------------------------
  317. The function name to use when creating the function directory is "phonet".
  318. The PHONET function provides just one attribute in its function directory:
  319. ifname - network device interface name associated with this
  320. function instance
  321. Testing the PHONET function
  322. ---------------------------
  323. It is not possible to test the SOCK_STREAM protocol without a specific piece
  324. of hardware, so only SOCK_DGRAM has been tested. For the latter to work,
  325. in the past I had to apply the patch mentioned here:
  326. http://www.spinics.net/lists/linux-usb/msg85689.html
  327. These tools are required:
  328. git://git.gitorious.org/meego-cellular/phonet-utils.git
  329. On the host:
  330. $ ./phonet -a 0x10 -i usbpn0
  331. $ ./pnroute add 0x6c usbpn0
  332. $./pnroute add 0x10 usbpn0
  333. $ ifconfig usbpn0 up
  334. On the device:
  335. $ ./phonet -a 0x6c -i upnlink0
  336. $ ./pnroute add 0x10 upnlink0
  337. $ ifconfig upnlink0 up
  338. Then a test program can be used:
  339. http://www.spinics.net/lists/linux-usb/msg85690.html
  340. On the device:
  341. $ ./pnxmit -a 0x6c -r
  342. On the host:
  343. $ ./pnxmit -a 0x10 -s 0x6c
  344. As a result some data should be sent from host to device.
  345. Then the other way round:
  346. On the host:
  347. $ ./pnxmit -a 0x10 -r
  348. On the device:
  349. $ ./pnxmit -a 0x6c -s 0x10
  350. 13. RNDIS function
  351. ==================
  352. The function is provided by usb_f_rndis.ko module.
  353. Function-specific configfs interface
  354. ------------------------------------
  355. The function name to use when creating the function directory is "rndis".
  356. The RNDIS function provides these attributes in its function directory:
  357. ifname - network device interface name associated with this
  358. function instance
  359. qmult - queue length multiplier for high and super speed
  360. host_addr - MAC address of host's end of this
  361. Ethernet over USB link
  362. dev_addr - MAC address of device's end of this
  363. Ethernet over USB link
  364. and after creating the functions/rndis.<instance name> they contain default
  365. values: qmult is 5, dev_addr and host_addr are randomly selected.
  366. Except for ifname they can be written to until the function is linked to a
  367. configuration. The ifname is read-only and contains the name of the interface
  368. which was assigned by the net core, e. g. usb0.
  369. Testing the RNDIS function
  370. --------------------------
  371. Configure IP addresses of the device and the host. Then:
  372. On the device: ping <host's IP>
  373. On the host: ping <device's IP>
  374. 14. SERIAL function
  375. ===================
  376. The function is provided by usb_f_gser.ko module.
  377. Function-specific configfs interface
  378. ------------------------------------
  379. The function name to use when creating the function directory is "gser".
  380. The SERIAL function provides just one attribute in its function directory:
  381. port_num
  382. The attribute is read-only.
  383. There can be at most 4 ACM/generic serial/OBEX ports in the system.
  384. Testing the SERIAL function
  385. ---------------------------
  386. On host: insmod usbserial
  387. echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id
  388. On host: cat > /dev/ttyUSB<X>
  389. On target: cat /dev/ttyGS<Y>
  390. then the other way round
  391. On target: cat > /dev/ttyGS<Y>
  392. On host: cat /dev/ttyUSB<X>
  393. 15. SOURCESINK function
  394. =======================
  395. The function is provided by usb_f_ss_lb.ko module.
  396. Function-specific configfs interface
  397. ------------------------------------
  398. The function name to use when creating the function directory is "SourceSink".
  399. The SOURCESINK function provides these attributes in its function directory:
  400. pattern - 0 (all zeros), 1 (mod63), 2 (none)
  401. isoc_interval - 1..16
  402. isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss)
  403. isoc_mult - 0..2 (hs/ss only)
  404. isoc_maxburst - 0..15 (ss only)
  405. bulk_buflen - buffer length
  406. Testing the SOURCESINK function
  407. -------------------------------
  408. device: run the gadget
  409. host: test-usb (tools/usb/testusb.c)
  410. 16. UAC1 function
  411. =================
  412. The function is provided by usb_f_uac1.ko module.
  413. Function-specific configfs interface
  414. ------------------------------------
  415. The function name to use when creating the function directory is "uac1".
  416. The uac1 function provides these attributes in its function directory:
  417. audio_buf_size - audio buffer size
  418. fn_cap - capture pcm device file name
  419. fn_cntl - control device file name
  420. fn_play - playback pcm device file name
  421. req_buf_size - ISO OUT endpoint request buffer size
  422. req_count - ISO OUT endpoint request count
  423. The attributes have sane default values.
  424. Testing the UAC1 function
  425. -------------------------
  426. device: run the gadget
  427. host: aplay -l # should list our USB Audio Gadget
  428. 17. UAC2 function
  429. =================
  430. The function is provided by usb_f_uac2.ko module.
  431. Function-specific configfs interface
  432. ------------------------------------
  433. The function name to use when creating the function directory is "uac2".
  434. The uac2 function provides these attributes in its function directory:
  435. c_chmask - capture channel mask
  436. c_srate - capture sampling rate
  437. c_ssize - capture sample size (bytes)
  438. p_chmask - playback channel mask
  439. p_srate - playback sampling rate
  440. p_ssize - playback sample size (bytes)
  441. The attributes have sane default values.
  442. Testing the UAC2 function
  443. -------------------------
  444. device: run the gadget
  445. host: aplay -l # should list our USB Audio Gadget
  446. This function does not require real hardware support, it just
  447. sends a stream of audio data to/from the host. In order to
  448. actually hear something at the device side, a command similar
  449. to this must be used at the device side:
  450. $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &
  451. e.g.:
  452. $ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \
  453. aplay -D default:CARD=OdroidU3
  454. 18. UVC function
  455. ================
  456. The function is provided by usb_f_uvc.ko module.
  457. Function-specific configfs interface
  458. ------------------------------------
  459. The function name to use when creating the function directory is "uvc".
  460. The uvc function provides these attributes in its function directory:
  461. streaming_interval - interval for polling endpoint for data transfers
  462. streaming_maxburst - bMaxBurst for super speed companion descriptor
  463. streaming_maxpacket - maximum packet size this endpoint is capable of
  464. sending or receiving when this configuration is
  465. selected
  466. There are also "control" and "streaming" subdirectories, each of which contain
  467. a number of their subdirectories. There are some sane defaults provided, but
  468. the user must provide the following:
  469. control header - create in control/header, link from control/class/fs
  470. and/or control/class/ss
  471. streaming header - create in streaming/header, link from
  472. streaming/class/fs and/or streaming/class/hs and/or
  473. streaming/class/ss
  474. format description - create in streaming/mjpeg and/or
  475. streaming/uncompressed
  476. frame description - create in streaming/mjpeg/<format> and/or in
  477. streaming/uncompressed/<format>
  478. Each frame description contains frame interval specification, and each
  479. such specification consists of a number of lines with an inverval value
  480. in each line. The rules stated above are best illustrated with an example:
  481. # mkdir functions/uvc.usb0/control/header/h
  482. # cd functions/uvc.usb0/control/header/h
  483. # ln -s header/h class/fs
  484. # ln -s header/h class/ss
  485. # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p
  486. # cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval
  487. 666666
  488. 1000000
  489. 5000000
  490. EOF
  491. # cd $GADGET_CONFIGFS_ROOT
  492. # mkdir functions/uvc.usb0/streaming/header/h
  493. # cd functions/uvc.usb0/streaming/header/h
  494. # ln -s ../../uncompressed/u
  495. # cd ../../class/fs
  496. # ln -s ../../header/h
  497. # cd ../../class/hs
  498. # ln -s ../../header/h
  499. # cd ../../class/ss
  500. # ln -s ../../header/h
  501. Testing the UVC function
  502. ------------------------
  503. device: run the gadget, modprobe vivid
  504. # uvc-gadget -u /dev/video<uvc video node #> -v /dev/video<vivid video node #>
  505. where uvc-gadget is this program:
  506. http://git.ideasonboard.org/uvc-gadget.git
  507. with these patches:
  508. http://www.spinics.net/lists/linux-usb/msg99220.html
  509. host: luvcview -f yuv
  510. 19. PRINTER function
  511. ====================
  512. The function is provided by usb_f_printer.ko module.
  513. Function-specific configfs interface
  514. ------------------------------------
  515. The function name to use when creating the function directory is "printer".
  516. The printer function provides these attributes in its function directory:
  517. pnp_string - Data to be passed to the host in pnp string
  518. q_len - Number of requests per endpoint
  519. Testing the PRINTER function
  520. ----------------------------
  521. The most basic testing:
  522. device: run the gadget
  523. # ls -l /devices/virtual/usb_printer_gadget/
  524. should show g_printer<number>.
  525. If udev is active, then /dev/g_printer<number> should appear automatically.
  526. host:
  527. If udev is active, then e.g. /dev/usb/lp0 should appear.
  528. host->device transmission:
  529. device:
  530. # cat /dev/g_printer<number>
  531. host:
  532. # cat > /dev/usb/lp0
  533. device->host transmission:
  534. # cat > /dev/g_printer<number>
  535. host:
  536. # cat /dev/usb/lp0
  537. More advanced testing can be done with the prn_example
  538. described in Documentation/usb/gadget-printer.txt.