USB Gadget

After several fixes to our kernel, support for USB On-The-Go is working on sunxi. We can now use OTG and device ports to do some interesting things.

= USB Ethernet support =

This allows ethernet emulation over USB, allowing for all sorts of nifty things like SSH and NFS in one go plus charging over the same wire, at higher speeds than most Wifi connections.

Kernel support
Currently, the g_ether module is not compiled as part of our kernel configuration.

To enable this, follow the kernel building information of our first steps guide. But then after making defconfig, either run: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

Then trawl down the options and set the "Ethernet Gadget" to "m": Device Drivers ---> USB support ---> USB Gadget Support --->     Ethernet Gadget (with CDC Ethernet support) Or just run: ./scripts/config -m CONFIG_USB_ETH -e CONFIG_USB_ETH_RNDIS

You can now continue following our first steps guide to continue kernel compilation and installation.

Setting up the USB ether device
We should now be able to run: modprobe g_ether successfully. We can then make this module autoload by adding it to /etc/modules.

Now we just need to set up networking to match, add the following to /etc/network/interfaces: auto usb0 iface usb0 inet static address 192.168.0.2 netmask 255.255.255.0

For this to work reliably, you might need to disable networkmanager, as it does not play nice with Debian ifupdown.

Setting up the host
You can convince networkmanager to connect automatically to a specific MAC address, and then you need to hardcode the address to 192.168.0.1 for this connection.

If all goes well, you should now be able to just plug in the USB cable.

= USB storage support =

TODO.