Introduction, Name, Usage scenarios – Comtrol eCos User Manual
Page 731

Introduction
Name
Introduction
— eCos support for developing USB ethernet peripherals
Introduction
The eCos USB-ethernet package provides additional support for USB peripherals that involve some sort of ethernet-
style network. This can be a traditional ethernet, or it can involve some other networking technology that uses
ethernet frames as a unit of transfer. It provides functions to transfer ethernet frames over the USB bus, handles
certain control messages from the host, and optionally it can provide a network device driver for use by the eCos
TCP/IP stack. The package comes with an example host-side device driver.
The USB-ethernet package is not tied to any specific hardware. It requires the presence of USB hardware and
a suitable device driver, but not all USB peripherals involve ethernet communications. Hence the configuration
system cannot load the package automatically for specific targets, in the way that a USB device driver or an ethernet
driver can be loaded automatically. Instead, the package has to be added explicitly. When using the command line
tools this will involve an operation like the following:
$ ecosconfig add usbs_eth
Typically, this will automatically cause the USB device driver to become active. Loading the USB-ethernet package
automatically provides functionality for
,
, and the handling of
and state
changes. If the current configuration includes the eCos TCP/IP stack then the
support will
be enabled as well by default, allowing the stack to exchange ethernet frames over the USB bus.
There is a USB standard for a class of communication devices including ethernet. The package does not implement
this standard, due to limitations in the hardware for which the package was first developed. Instead, the package
uses its own
between USB
and the peripheral.
Usage Scenarios
The USB-ethernet package can be used several different scenarios. In a simple scenario, the peripheral serves only
to connect the USB host to a suitable network:
After initialization, and once the USB connection between host and peripheral has been established, higher-level
code needs to detect packets that are intended for the host, and to forward these. This can be achieved by the
low-level
usbs_eth_start_tx
function. Similarly, higher-level code needs to detect packets coming from the
host, using
usbs_eth_start_rx
, and to forward these using the real network. As far as the host is concerned it
is connected directly to the network. In this scenario there is no confusion about addresses: there is a single MAC
627