全部博文(153)
分类: LINUX
2008-12-31 10:58:04
USB, as general purpose host-to-device (master-to-slave) I/O bus protocol, can easily carry network traffic, multiplexing it along with all the other bus traffic. This can be done directly, or with one of the many widely available USB-to-network adapter products for networks like Ethernet, ATM, DSL, POTS, ISDN, and cable TV. There are several USB class standards for such adapters, and many proprietary approaches too.
This web page describes how to use the Linux usbnet driver, CONFIG_USB_USBNET in most Linux 2.4 (or later) kernels. This driver originally (2.4.early) focussed only on supporting less conventional types of USB networking devices. In current Linux it's now a generalized core, supporting several kinds of network devices running under Linux with "minidrivers", which are separate modules that can be as small as a pair of static data tables.
It makes sense to have a common driver core because only a handful of control and setup operations really need product- or class-specific code. Most of the driver handles i/o queues and USB faults, which can easily be product-neutral. And for some reason, vendors seem to dislike using standard framing in their Windows drivers, so many minidrivers need to wrap a technically-unnecessary layer of headers around Ethernet packets for better interoperability.
Another approach to using IP over USB is to make the device look like a serial line or telecommunications modem, and then run PPP over those protocols. This document doesn't address those approaches, used sometimes with USB drivers such as cdc_acm, usb-serial, and with adapters to IRDA or BlueTooth stacks.