⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbseth-intro.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Introduction</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="eCos Support for Developing USB-ethernet Peripherals"HREF="io-usb-slave-eth.html"><LINKREL="PREVIOUS"TITLE="eCos Support for Developing USB-ethernet Peripherals"HREF="io-usb-slave-eth.html"><LINKREL="NEXT"TITLE="Initializing the USB-ethernet Package"HREF="usbseth-init.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="io-usb-slave-eth.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="usbseth-init.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="USBSETH-INTRO">Introduction</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN17361"></A><H2>Name</H2>Introduction&nbsp;--&nbsp;eCos support for developing USB ethernet peripherals</DIV><DIVCLASS="REFSECT1"><ANAME="AEN17364"></A><H2>Introduction</H2><P>The eCos USB-ethernet package provides additional support for USBperipherals that involve some sort of ethernet-style network. This canbe a traditional ethernet, or it can involve some other networkingtechnology that uses ethernet frames as a unit of transfer. Itprovides functions to transfer ethernet frames over the USB bus,handles certain control messages from the host, and optionally it canprovide a network device driver for use by the eCos TCP/IP stack.The package comes with an example host-side device driver.</P><P>The USB-ethernet package is not tied to any specific hardware. Itrequires the presence of USB hardware and a suitable device driver,but not all USB peripherals involve ethernet communications. Hence theconfiguration system cannot load the package automatically forspecific targets, in the way that a USB device driver or an ethernetdriver can be loaded automatically. Instead, the package has to beadded explicitly. When using the command line tools this will involvean operation like the following:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ ecosconfig add usbs_eth</PRE></TD></TR></TABLE><P>Typically, this will automatically cause the USB device driver tobecome active. Loading the USB-ethernet package automatically providesfunctionality for <AHREF="usbseth-init.html">initialization</A>,<AHREF="usbseth-data.html">data transfer</A>, and the handling of<AHREF="usbseth-control.html">control messages</A> and statechanges. If the current configuration includes the eCos TCP/IP stackthen the <AHREF="usbseth-netdev.html">network device driver</A>support will be enabled as well by default, allowing the stack toexchange ethernet frames over the USB bus.</P><P>There is a USB standard for a class of communication devices includingethernet. The package does not implement this standard, due tolimitations in the hardware for which the package was first developed.Instead, the package uses its own <AHREF="usbseth-protocol.html">protocol</A> between USB<AHREF="usbseth-host.html">host device driver</A> and theperipheral. </P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN17377"></A><H2>Usage Scenarios</H2><P>The USB-ethernet package can be used several different scenarios. Ina simple scenario, the peripheral serves only to connect the USB hostto a suitable network:</P><DIVCLASS="INFORMALFIGURE"><ANAME="AEN17380"><P></P><DIVCLASS="MEDIAOBJECT"><P><IMGSRC="simple.png"ALIGN="CENTER"></P></DIV><P></P></DIV><P>After initialization, and once the USB connection between host andperipheral has been established, higher-level code needs to detectpackets that are intended for the host, and to forward these. This canbe achieved by the low-level <TTCLASS="FUNCTION">usbs_eth_start_tx</TT>function. Similarly, higher-level code needs to detect packets comingfrom the host, using <TTCLASS="FUNCTION">usbs_eth_start_rx</TT>, and toforward these using the real network. As far as the host is concernedit is connected directly to the network. In this scenario there is noconfusion about addresses: there is a single MAC address for thehost/peripheral combination, corresponding to the connection to thereal network, and it is this address which should be supplied during<AHREF="usbseth-init.html">initialization</A>.</P><P>In a more complicated scenario, there is a TCP/IP stack running insidethe peripheral.</P><DIVCLASS="INFORMALFIGURE"><ANAME="AEN17389"><P></P><DIVCLASS="MEDIAOBJECT"><P><IMGSRC="tcpip.png"ALIGN="CENTER"></P></DIV><P></P></DIV><P>This involves the USB-ethernet package providing a service both to thehost and to the eCos TCP/IP stack. It achieves the latter by acting asan eCos network device. Typically, the TCP/IP stack will be configuredto act as a network bridge. The USB peripheral needs to examine thepackets arriving over the real network. Some of these packets will beintended for the host, while others will be intended for theperipheral itself. To distinguish between these two scenarios, twodistinct MAC addresses are needed: one for the host, and one for theperipheral. Similarly, packets sent by the host may have to beforwarded via the real network, or they may be intended for the TCP/IPstack inside the peripheral. Packets generated inside the peripheral'sTCP/IP stack may need to be sent via the real network or over the USBbus. The network bridge software will have to take care of all thesepossibilities. Unusually for a network bridge, one of the networksegments being bridged will only ever have one machine attached.</P><P>There are other possible usage scenarios. For example, the peripheralmight not be attached to a real network at all. Instead it could bethe USB host that acts as a network bridge, allowing a TCP/IP stackinside the peripheral to communicate with the outside world. Thevarious details will depend on the exact type of peripheral beingdeveloped. </P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="io-usb-slave-eth.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="usbseth-init.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">eCos Support for Developing USB-ethernet Peripherals</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="io-usb-slave-eth.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Initializing the USB-ethernet Package</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -