User's Manual

www.openmoko.com
33
former instruction asks the OS running under the emulator (OpenMoko) to
describe its slave features (that's what lsusb does after a Neo1973 is
connected to a PC). You can see the available USB configurations in this
command's output. Since gadgetfs allows only one configuration, we will
need to choose the desired configuration - most device have only one such
configuration, in which case you can use just "usb_add gadget" to connect
to host; CDC ethernet devices however usually include a second
configuration for RNDIS networking (i.e. Ms Windows compatibility) and so
does OpenMoko when using the g_ether driver. Hence, to get this right,
wait for OpenMoko to fully boot up and execute the following in QEMU
monitor:
QEMU 0.9.0 monitor - type 'help' for more information
(qemu) info usbslave
USB2.2 device 1457:5122:
Manufacturer: Linux 2.6.20.7-moko8/s3c2410_udc
Product: RNDIS/Ethernet Gadget
Configuration 0: RNDIS
Configuration 1: CDC Ethernet
(qemu)
(qemu) usb_add gadget:1
If qemu gives "couldn't add device gadget:1", double-check that it was
built against gadgetfs - the file config-host.h must contain the line
"#define CONFIG_GADGETFS 1".
The "1" in "usb_add gadget:N" is the number of the USB configuration that
we want to use. If everything went correctly - you can check that in dmesg
- you should now have a new network interface called usb0 on the PC,
through which you can talk to the OpenMoko running in QEMU:
$ dmesg | tail
<6>gadgetfs: bound to dummy_udc driver
<7>hub 3-0:1.0: debounce: port 1: total 100ms stable 100ms status
0x101
<6>usb 3-1: new high speed USB device using dummy_hcd and address 3
<6>gadgetfs: connected
<7>usb 3-1: default language 0x0409
<7>usb 3-1: new device strings: Mfr=1, Product=2, SerialNumber=0