gadget-testing.txt 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  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
  173. http://www.linux-usb.org/usbtest/testusb.c
  174. 8. MASS STORAGE function
  175. ========================
  176. The function is provided by usb_f_mass_storage.ko module.
  177. Function-specific configfs interface
  178. ------------------------------------
  179. The function name to use when creating the function directory is "mass_storage".
  180. The MASS STORAGE function provides these attributes in its directory:
  181. files:
  182. stall - Set to permit function to halt bulk endpoints.
  183. Disabled on some USB devices known not to work
  184. correctly. You should set it to true.
  185. num_buffers - Number of pipeline buffers. Valid numbers
  186. are 2..4. Available only if
  187. CONFIG_USB_GADGET_DEBUG_FILES is set.
  188. and a default lun.0 directory corresponding to SCSI LUN #0.
  189. A new lun can be added with mkdir:
  190. $ mkdir functions/mass_storage.0/partition.5
  191. Lun numbering does not have to be continuous, except for lun #0 which is
  192. created by default. A maximum of 8 luns can be specified and they all must be
  193. named following the <name>.<number> scheme. The numbers can be 0..8.
  194. Probably a good convention is to name the luns "lun.<number>",
  195. although it is not mandatory.
  196. In each lun directory there are the following attribute files:
  197. file - The path to the backing file for the LUN.
  198. Required if LUN is not marked as removable.
  199. ro - Flag specifying access to the LUN shall be
  200. read-only. This is implied if CD-ROM emulation
  201. is enabled as well as when it was impossible
  202. to open "filename" in R/W mode.
  203. removable - Flag specifying that LUN shall be indicated as
  204. being removable.
  205. cdrom - Flag specifying that LUN shall be reported as
  206. being a CD-ROM.
  207. nofua - Flag specifying that FUA flag
  208. in SCSI WRITE(10,12)
  209. Testing the MASS STORAGE function
  210. ---------------------------------
  211. device: connect the gadget, enable it
  212. host: dmesg, see the USB drives appear (if system configured to automatically
  213. mount)
  214. 9. MIDI function
  215. ================
  216. The function is provided by usb_f_midi.ko module.
  217. Function-specific configfs interface
  218. ------------------------------------
  219. The function name to use when creating the function directory is "midi".
  220. The MIDI function provides these attributes in its function directory:
  221. buflen - MIDI buffer length
  222. id - ID string for the USB MIDI adapter
  223. in_ports - number of MIDI input ports
  224. index - index value for the USB MIDI adapter
  225. out_ports - number of MIDI output ports
  226. qlen - USB read request queue length
  227. Testing the MIDI function
  228. -------------------------
  229. There are two cases: playing a mid from the gadget to
  230. the host and playing a mid from the host to the gadget.
  231. 1) Playing a mid from the gadget to the host
  232. host)
  233. $ arecordmidi -l
  234. Port Client name Port name
  235. 14:0 Midi Through Midi Through Port-0
  236. 24:0 MIDI Gadget MIDI Gadget MIDI 1
  237. $ arecordmidi -p 24:0 from_gadget.mid
  238. gadget)
  239. $ aplaymidi -l
  240. Port Client name Port name
  241. 20:0 f_midi f_midi
  242. $ aplaymidi -p 20:0 to_host.mid
  243. 2) Playing a mid from the host to the gadget
  244. gadget)
  245. $ arecordmidi -l
  246. Port Client name Port name
  247. 20:0 f_midi f_midi
  248. $ arecordmidi -p 20:0 from_host.mid
  249. host)
  250. $ aplaymidi -l
  251. Port Client name Port name
  252. 14:0 Midi Through Midi Through Port-0
  253. 24:0 MIDI Gadget MIDI Gadget MIDI 1
  254. $ aplaymidi -p24:0 to_gadget.mid
  255. The from_gadget.mid should sound identical to the to_host.mid.
  256. The from_host.id should sound identical to the to_gadget.mid.
  257. MIDI files can be played to speakers/headphones with e.g. timidity installed
  258. $ aplaymidi -l
  259. Port Client name Port name
  260. 14:0 Midi Through Midi Through Port-0
  261. 24:0 MIDI Gadget MIDI Gadget MIDI 1
  262. 128:0 TiMidity TiMidity port 0
  263. 128:1 TiMidity TiMidity port 1
  264. 128:2 TiMidity TiMidity port 2
  265. 128:3 TiMidity TiMidity port 3
  266. $ aplaymidi -p 128:0 file.mid
  267. MIDI ports can be logically connected using the aconnect utility, e.g.:
  268. $ aconnect 24:0 128:0 # try it on the host
  269. After the gadget's MIDI port is connected to timidity's MIDI port,
  270. whatever is played at the gadget side with aplaymidi -l is audible
  271. in host's speakers/headphones.
  272. 10. NCM function
  273. ================
  274. The function is provided by usb_f_ncm.ko module.
  275. Function-specific configfs interface
  276. ------------------------------------
  277. The function name to use when creating the function directory is "ncm".
  278. The NCM function provides these attributes in its function directory:
  279. ifname - network device interface name associated with this
  280. function instance
  281. qmult - queue length multiplier for high and super speed
  282. host_addr - MAC address of host's end of this
  283. Ethernet over USB link
  284. dev_addr - MAC address of device's end of this
  285. Ethernet over USB link
  286. and after creating the functions/ncm.<instance name> they contain default
  287. values: qmult is 5, dev_addr and host_addr are randomly selected.
  288. Except for ifname they can be written to until the function is linked to a
  289. configuration. The ifname is read-only and contains the name of the interface
  290. which was assigned by the net core, e. g. usb0.
  291. Testing the NCM function
  292. ------------------------
  293. Configure IP addresses of the device and the host. Then:
  294. On the device: ping <host's IP>
  295. On the host: ping <device's IP>
  296. 11. OBEX function
  297. =================
  298. The function is provided by usb_f_obex.ko module.
  299. Function-specific configfs interface
  300. ------------------------------------
  301. The function name to use when creating the function directory is "obex".
  302. The OBEX function provides just one attribute in its function directory:
  303. port_num
  304. The attribute is read-only.
  305. There can be at most 4 ACM/generic serial/OBEX ports in the system.
  306. Testing the OBEX function
  307. -------------------------
  308. On device: seriald -f /dev/ttyGS<Y> -s 1024
  309. On host: serialc -v <vendorID> -p <productID> -i<interface#> -a1 -s1024 \
  310. -t<out endpoint addr> -r<in endpoint addr>
  311. where seriald and serialc are Felipe's utilities found here:
  312. https://git.gitorious.org/usb/usb-tools.git master
  313. 12. PHONET function
  314. ===================
  315. The function is provided by usb_f_phonet.ko module.
  316. Function-specific configfs interface
  317. ------------------------------------
  318. The function name to use when creating the function directory is "phonet".
  319. The PHONET function provides just one attribute in its function directory:
  320. ifname - network device interface name associated with this
  321. function instance
  322. Testing the PHONET function
  323. ---------------------------
  324. It is not possible to test the SOCK_STREAM protocol without a specific piece
  325. of hardware, so only SOCK_DGRAM has been tested. For the latter to work,
  326. in the past I had to apply the patch mentioned here:
  327. http://www.spinics.net/lists/linux-usb/msg85689.html
  328. These tools are required:
  329. git://git.gitorious.org/meego-cellular/phonet-utils.git
  330. On the host:
  331. $ ./phonet -a 0x10 -i usbpn0
  332. $ ./pnroute add 0x6c usbpn0
  333. $./pnroute add 0x10 usbpn0
  334. $ ifconfig usbpn0 up
  335. On the device:
  336. $ ./phonet -a 0x6c -i upnlink0
  337. $ ./pnroute add 0x10 upnlink0
  338. $ ifconfig upnlink0 up
  339. Then a test program can be used:
  340. http://www.spinics.net/lists/linux-usb/msg85690.html
  341. On the device:
  342. $ ./pnxmit -a 0x6c -r
  343. On the host:
  344. $ ./pnxmit -a 0x10 -s 0x6c
  345. As a result some data should be sent from host to device.
  346. Then the other way round:
  347. On the host:
  348. $ ./pnxmit -a 0x10 -r
  349. On the device:
  350. $ ./pnxmit -a 0x6c -s 0x10
  351. 13. RNDIS function
  352. ==================
  353. The function is provided by usb_f_rndis.ko module.
  354. Function-specific configfs interface
  355. ------------------------------------
  356. The function name to use when creating the function directory is "rndis".
  357. The RNDIS function provides these attributes in its function directory:
  358. ifname - network device interface name associated with this
  359. function instance
  360. qmult - queue length multiplier for high and super speed
  361. host_addr - MAC address of host's end of this
  362. Ethernet over USB link
  363. dev_addr - MAC address of device's end of this
  364. Ethernet over USB link
  365. and after creating the functions/rndis.<instance name> they contain default
  366. values: qmult is 5, dev_addr and host_addr are randomly selected.
  367. Except for ifname they can be written to until the function is linked to a
  368. configuration. The ifname is read-only and contains the name of the interface
  369. which was assigned by the net core, e. g. usb0.
  370. Testing the RNDIS function
  371. --------------------------
  372. Configure IP addresses of the device and the host. Then:
  373. On the device: ping <host's IP>
  374. On the host: ping <device's IP>
  375. 14. SERIAL function
  376. ===================
  377. The function is provided by usb_f_gser.ko module.
  378. Function-specific configfs interface
  379. ------------------------------------
  380. The function name to use when creating the function directory is "gser".
  381. The SERIAL function provides just one attribute in its function directory:
  382. port_num
  383. The attribute is read-only.
  384. There can be at most 4 ACM/generic serial/OBEX ports in the system.
  385. Testing the SERIAL function
  386. ---------------------------
  387. On host: insmod usbserial
  388. echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id
  389. On host: cat > /dev/ttyUSB<X>
  390. On target: cat /dev/ttyGS<Y>
  391. then the other way round
  392. On target: cat > /dev/ttyGS<Y>
  393. On host: cat /dev/ttyUSB<X>
  394. 15. SOURCESINK function
  395. =======================
  396. The function is provided by usb_f_ss_lb.ko module.
  397. Function-specific configfs interface
  398. ------------------------------------
  399. The function name to use when creating the function directory is "SourceSink".
  400. The SOURCESINK function provides these attributes in its function directory:
  401. pattern - 0 (all zeros), 1 (mod63), 2 (none)
  402. isoc_interval - 1..16
  403. isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss)
  404. isoc_mult - 0..2 (hs/ss only)
  405. isoc_maxburst - 0..15 (ss only)
  406. bulk_buflen - buffer length
  407. Testing the SOURCESINK function
  408. -------------------------------
  409. device: run the gadget
  410. host: test-usb
  411. http://www.linux-usb.org/usbtest/testusb.c
  412. 16. UAC1 function
  413. =================
  414. The function is provided by usb_f_uac1.ko module.
  415. Function-specific configfs interface
  416. ------------------------------------
  417. The function name to use when creating the function directory is "uac1".
  418. The uac1 function provides these attributes in its function directory:
  419. audio_buf_size - audio buffer size
  420. fn_cap - capture pcm device file name
  421. fn_cntl - control device file name
  422. fn_play - playback pcm device file name
  423. req_buf_size - ISO OUT endpoint request buffer size
  424. req_count - ISO OUT endpoint request count
  425. The attributes have sane default values.
  426. Testing the UAC1 function
  427. -------------------------
  428. device: run the gadget
  429. host: aplay -l # should list our USB Audio Gadget
  430. 17. UAC2 function
  431. =================
  432. The function is provided by usb_f_uac2.ko module.
  433. Function-specific configfs interface
  434. ------------------------------------
  435. The function name to use when creating the function directory is "uac2".
  436. The uac2 function provides these attributes in its function directory:
  437. c_chmask - capture channel mask
  438. c_srate - capture sampling rate
  439. c_ssize - capture sample size (bytes)
  440. p_chmask - playback channel mask
  441. p_srate - playback sampling rate
  442. p_ssize - playback sample size (bytes)
  443. The attributes have sane default values.
  444. Testing the UAC2 function
  445. -------------------------
  446. device: run the gadget
  447. host: aplay -l # should list our USB Audio Gadget
  448. This function does not require real hardware support, it just
  449. sends a stream of audio data to/from the host. In order to
  450. actually hear something at the device side, a command similar
  451. to this must be used at the device side:
  452. $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &
  453. e.g.:
  454. $ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \
  455. aplay -D default:CARD=OdroidU3
  456. 18. UVC function
  457. ================
  458. The function is provided by usb_f_uvc.ko module.
  459. Function-specific configfs interface
  460. ------------------------------------
  461. The function name to use when creating the function directory is "uvc".
  462. The uvc function provides these attributes in its function directory:
  463. streaming_interval - interval for polling endpoint for data transfers
  464. streaming_maxburst - bMaxBurst for super speed companion descriptor
  465. streaming_maxpacket - maximum packet size this endpoint is capable of
  466. sending or receiving when this configuration is
  467. selected
  468. There are also "control" and "streaming" subdirectories, each of which contain
  469. a number of their subdirectories. There are some sane defaults provided, but
  470. the user must provide the following:
  471. control header - create in control/header, link from control/class/fs
  472. and/or control/class/ss
  473. streaming header - create in streaming/header, link from
  474. streaming/class/fs and/or streaming/class/hs and/or
  475. streaming/class/ss
  476. format description - create in streaming/mjpeg and/or
  477. streaming/uncompressed
  478. frame description - create in streaming/mjpeg/<format> and/or in
  479. streaming/uncompressed/<format>
  480. Each frame description contains frame interval specification, and each
  481. such specification consists of a number of lines with an inverval value
  482. in each line. The rules stated above are best illustrated with an example:
  483. # mkdir functions/uvc.usb0/control/header/h
  484. # cd functions/uvc.usb0/control/header/h
  485. # ln -s header/h class/fs
  486. # ln -s header/h class/ss
  487. # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p
  488. # cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval
  489. 666666
  490. 1000000
  491. 5000000
  492. EOF
  493. # cd $GADGET_CONFIGFS_ROOT
  494. # mkdir functions/uvc.usb0/streaming/header/h
  495. # cd functions/uvc.usb0/streaming/header/h
  496. # ln -s ../../uncompressed/u
  497. # cd ../../class/fs
  498. # ln -s ../../header/h
  499. # cd ../../class/hs
  500. # ln -s ../../header/h
  501. # cd ../../class/ss
  502. # ln -s ../../header/h
  503. Testing the UVC function
  504. ------------------------
  505. device: run the gadget, modprobe vivid
  506. # uvc-gadget -u /dev/video<uvc video node #> -v /dev/video<vivid video node #>
  507. where uvc-gadget is this program:
  508. http://git.ideasonboard.org/uvc-gadget.git
  509. with these patches:
  510. http://www.spinics.net/lists/linux-usb/msg99220.html
  511. host: luvcview -f yuv
  512. 19. PRINTER function
  513. ====================
  514. The function is provided by usb_f_printer.ko module.
  515. Function-specific configfs interface
  516. ------------------------------------
  517. The function name to use when creating the function directory is "printer".
  518. The printer function provides these attributes in its function directory:
  519. pnp_string - Data to be passed to the host in pnp string
  520. q_len - Number of requests per endpoint
  521. Testing the PRINTER function
  522. ----------------------------
  523. The most basic testing:
  524. device: run the gadget
  525. # ls -l /devices/virtual/usb_printer_gadget/
  526. should show g_printer<number>.
  527. If udev is active, then /dev/g_printer<number> should appear automatically.
  528. host:
  529. If udev is active, then e.g. /dev/usb/lp0 should appear.
  530. host->device transmission:
  531. device:
  532. # cat /dev/g_printer<number>
  533. host:
  534. # cat > /dev/usb/lp0
  535. device->host transmission:
  536. # cat > /dev/g_printer<number>
  537. host:
  538. # cat /dev/usb/lp0
  539. More advanced testing can be done with the prn_example
  540. described in Documentation/usb/gadget-printer.txt.