<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>Network Device for the eCos TCP/IP Stack</TITLE
|
>Network Device for the eCos TCP/IP Stack</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos Reference Manual"
|
TITLE="eCos Reference Manual"
|
HREF="ecos-ref.html"><LINK
|
HREF="ecos-ref.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="eCos Support for Developing USB-ethernet Peripherals"
|
TITLE="eCos Support for Developing USB-ethernet Peripherals"
|
HREF="io-usb-slave-eth.html"><LINK
|
HREF="io-usb-slave-eth.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="USB-ethernet State Handling"
|
TITLE="USB-ethernet State Handling"
|
HREF="usbseth-control.html"><LINK
|
HREF="usbseth-control.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="Example Host-side Device Driver"
|
TITLE="Example Host-side Device Driver"
|
HREF="usbseth-host.html"></HEAD
|
HREF="usbseth-host.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="REFENTRY"
|
CLASS="REFENTRY"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos Reference Manual</TH
|
>eCos Reference Manual</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="usbseth-control.html"
|
HREF="usbseth-control.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="usbseth-host.html"
|
HREF="usbseth-host.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><H1
|
><H1
|
><A
|
><A
|
NAME="USBSETH-NETDEV">Network Device for the eCos TCP/IP Stack</H1
|
NAME="USBSETH-NETDEV">Network Device for the eCos TCP/IP Stack</H1
|
><DIV
|
><DIV
|
CLASS="REFNAMEDIV"
|
CLASS="REFNAMEDIV"
|
><A
|
><A
|
NAME="AEN17572"
|
NAME="AEN17572"
|
></A
|
></A
|
><H2
|
><H2
|
>Name</H2
|
>Name</H2
|
>Network Device -- USB-ethernet support for the eCos TCP/IP Stack</DIV
|
>Network Device -- USB-ethernet support for the eCos TCP/IP Stack</DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN17575"
|
NAME="AEN17575"
|
></A
|
></A
|
><H2
|
><H2
|
>Description</H2
|
>Description</H2
|
><P
|
><P
|
>If the USB peripheral involves running the eCos TCP/IP stack and that
|
>If the USB peripheral involves running the eCos TCP/IP stack and that
|
stack needs to use USB-ethernet as a transport layer (or as one of the
|
stack needs to use USB-ethernet as a transport layer (or as one of the
|
transports), then the USB-ethernet package can provide a suitable
|
transports), then the USB-ethernet package can provide a suitable
|
network device driver. It is still necessary for higher-level code to
|
network device driver. It is still necessary for higher-level code to
|
perform appropriate initialization by calling <A
|
perform appropriate initialization by calling <A
|
HREF="usbseth-init.html"
|
HREF="usbseth-init.html"
|
><TT
|
><TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>usbs_eth_init</TT
|
>usbs_eth_init</TT
|
></A
|
></A
|
>, but
|
>, but
|
after that it will be the TCP/IP stack rather than application code
|
after that it will be the TCP/IP stack rather than application code
|
that transmits or receives ethernet frames.</P
|
that transmits or receives ethernet frames.</P
|
><P
|
><P
|
>Not all peripherals involving the USB-ethernet package will require a
|
>Not all peripherals involving the USB-ethernet package will require a
|
TCP/IP stack. Hence the provision of the network device is controlled
|
TCP/IP stack. Hence the provision of the network device is controlled
|
by a configuration option <TT
|
by a configuration option <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGPKG_USBS_ETHDRV</TT
|
>CYGPKG_USBS_ETHDRV</TT
|
>. By
|
>. By
|
default this will be enabled if the TCP/IP package
|
default this will be enabled if the TCP/IP package
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGPKG_NET</TT
|
>CYGPKG_NET</TT
|
> is loaded, and disabled otherwise. </P
|
> is loaded, and disabled otherwise. </P
|
><P
|
><P
|
>There are a number of other configuration options related to the
|
>There are a number of other configuration options related to the
|
network device. <TT
|
network device. <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGFUN_USBS_ETHDRV_STATISTICS</TT
|
>CYGFUN_USBS_ETHDRV_STATISTICS</TT
|
>
|
>
|
determines whether or not the package will maintain statistics, mainly
|
determines whether or not the package will maintain statistics, mainly
|
intended for SNMP: by default this will be enabled if the SNMP support
|
intended for SNMP: by default this will be enabled if the SNMP support
|
package <TT
|
package <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGPKG_SNMPAGENT</TT
|
>CYGPKG_SNMPAGENT</TT
|
> is loaded, and disabled
|
> is loaded, and disabled
|
otherwise. The name of the ethernet device is controlled by
|
otherwise. The name of the ethernet device is controlled by
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGDATA_USBS_ETHDRV_NAME</TT
|
>CYGDATA_USBS_ETHDRV_NAME</TT
|
>, and has a default value
|
>, and has a default value
|
of either <TT
|
of either <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>eth0</TT
|
>eth0</TT
|
> or <TT
|
> or <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>eth1</TT
|
>eth1</TT
|
>
|
>
|
depending on whether or not there is another network device driver
|
depending on whether or not there is another network device driver
|
present in the configuration.</P
|
present in the configuration.</P
|
><P
|
><P
|
>Usually eCos network device drivers default to using DHCP for
|
>Usually eCos network device drivers default to using DHCP for
|
obtaining necessary information such as IP addresses. This is not
|
obtaining necessary information such as IP addresses. This is not
|
appropriate for USB-ethernet devices. On the host-side the
|
appropriate for USB-ethernet devices. On the host-side the
|
USB-ethernet network device will not exist until the USB peripheral
|
USB-ethernet network device will not exist until the USB peripheral
|
has been plugged in and communication has been established. Therefore
|
has been plugged in and communication has been established. Therefore
|
any DHCP daemon on the host would not be listening on that network
|
any DHCP daemon on the host would not be listening on that network
|
device at the point that eCos requests its IP and other information. A
|
device at the point that eCos requests its IP and other information. A
|
related issue is that the use of DHCP would imply the presence of a
|
related issue is that the use of DHCP would imply the presence of a
|
DHCP daemon on every affected host machine, as opposed to a single
|
DHCP daemon on every affected host machine, as opposed to a single
|
daemon (plus backups) for the network as a whole. For these reasons
|
daemon (plus backups) for the network as a whole. For these reasons
|
the USB-ethernet package precludes the use of DHCP as a way of setting
|
the USB-ethernet package precludes the use of DHCP as a way of setting
|
the IP address, instead requiring alternatives such as manual
|
the IP address, instead requiring alternatives such as manual
|
configuration.</P
|
configuration.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="usbseth-control.html"
|
HREF="usbseth-control.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-ref.html"
|
HREF="ecos-ref.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="usbseth-host.html"
|
HREF="usbseth-host.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>USB-ethernet State Handling</TD
|
>USB-ethernet State Handling</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="io-usb-slave-eth.html"
|
HREF="io-usb-slave-eth.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>Example Host-side Device Driver</TD
|
>Example Host-side Device Driver</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|