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

📄 io-eth-drv-upper-api.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>Upper Layer Functions</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="Generic Ethernet Device Driver"HREF="io-eth-drv-generic1.html"><LINKREL="PREVIOUS"TITLE="Review of the functions"HREF="io-eth-drv-api-funcs.html"><LINKREL="NEXT"TITLE="Calling graph for Transmission and Reception"HREF="io-eth-call-graph.html"></HEAD><BODYCLASS="SECT1"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-eth-drv-api-funcs.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 46. Generic Ethernet Device Driver</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="io-eth-call-graph.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="IO-ETH-DRV-UPPER-API">Upper Layer Functions</H1><P>Upper layer functions are called by drivers to deliver received packetsor transmission completion status back up into the network stack.</P><P>These functions are defined by the hardware independent upper layers ofthe networking driver support.  They are present to hide the interfacesto the actual networking stack so that the hardware drivers maybe used by different network stack implementations without change.</P><P>These functions require a pointer to a <SPANCLASS="TYPE">struct eth_drv_sc</SPAN>which describes the interface at a logical level.  It is assumed that thelow level hardware driver will keep track of this pointer soit may be passed &#8220;up&#8221; as appropriate.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="IO-ETH-DRV-UPPER-INIT">Callback Init function</H2><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void (sc-&#62;funs-&#62;eth_drv-&#62;init)(		struct eth_drv_sc *sc, unsigned char *enaddr)</PRE></TD></TR></TABLE>This function establishes the device at initialization time.It should be called once per device instance only, from theinitialization function, if all is well(see <AHREF="io-eth-drv-api-funcs.html#IO-ETH-DRV-API-INIT">the Section called <I>Init function</I></A>).The hardware should be totally initialized(<SPANCLASS="emphasis"><ICLASS="EMPHASIS">not</I></SPAN> &#8220;started&#8221;)when this function is called.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="IO-ETH-DRV-TX-DONE">Callback Tx-Done function</H2><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void (sc-&#62;funs-&#62;eth_drv-&#62;tx_done)(		struct eth_drv_sc *sc,		unsigned long key, int status)</PRE></TD></TR></TABLE>This function is called when a packet completes transmission on theinterface.  The <TTCLASS="PARAMETER"><I>key</I></TT>value must be one of the keys provided to<TTCLASS="FUNCTION"><TTCLASS="REPLACEABLE"><I>HRDWR</I></TT>_send()</TT>above.  The value <TTCLASS="PARAMETER"><I>status</I></TT> should be non-zero(details currently undefined) to indicate that an error occurred during thetransmission, and zero if all was well.</P><P>It should be called from the deliver function(see <AHREF="io-eth-drv-api-funcs.html#IO-ETH-DRV-API-DELIVER">the Section called <I>Deliver function</I></A>)or poll function(see <AHREF="io-eth-drv-api-funcs.html#IO-ETH-DRV-API-POLL">the Section called <I>Poll function</I></A>).</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="IO-ETH-DRV-UPPER-RECV">Callback Receive function</H2><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void (sc-&#62;funs-&#62;eth_drv-&#62;recv)(struct eth_drv_sc *sc, int len)</PRE></TD></TR></TABLE>This function is called to indicate that a packet of length<TTCLASS="PARAMETER"><I>len</I></TT> hasarrived at the interface.The callback<TTCLASS="FUNCTION"><TTCLASS="REPLACEABLE"><I>HRDWR</I></TT>_recv()</TT> functiondescribed above will be used to actually unload the data from theinterface into buffers used by the device independent layers.</P><P>It should be called from the deliver function(see <AHREF="io-eth-drv-api-funcs.html#IO-ETH-DRV-API-DELIVER">the Section called <I>Deliver function</I></A>)or poll function(see <AHREF="io-eth-drv-api-funcs.html#IO-ETH-DRV-API-POLL">the Section called <I>Poll function</I></A>).</P></DIV></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-eth-drv-api-funcs.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="io-eth-call-graph.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Review of the functions</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="io-eth-drv-generic1.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Calling graph for Transmission and Reception</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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