?lang_form?
?lang_select?
?lang_submit?
?lang_endform?
{HEADER END}
{FILE START}
library
?curdirlinks? - Rev 6
?prevdifflink? - Blame - ?getfile?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Procyon AVRlib: net/nic.h Source File</title>
<link href="dox.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<div class="nav">
<a class="el" href="dir_000001.html">net</a></div>
<h1>nic.h</h1><a href="nic_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*! \file nic.h \brief Network Interface Card (NIC) software definition. */</span>
00002 <span class="comment">//*****************************************************************************</span>
00003 <span class="comment">//</span>
00004 <span class="comment">// File Name : 'nic.h'</span>
00005 <span class="comment">// Title : Network Interface Card (NIC) software definition</span>
00006 <span class="comment">// Author : Pascal Stang</span>
00007 <span class="comment">// Created : 8/22/2004</span>
00008 <span class="comment">// Revised : 7/3/2005</span>
00009 <span class="comment">// Version : 0.1</span>
00010 <span class="comment">// Target MCU : Atmel AVR series</span>
00011 <span class="comment">// Editor Tabs : 4</span>
00012 <span class="comment">//</span><span class="comment"></span>
00013 <span class="comment">/// \ingroup network</span>
00014 <span class="comment">/// \defgroup nic Network Interface Card (NIC) software definition (nic.h)</span>
00015 <span class="comment">/// \code #include "net/nic.h" \endcode</span>
00016 <span class="comment">/// \par Description</span>
00017 <span class="comment">/// This is the software interface standard for network interface hardware</span>
00018 <span class="comment">/// as used by AVRlib. Drivers for network hardware must implement these</span>
00019 <span class="comment">/// functions to allow upper network layers to initialize the interface,</span>
00020 <span class="comment">/// and send and receive net traffic.</span>
00021 <span class="comment"></span><span class="comment">//</span>
00022 <span class="comment">// This code is distributed under the GNU Public License</span>
00023 <span class="comment">// which can be found at http://www.gnu.org/licenses/gpl.txt</span>
00024 <span class="comment">//*****************************************************************************</span><span class="comment"></span>
00025 <span class="comment">//@{</span>
00026 <span class="comment"></span>
00027 <span class="preprocessor">#ifndef NIC_H</span>
00028 <span class="preprocessor"></span><span class="preprocessor">#define NIC_H</span>
00029 <span class="preprocessor"></span>
00030 <span class="preprocessor">#include <inttypes.h></span>
00031 <span class="comment"></span>
00032 <span class="comment">//! Initialize network interface hardware.</span>
00033 <span class="comment">/// Reset and bring up network interface hardware. This function should leave</span>
00034 <span class="comment">/// the network interface ready to handle \c nicSend() and \c nicPoll() requests.</span>
00035 <span class="comment">/// \note For some hardware, this command will take a non-negligible amount of</span>
00036 <span class="comment">/// time (1-2 seconds).</span>
00037 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__nic.html#ga0">nicInit</a>(<span class="keywordtype">void</span>);
00038 <span class="comment"></span>
00039 <span class="comment">//! Send packet on network interface.</span>
00040 <span class="comment">/// Function accepts the length (in bytes) of the data to be sent, and a pointer</span>
00041 <span class="comment">/// to the data. This send command may assume an ethernet-like 802.3 header is at the</span>
00042 <span class="comment">/// beginning of the packet, and contains the packet addressing information.</span>
00043 <span class="comment">/// See net.h documentation for ethernet header format.</span>
00044 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__nic.html#ga1">nicSend</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* packet);
00045 <span class="comment"></span>
00046 <span class="comment">//! Check network interface; return next received packet if avaialable.</span>
00047 <span class="comment">/// Function accepts the maximum allowable packet length (in bytes), and a</span>
00048 <span class="comment">/// pointer to the received packet buffer. Return value is the length</span>
00049 <span class="comment">/// (in bytes) of the packet recevied, or zero if no packet is available.</span>
00050 <span class="comment">/// Upper network layers may assume that an ethernet-like 802.3 header is at</span>
00051 <span class="comment">/// the beginning of the packet, and contains the packet addressing information.</span>
00052 <span class="comment">/// See net.h documentation for ethernet header format.</span>
00053 <span class="comment"></span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="group__nic.html#ga2">nicPoll</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxlen, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* packet);
00054 <span class="comment"></span>
00055 <span class="comment">//! Return the 48-bit hardware node (MAC) address of this network interface.</span>
00056 <span class="comment">/// This function can return a MAC address read from the NIC hardware, if available.</span>
00057 <span class="comment">/// If the hardware does not provide a MAC address, a software-defined address may be</span>
00058 <span class="comment">/// returned. It may be acceptable to return an address that is less than 48-bits.</span>
00059 <span class="comment"></span><span class="keywordtype">void</span> nicGetMacAddress(uint8_t* macaddr);
00060 <span class="comment"></span>
00061 <span class="comment">//! Set the 48-bit hardware node (MAC) address of this network interface.</span>
00062 <span class="comment">/// This function may not be supported on all hardware.</span>
00063 <span class="comment"></span><span class="keywordtype">void</span> nicSetMacAddress(uint8_t* macaddr);
00064 <span class="comment"></span>
00065 <span class="comment">//! Print network interface hardware registers.</span>
00066 <span class="comment">/// Prints a formatted list of names and values of NIC registers for debugging</span>
00067 <span class="comment">/// purposes.</span>
00068 <span class="comment"></span><span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__nic.html#ga5">nicRegDump</a>(<span class="keywordtype">void</span>);
00069
00070 <span class="preprocessor">#endif</span>
00071 <span class="preprocessor"></span><span class="comment">//@}</span>
</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:07 2006 for Procyon AVRlib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>
|
{FILE END}
{FOOTER START}
Powered by WebSVN v2.8.3