<!-- 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
|
>Review of the functions</TITLE
|
>Review of the functions</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="Generic Ethernet Device Driver"
|
TITLE="Generic Ethernet Device Driver"
|
HREF="io-eth-drv-generic1.html"><LINK
|
HREF="io-eth-drv-generic1.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="Generic Ethernet Device Driver"
|
TITLE="Generic Ethernet Device Driver"
|
HREF="io-eth-drv-generic1.html"><LINK
|
HREF="io-eth-drv-generic1.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="Upper Layer Functions"
|
TITLE="Upper Layer Functions"
|
HREF="io-eth-drv-upper-api.html"></HEAD
|
HREF="io-eth-drv-upper-api.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="SECT1"
|
CLASS="SECT1"
|
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="io-eth-drv-generic1.html"
|
HREF="io-eth-drv-generic1.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"
|
>Chapter 46. Generic Ethernet Device Driver</TD
|
>Chapter 46. Generic Ethernet Device Driver</TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="io-eth-drv-upper-api.html"
|
HREF="io-eth-drv-upper-api.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
|
><DIV
|
><DIV
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><H1
|
><H1
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-FUNCS">Review of the functions</H1
|
NAME="IO-ETH-DRV-API-FUNCS">Review of the functions</H1
|
><P
|
><P
|
>Now a brief review of the functions. This discussion will use generic
|
>Now a brief review of the functions. This discussion will use generic
|
names for the functions — your driver should use hardware-specific
|
names for the functions — your driver should use hardware-specific
|
names to maintain uniqueness against any other drivers.</P
|
names to maintain uniqueness against any other drivers.</P
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-INIT">Init function</H2
|
NAME="IO-ETH-DRV-API-INIT">Init function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static bool <TT
|
>static bool <TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>DRV_HDWR</I
|
>DRV_HDWR</I
|
></TT
|
></TT
|
>_init(struct cyg_netdevtab_entry *tab)</PRE
|
>_init(struct cyg_netdevtab_entry *tab)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is called as part of system initialization. Its primary
|
This function is called as part of system initialization. Its primary
|
function is to decide if the hardware (as indicated via
|
function is to decide if the hardware (as indicated via
|
<SPAN
|
<SPAN
|
CLASS="TYPE"
|
CLASS="TYPE"
|
>tab->device_instance</SPAN
|
>tab->device_instance</SPAN
|
>)
|
>)
|
is working and if the interface needs to be made
|
is working and if the interface needs to be made
|
available in the system. If this is the case, this function needs to
|
available in the system. If this is the case, this function needs to
|
finish with a call to the ethernet driver function:
|
finish with a call to the ethernet driver function:
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
> struct eth_drv_sc *sc = (struct eth_drv_sc *)tab->device_instance;
|
> struct eth_drv_sc *sc = (struct eth_drv_sc *)tab->device_instance;
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>....initialization code....</I
|
>....initialization code....</I
|
></TT
|
></TT
|
>
|
>
|
// Initialize upper level driver
|
// Initialize upper level driver
|
(sc->funs->eth_drv->init)( sc, unsigned char *enaddr );</PRE
|
(sc->funs->eth_drv->init)( sc, unsigned char *enaddr );</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
where <TT
|
where <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>enaddr</I
|
>enaddr</I
|
></TT
|
></TT
|
>
|
>
|
is a pointer to the ethernet station address for this unit, to inform
|
is a pointer to the ethernet station address for this unit, to inform
|
the stack of this device's readiness and availability.</P
|
the stack of this device's readiness and availability.</P
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>The ethernet station address
|
>The ethernet station address
|
(<SPAN
|
(<SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>ESA</SPAN
|
>ESA</SPAN
|
>)
|
>)
|
is supposed to be a
|
is supposed to be a
|
world-unique, 48 bit address for this particular ethernet interface.
|
world-unique, 48 bit address for this particular ethernet interface.
|
Typically it is provided by the board/hardware manufacturer in ROM.</P
|
Typically it is provided by the board/hardware manufacturer in ROM.</P
|
><P
|
><P
|
>In many packages it is possible for the
|
>In many packages it is possible for the
|
<SPAN
|
<SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>ESA</SPAN
|
>ESA</SPAN
|
>
|
>
|
to be set from RedBoot,
|
to be set from RedBoot,
|
(perhaps from 'fconfig' data), hard-coded from
|
(perhaps from 'fconfig' data), hard-coded from
|
<SPAN
|
<SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>CDL</SPAN
|
>CDL</SPAN
|
>, or from an <SPAN
|
>, or from an <SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>EPROM</SPAN
|
>EPROM</SPAN
|
>.
|
>.
|
A driver should choose a run-time specified
|
A driver should choose a run-time specified
|
<SPAN
|
<SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>ESA</SPAN
|
>ESA</SPAN
|
>
|
>
|
(e.g. from RedBoot)
|
(e.g. from RedBoot)
|
preferentially, otherwise (in order) it should use a <SPAN
|
preferentially, otherwise (in order) it should use a <SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>CDL</SPAN
|
>CDL</SPAN
|
> specified
|
> specified
|
<SPAN
|
<SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>ESA</SPAN
|
>ESA</SPAN
|
>
|
>
|
if one has been set, otherwise an <SPAN
|
if one has been set, otherwise an <SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>EPROM</SPAN
|
>EPROM</SPAN
|
> set
|
> set
|
<SPAN
|
<SPAN
|
CLASS="ACRONYM"
|
CLASS="ACRONYM"
|
>ESA</SPAN
|
>ESA</SPAN
|
>, or otherwise
|
>, or otherwise
|
fail. See the <TT
|
fail. See the <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>cl/cs8900a</TT
|
>cl/cs8900a</TT
|
>
|
>
|
ethernet driver for an example.</P
|
ethernet driver for an example.</P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-START">Start function</H2
|
NAME="IO-ETH-DRV-API-START">Start function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static void
|
>static void
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_start(struct eth_drv_sc *sc, unsigned char *enaddr, int flags)</PRE
|
>_start(struct eth_drv_sc *sc, unsigned char *enaddr, int flags)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is called, perhaps much later than system initialization
|
This function is called, perhaps much later than system initialization
|
time, when the system (an application) is ready for the interface to
|
time, when the system (an application) is ready for the interface to
|
become active. The purpose of this function is to set up the hardware
|
become active. The purpose of this function is to set up the hardware
|
interface to start accepting packets from the network and be able to
|
interface to start accepting packets from the network and be able to
|
send packets out. The receiver hardware should not be enabled prior to
|
send packets out. The receiver hardware should not be enabled prior to
|
this call.</P
|
this call.</P
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>This function will be called whenever the
|
>This function will be called whenever the
|
up/down state of the logical interface changes, e.g. when the IP address
|
up/down state of the logical interface changes, e.g. when the IP address
|
changes, or when promiscuous mode is selected by means of an
|
changes, or when promiscuous mode is selected by means of an
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>ioctl()</TT
|
>ioctl()</TT
|
> call in the application.
|
> call in the application.
|
This may occur more than once, so this function needs to
|
This may occur more than once, so this function needs to
|
be prepared for that case.</P
|
be prepared for that case.</P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>In future, the <TT
|
>In future, the <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>flags</I
|
>flags</I
|
></TT
|
></TT
|
>
|
>
|
field (currently unused) may be used to tell the
|
field (currently unused) may be used to tell the
|
function how to start up, e.g. whether interrupts will be used,
|
function how to start up, e.g. whether interrupts will be used,
|
alternate means of selecting promiscuous mode etc.</P
|
alternate means of selecting promiscuous mode etc.</P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-STOP">Stop function</H2
|
NAME="IO-ETH-DRV-API-STOP">Stop function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static void <TT
|
>static void <TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_stop(struct eth_drv_sc *sc)</PRE
|
>_stop(struct eth_drv_sc *sc)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is the inverse of “start.”
|
This function is the inverse of “start.”
|
It should shut down the hardware, disable the receiver, and keep it from
|
It should shut down the hardware, disable the receiver, and keep it from
|
interacting with the physical network.</P
|
interacting with the physical network.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-CONTROL">Control function</H2
|
NAME="IO-ETH-DRV-API-CONTROL">Control function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static int
|
>static int
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_control(
|
>_control(
|
struct eth_drv_sc *sc, unsigned long key,
|
struct eth_drv_sc *sc, unsigned long key,
|
void *data, int len)</PRE
|
void *data, int len)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is used to perform low-level “control”
|
This function is used to perform low-level “control”
|
operations on the
|
operations on the
|
interface. These operations would typically be initiated via
|
interface. These operations would typically be initiated via
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>ioctl()</TT
|
>ioctl()</TT
|
> calls in the BSD
|
> calls in the BSD
|
stack, and would be anything that might require the hardware setup to
|
stack, and would be anything that might require the hardware setup to
|
change (i.e. cannot be performed totally by the
|
change (i.e. cannot be performed totally by the
|
platform-independent layers).</P
|
platform-independent layers).</P
|
><P
|
><P
|
>The <TT
|
>The <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>key</I
|
>key</I
|
></TT
|
></TT
|
> parameter selects the operation, and the
|
> parameter selects the operation, and the
|
<TT
|
<TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>data</I
|
>data</I
|
></TT
|
></TT
|
> and <TT
|
> and <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>len</I
|
>len</I
|
></TT
|
></TT
|
> params point describe,
|
> params point describe,
|
as required, some data for the operation in question.</P
|
as required, some data for the operation in question.</P
|
><P
|
><P
|
></P
|
></P
|
><DIV
|
><DIV
|
CLASS="VARIABLELIST"
|
CLASS="VARIABLELIST"
|
><P
|
><P
|
><B
|
><B
|
>Available Operations:</B
|
>Available Operations:</B
|
></P
|
></P
|
><DL
|
><DL
|
><DT
|
><DT
|
>ETH_DRV_SET_MAC_ADDRESS</DT
|
>ETH_DRV_SET_MAC_ADDRESS</DT
|
><DD
|
><DD
|
><P
|
><P
|
>This operation sets the ethernet station address (ESA or MAC) for the
|
>This operation sets the ethernet station address (ESA or MAC) for the
|
device. Normally this address is kept in non-volatile memory and is
|
device. Normally this address is kept in non-volatile memory and is
|
unique in the world. This function must at least set the interface to
|
unique in the world. This function must at least set the interface to
|
use the new address. It may also update the NVM as appropriate.</P
|
use the new address. It may also update the NVM as appropriate.</P
|
></DD
|
></DD
|
><DT
|
><DT
|
>ETH_DRV_GET_IF_STATS_UD, ETH_DRV_GET_IF_STATS</DT
|
>ETH_DRV_GET_IF_STATS_UD, ETH_DRV_GET_IF_STATS</DT
|
><DD
|
><DD
|
><P
|
><P
|
>These acquire a set of statistical counters from the interface, and write
|
>These acquire a set of statistical counters from the interface, and write
|
the information into the memory pointed to by <TT
|
the information into the memory pointed to by <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>data</I
|
>data</I
|
></TT
|
></TT
|
>.
|
>.
|
The “UD” variant explicitly instructs the driver to acquire
|
The “UD” variant explicitly instructs the driver to acquire
|
up-to-date values. This is a separate option because doing so may take
|
up-to-date values. This is a separate option because doing so may take
|
some time, depending on the hardware.</P
|
some time, depending on the hardware.</P
|
><P
|
><P
|
>The definition of the data structure is in
|
>The definition of the data structure is in
|
<TT
|
<TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>cyg/io/eth/eth_drv_stats.h</TT
|
>cyg/io/eth/eth_drv_stats.h</TT
|
>.</P
|
>.</P
|
><P
|
><P
|
>This call is typically made by SNMP, see <A
|
>This call is typically made by SNMP, see <A
|
HREF="net-snmp-ecos-port.html"
|
HREF="net-snmp-ecos-port.html"
|
>Chapter 47</A
|
>Chapter 47</A
|
>.</P
|
>.</P
|
></DD
|
></DD
|
><DT
|
><DT
|
>ETH_DRV_SET_MC_LIST</DT
|
>ETH_DRV_SET_MC_LIST</DT
|
><DD
|
><DD
|
><P
|
><P
|
>This entry instructs the device to set up multicast packet filtering
|
>This entry instructs the device to set up multicast packet filtering
|
to receive only packets addressed to the multicast ESAs in the list pointed
|
to receive only packets addressed to the multicast ESAs in the list pointed
|
to by <TT
|
to by <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>data</I
|
>data</I
|
></TT
|
></TT
|
>.</P
|
>.</P
|
><P
|
><P
|
>The format of the data is a 32-bit count of the ESAs in the list, followed
|
>The format of the data is a 32-bit count of the ESAs in the list, followed
|
by packed bytes which are the ESAs themselves, thus:
|
by packed bytes which are the ESAs themselves, thus:
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>#define ETH_DRV_MAX_MC 8
|
>#define ETH_DRV_MAX_MC 8
|
struct eth_drv_mc_list {
|
struct eth_drv_mc_list {
|
int len;
|
int len;
|
unsigned char addrs[ETH_DRV_MAX_MC][ETHER_ADDR_LEN];
|
unsigned char addrs[ETH_DRV_MAX_MC][ETHER_ADDR_LEN];
|
};</PRE
|
};</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
></DD
|
></DD
|
><DT
|
><DT
|
>ETH_DRV_SET_MC_ALL</DT
|
>ETH_DRV_SET_MC_ALL</DT
|
><DD
|
><DD
|
><P
|
><P
|
>This entry instructs the device to receive all multicast packets, and
|
>This entry instructs the device to receive all multicast packets, and
|
delete any explicit filtering which had been set up.</P
|
delete any explicit filtering which had been set up.</P
|
></DD
|
></DD
|
></DL
|
></DL
|
></DIV
|
></DIV
|
><P
|
><P
|
>This function should return zero if the specified operation was
|
>This function should return zero if the specified operation was
|
completed successfully. It should return non-zero if the operation
|
completed successfully. It should return non-zero if the operation
|
could not be performed, for any reason.</P
|
could not be performed, for any reason.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-CAN-SEND">Can-send function</H2
|
NAME="IO-ETH-DRV-API-CAN-SEND">Can-send function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static int <TT
|
>static int <TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_can_send(struct eth_drv_sc *sc)</PRE
|
>_can_send(struct eth_drv_sc *sc)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is called to determine if it is possible to start the
|
This function is called to determine if it is possible to start the
|
transmission of a packet on the interface. Some interfaces will allow
|
transmission of a packet on the interface. Some interfaces will allow
|
multiple packets to be "queued" and this function allows for the highest
|
multiple packets to be "queued" and this function allows for the highest
|
possible utilization of that mode.</P
|
possible utilization of that mode.</P
|
><P
|
><P
|
>Return the number of packets which could be accepted at this time, zero
|
>Return the number of packets which could be accepted at this time, zero
|
implies that the interface is saturated/busy.</P
|
implies that the interface is saturated/busy.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-SEND">Send function</H2
|
NAME="IO-ETH-DRV-API-SEND">Send function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>struct eth_drv_sg {
|
>struct eth_drv_sg {
|
CYG_ADDRESS buf;
|
CYG_ADDRESS buf;
|
CYG_ADDRWORD len;
|
CYG_ADDRWORD len;
|
};
|
};
|
|
|
static void
|
static void
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_send(
|
>_send(
|
struct eth_drv_sc *sc,
|
struct eth_drv_sc *sc,
|
struct eth_drv_sg *sg_list, int sg_len,
|
struct eth_drv_sg *sg_list, int sg_len,
|
int total_len, unsigned long key)</PRE
|
int total_len, unsigned long key)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is used to send a packet of data to the network. It is
|
This function is used to send a packet of data to the network. It is
|
the responsibility of this function to somehow hand the data over to the
|
the responsibility of this function to somehow hand the data over to the
|
hardware interface. This will most likely require copying, but just the
|
hardware interface. This will most likely require copying, but just the
|
address/length values could be used by smart hardware.</P
|
address/length values could be used by smart hardware.</P
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>All data in/out of the driver is specified via a
|
>All data in/out of the driver is specified via a
|
“scatter-gather”
|
“scatter-gather”
|
list. This is just an array of address/length pairs which describe
|
list. This is just an array of address/length pairs which describe
|
sections of data to move (in the order given by the array), as in the
|
sections of data to move (in the order given by the array), as in the
|
<SPAN
|
<SPAN
|
CLASS="TYPE"
|
CLASS="TYPE"
|
>struct eth_drv_sg</SPAN
|
>struct eth_drv_sg</SPAN
|
> defined above and pointed to by
|
> defined above and pointed to by
|
<TT
|
<TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>sg_list</I
|
>sg_list</I
|
></TT
|
></TT
|
>.</P
|
>.</P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
><P
|
><P
|
>Once the data has been successfully sent by the interface (or if an
|
>Once the data has been successfully sent by the interface (or if an
|
error occurs), the driver should call
|
error occurs), the driver should call
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>(sc->funs->eth_drv->tx_done)()</TT
|
>(sc->funs->eth_drv->tx_done)()</TT
|
>
|
>
|
(see <A
|
(see <A
|
HREF="io-eth-drv-upper-api.html#IO-ETH-DRV-TX-DONE"
|
HREF="io-eth-drv-upper-api.html#IO-ETH-DRV-TX-DONE"
|
>the Section called <I
|
>the Section called <I
|
>Callback Tx-Done function</I
|
>Callback Tx-Done function</I
|
></A
|
></A
|
>)
|
>)
|
using the specified <TT
|
using the specified <TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>key</I
|
>key</I
|
></TT
|
></TT
|
>.
|
>.
|
Only then will the upper layers release the resources
|
Only then will the upper layers release the resources
|
for that packet and start another transmission.</P
|
for that packet and start another transmission.</P
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>In future, this function may be extended so that the data need not be
|
>In future, this function may be extended so that the data need not be
|
copied by having the function return a “disposition” code
|
copied by having the function return a “disposition” code
|
(done, send pending, etc). At this point, you should move the data to some
|
(done, send pending, etc). At this point, you should move the data to some
|
“safe” location before returning.</P
|
“safe” location before returning.</P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-DELIVER">Deliver function</H2
|
NAME="IO-ETH-DRV-API-DELIVER">Deliver function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static void
|
>static void
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_deliver(struct eth_drv_sc *sc)</PRE
|
>_deliver(struct eth_drv_sc *sc)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is called from the “Network Delivery Thread” in
|
This function is called from the “Network Delivery Thread” in
|
order to let the device driver do the time-consuming work associated with
|
order to let the device driver do the time-consuming work associated with
|
receiving a packet — usually copying the entire packet from the
|
receiving a packet — usually copying the entire packet from the
|
hardware or a special memory location into the network stack's memory.</P
|
hardware or a special memory location into the network stack's memory.</P
|
><P
|
><P
|
>After handling any outstanding incoming packets or pending transmission
|
>After handling any outstanding incoming packets or pending transmission
|
status, it can unmask the device's interrupts, and free any relevant
|
status, it can unmask the device's interrupts, and free any relevant
|
resources so it can process further packets.</P
|
resources so it can process further packets.</P
|
><P
|
><P
|
>It will be called when the interrupt handler for the network device
|
>It will be called when the interrupt handler for the network device
|
has called
|
has called
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
> eth_drv_dsr( vector, count, (cyg_addrword_t)sc );</PRE
|
> eth_drv_dsr( vector, count, (cyg_addrword_t)sc );</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
to alert the system that “something requires attention.”
|
to alert the system that “something requires attention.”
|
This <TT
|
This <TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>eth_drv_dsr()</TT
|
>eth_drv_dsr()</TT
|
> call must occur from within the
|
> call must occur from within the
|
interrupt handler's DSR (not the ISR) or actually <SPAN
|
interrupt handler's DSR (not the ISR) or actually <SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>be</I
|
>be</I
|
></SPAN
|
></SPAN
|
>
|
>
|
the DSR, whenever it is determined that
|
the DSR, whenever it is determined that
|
the device needs attention from the foreground. The third parameter
|
the device needs attention from the foreground. The third parameter
|
(<TT
|
(<TT
|
CLASS="PARAMETER"
|
CLASS="PARAMETER"
|
><I
|
><I
|
>data</I
|
>data</I
|
></TT
|
></TT
|
> in the prototype of
|
> in the prototype of
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>eth_drv_dsr()</TT
|
>eth_drv_dsr()</TT
|
> <SPAN
|
> <SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>must</I
|
>must</I
|
></SPAN
|
></SPAN
|
>
|
>
|
be a valid <SPAN
|
be a valid <SPAN
|
CLASS="TYPE"
|
CLASS="TYPE"
|
>struct eth_drv_sc</SPAN
|
>struct eth_drv_sc</SPAN
|
> pointer <TT
|
> pointer <TT
|
CLASS="VARNAME"
|
CLASS="VARNAME"
|
>sc</TT
|
>sc</TT
|
>.</P
|
>.</P
|
><P
|
><P
|
>The reason for this slightly convoluted train of events is to keep the DSR
|
>The reason for this slightly convoluted train of events is to keep the DSR
|
(and ISR) execution time as short as possible, so that other activities of
|
(and ISR) execution time as short as possible, so that other activities of
|
higher priority than network servicing are not denied the CPU by network
|
higher priority than network servicing are not denied the CPU by network
|
traffic.</P
|
traffic.</P
|
><P
|
><P
|
>To deliver a newly-received packet into the network stack, the deliver
|
>To deliver a newly-received packet into the network stack, the deliver
|
routine must call
|
routine must call
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>(sc->funs->eth_drv->recv)(sc, len);</PRE
|
>(sc->funs->eth_drv->recv)(sc, len);</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
which will in turn call the receive function, which we talk about next.
|
which will in turn call the receive function, which we talk about next.
|
See also <A
|
See also <A
|
HREF="io-eth-drv-upper-api.html#IO-ETH-DRV-UPPER-RECV"
|
HREF="io-eth-drv-upper-api.html#IO-ETH-DRV-UPPER-RECV"
|
>the Section called <I
|
>the Section called <I
|
>Callback Receive function</I
|
>Callback Receive function</I
|
></A
|
></A
|
> below.</P
|
> below.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-RECV">Receive function</H2
|
NAME="IO-ETH-DRV-API-RECV">Receive function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static void
|
>static void
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_recv(
|
>_recv(
|
struct eth_drv_sc *sc,
|
struct eth_drv_sc *sc,
|
struct eth_drv_sg *sg_list, int sg_len)</PRE
|
struct eth_drv_sg *sg_list, int sg_len)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is a call back, only invoked after the
|
This function is a call back, only invoked after the
|
upper-level function
|
upper-level function
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>(sc->funs->eth_drv->recv)(struct eth_drv_sc *sc, int total_len)</PRE
|
>(sc->funs->eth_drv->recv)(struct eth_drv_sc *sc, int total_len)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
has been called itself from your deliver function when it knows that a
|
has been called itself from your deliver function when it knows that a
|
packet of data is available on the
|
packet of data is available on the
|
interface. The <TT
|
interface. The <TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>(sc->funs->eth_drv->recv)()</TT
|
>(sc->funs->eth_drv->recv)()</TT
|
>
|
>
|
function then arranges network buffers
|
function then arranges network buffers
|
and structures for the data and then calls
|
and structures for the data and then calls
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
><TT
|
><TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_recv()</TT
|
>_recv()</TT
|
> to actually
|
> to actually
|
move the data from the interface.</P
|
move the data from the interface.</P
|
><P
|
><P
|
>A scatter-gather list (<SPAN
|
>A scatter-gather list (<SPAN
|
CLASS="TYPE"
|
CLASS="TYPE"
|
>struct eth_drv_sg</SPAN
|
>struct eth_drv_sg</SPAN
|
>) is used once more,
|
>) is used once more,
|
just like in the send case.</P
|
just like in the send case.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-POLL">Poll function</H2
|
NAME="IO-ETH-DRV-API-POLL">Poll function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static void
|
>static void
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_poll(struct eth_drv_sc *sc)</PRE
|
>_poll(struct eth_drv_sc *sc)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function is used when in a non-interrupt driven system, e.g. when
|
This function is used when in a non-interrupt driven system, e.g. when
|
interrupts are completely disabled. This allows the driver time to check
|
interrupts are completely disabled. This allows the driver time to check
|
whether anything needs doing either for transmission, or to check if
|
whether anything needs doing either for transmission, or to check if
|
anything has been received, or if any other processing needs doing.</P
|
anything has been received, or if any other processing needs doing.</P
|
><P
|
><P
|
>It is perfectly correct and acceptable for the poll function to look like
|
>It is perfectly correct and acceptable for the poll function to look like
|
this:
|
this:
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static void
|
>static void
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_poll(struct eth_drv_sc *sc)
|
>_poll(struct eth_drv_sc *sc)
|
{
|
{
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>my_interrupt_ISR</I
|
>my_interrupt_ISR</I
|
></TT
|
></TT
|
>(sc);
|
>(sc);
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_deliver(struct eth_drv_sc *sc);
|
>_deliver(struct eth_drv_sc *sc);
|
}</PRE
|
}</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
provided that both the ISR and the deliver functions are idempotent and
|
provided that both the ISR and the deliver functions are idempotent and
|
harmless if called when there is no attention needed by the hardware. Some
|
harmless if called when there is no attention needed by the hardware. Some
|
devices might not need a call to the ISR here if the deliver function
|
devices might not need a call to the ISR here if the deliver function
|
contains all the “intelligence.”</P
|
contains all the “intelligence.”</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="IO-ETH-DRV-API-INT-VECTOR">Interrupt-vector function</H2
|
NAME="IO-ETH-DRV-API-INT-VECTOR">Interrupt-vector function</H2
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>static int
|
>static int
|
<TT
|
<TT
|
CLASS="REPLACEABLE"
|
CLASS="REPLACEABLE"
|
><I
|
><I
|
>HRDWR</I
|
>HRDWR</I
|
></TT
|
></TT
|
>_int_vector(struct eth_drv_sc *sc)</PRE
|
>_int_vector(struct eth_drv_sc *sc)</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
This function returns the interrupt vector number used for receive
|
This function returns the interrupt vector number used for receive
|
interrupts.
|
interrupts.
|
This is so that the common GDB stubs can detect when to check
|
This is so that the common GDB stubs can detect when to check
|
for incoming “CTRL-C” packets (used to asynchronously
|
for incoming “CTRL-C” packets (used to asynchronously
|
halt the application) when debugging over ethernet.
|
halt the application) when debugging over ethernet.
|
The GDB stubs need to know which interrupt the ethernet device uses
|
The GDB stubs need to know which interrupt the ethernet device uses
|
so that they can mask or unmask that interrupt as required.</P
|
so that they can mask or unmask that interrupt as required.</P
|
></DIV
|
></DIV
|
></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="io-eth-drv-generic1.html"
|
HREF="io-eth-drv-generic1.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="io-eth-drv-upper-api.html"
|
HREF="io-eth-drv-upper-api.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"
|
>Generic Ethernet Device Driver</TD
|
>Generic Ethernet Device Driver</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="io-eth-drv-generic1.html"
|
HREF="io-eth-drv-generic1.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"
|
>Upper Layer Functions</TD
|
>Upper Layer Functions</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|