The USB bus in Linux
As already stated, both USB host and USB device exist, and the same is valid for the Linux kernel where we can find dedicated device drivers for both types. The only difference is that in the kernel, USB devices are named USB gadgets to avoid misunderstanding with the typical meaning of the word device.
USB hosts are all those devices that act as a master in a USB communication. Typically, a PC or an embedded computer acts as a master, but an embedded computer can act as a USB gadget too! If you recall what we saw in Chapter 1, Installing a Development System , where we described how to set up our embedded devices, embedded kits were the USB gadgets while the host PC was the USB host.
The USB communication is very simple: there is a master that polls the various peripheral devices. This poll is done using several channels called endpoints that can carry data in one direction only, either from the host computer to the device (so, the endpoint is called OUT endpoint) or...