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

📄 if_sn.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/if_sn.html - generated by refgen from if_sn.c --> <title> if_sn </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>if_sn</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>if_sn</strong> - National Semiconductor DP83932B SONIC Ethernet network driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>  -  publish the <b>sn</b> network interface and initialize the driver and device<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements the National Semiconductor DP83932 SONIC Ethernet network interface driver.<p>This driver is designed to be moderately generic, operating unmodifiedacross the range of architectures and targets supported by VxWorks.  To achieve this, the driver must be given several target-specificparameters, and some external support routines must be provided.  Theseparameters, and the mechanisms used to communicate them to the driver, aredetailed below.  If any of the assumptions stated below are not true foryour particular hardware, this driver will probably not function correctlywith it.  This driver supports up to four individual units per CPU.<p></blockquote><h4>BOARD LAYOUT</h4><blockquote><p>This device is on-board.  No jumpering diagram is necessary.<p></blockquote><h4>EXTERNAL INTERFACE</h4><blockquote><p>This driver provides the standard external interface with the followingexceptions.  All initialization is performed within the attach routine;there is no separate initialization routine.  Therefore, in the global interfacestructure, the function pointer to the initialization routine is NULL.<p>There is one user-callable routine, <b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>;for details, see the manual entry for this routine.<p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><dl><dt>device I/O address<dd>This parameter is passed to the driver by <b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>.It specifies the base address of the device's I/O registerset.<p><dt>interrupt vector<dd>This parameter is passed to the driver by <b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>.It specifies the interrupt vector to be used by the driverto service an interrupt from the SONIC device.  The driver will connectthe interrupt handler to this vector by calling <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>(&nbsp;)</b>.<p><dt>Ethernet address<dd>This parameter is obtained by calling an external support routine.It specifies the unique, six-byte address assigned to the VxWorks targeton the Ethernet. </dl><p></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p>This driver requires five external support functions:<dl><dt>void sysEnetInit (int unit)<dd>This routine performs any target-specificoperations that must be executed before the SONICdevice is initialized.  The driver calls this routine, once per unit, from <b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>.<p><dt>STATUS sysEnetAddrGet (int unit, char *pCopy)<dd>This routine provides the six-byte Ethernet address used by <i>unit</i>.  Itmust copy the six-byte address to the space provided by <i>pCopy</i>.  Thisroutine returns OK, or ERROR if it fails.  The driver calls this routine, once per unit, from <b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>.<p><dt>void sysEnetIntEnable (int unit), void sysEnetIntDisable (int unit)<dd>These routines enable or disable the interrupt fromthe SONIC device for the specified <i>unit</i>.  Typically,this involves interrupt controller hardware,either internal or external to the CPU.  The driver calls these routines only during initialization, from <b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>.<p><dt>void sysEnetIntAck (int unit)<dd>This routine performs any interrupt acknowledgement orclearing that may be required.  This typicallyinvolves an operation to some interrupt controlhardware.  The driver calls this routine from theinterrupt handler. </dl><p></blockquote><h4>DEVICE CONFIGURATION</h4><blockquote><p>Two global variables, <b>snDcr</b> and <b>snDcr2</b>, are used to set the SONICdevice configuration registers.  By default, the device is programmed in32-bit mode with zero wait states.  If these values are not suitable,the <b>snDcr</b> and <b>snDcr2</b> variables should be modified before calling<b><i><a href="./if_sn.html#snattach">snattach</a></i>(&nbsp;)</b>.  See the SONIC manual to change these parameters.<p></blockquote><h4>SYSTEM RESOURCE USAGE</h4><blockquote><p>When implemented, this driver requires the following system resources:<p>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;one&nbsp;interrupt&nbsp;vector<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;0&nbsp;bytes&nbsp;in&nbsp;the&nbsp;initialized&nbsp;data&nbsp;section&nbsp;(data)<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;696&nbsp;bytes&nbsp;in&nbsp;the&nbsp;uninitialized&nbsp;data&nbsp;section&nbsp;(BSS)<p>The above data and BSS requirements are for the MC68020 architecture and may vary for other architectures.  Code size (text) varies greatly betweenarchitectures and is therefore not quoted here.<p>This driver uses <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>(&nbsp;)</b> to allocate the memory to be shared with theSONIC device.  The size requested is 117,188 bytes.<p>The SONIC device can only be operated if the shared memory region iswrite-coherent with the data cache.  The driver cannot maintain cachecoherency for the device for data that is written by the driverbecause fields within the shared structures are asynchronously modified bythe driver and the device, and these fields may share the same cacheline.<p></blockquote><h4>NOTE 1</h4><blockquote><p>The previous transmit descriptor does not exist until the transmitterhas been asked to send at least one packet.  Unfortunately the testfor this condition must be done every time a new descriptor is to be added,even though the condition is only true the first time.  However, itis a valuable test, since we should not use the fragment count fieldas an index if it is 0.<p></blockquote><h4>NOTE 2</h4><blockquote><p>There are some things unsupported in this version:<p>&nbsp;&nbsp;&nbsp;&nbsp;a)&nbsp;buffer&nbsp;loaning&nbsp;on&nbsp;receive<br>&nbsp;&nbsp;&nbsp;&nbsp;b)&nbsp;output&nbsp;hooks<br>&nbsp;&nbsp;&nbsp;&nbsp;c)&nbsp;trailer&nbsp;protocol<br>&nbsp;&nbsp;&nbsp;&nbsp;d)&nbsp;promiscuous&nbsp;mode<p>Also, the receive setup needs work so that the number of RRA descriptorsis not fixed at four.  It would be a nice addition to allow all thesizes of the shared memory structures to be specified by the runtimefunctions that call our init routines.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_sn.html#top">if_sn</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b><hr><a name="snattach"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>snattach</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>snattach</i>(&nbsp;)</strong> - publish the <b>sn</b> network interface and initialize the driver and device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS snattach    (    int    unit,     /* unit number */    char * pDevRegs, /* addr of device's regs */    int    ivec      /* vector number */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine publishes the <b>sn</b> interface by filling in a network interfacerecord and adding this record to the system list.  It alsoinitializes the driver and the device to the operational state.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_sn.html#top">if_sn</a></b></body></html>

⌨️ 快捷键说明

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