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

📄 if_ln.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/if_ln.html - generated by refgen from if_ln.c --> <title> if_ln </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_ln</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>if_ln</strong> - AMD Am7990 LANCE Ethernet network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>  -  publish the <b>ln</b> network interface and initialize driver structures<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements the Advanced Micro Devices Am7990 LANCE Ethernet networkinterface driver.<p>This driver is designed to be moderately generic, operating unmodifiedacross the range of architectures and targets supported by VxWorks.  Toachieve this, the driver must be given several target-specific parameters,and some external support routines must be provided.  These parameters,and the mechanisms used to communicate them to the driver, are detailedbelow.  If any of the assumptions stated below are not true for yourparticular hardware, this driver will probably not function correctly withit.<p>This driver supports only one LANCE unit per CPU.  The driver can beconfigured to support big-endian or little-endian architectures.  Itcontains error recovery code to handle known device errata related to DMAactivity.<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>The only user-callable routine is <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>, which publishes the <b>ln</b>interface and initializes the driver and device.<p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><dl><dt>bus mode<dd>This parameter is a global variable that can be modified at run-time.<p>The LANCE control register #3 determines the bus mode of the device,allowing the support of big-endian and little-endian architectures.This parameter, defined as "u_short lnCSR_3B", is the value that willbe placed into LANCE control register #3.  The default value supportsMotorola-type buses.  For information about changing this parameter, see the manual<i>Advanced Micro Devices Local Area Network Controller Am7990 (LANCE). </i><p><dt>base address of device registers<dd>This parameter is passed to the driver by <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>.  It indicates to the driver where to find the RDP register.<p>The LANCE presents two registers to the external interface, the RDP (registerdata port) and RAP (register address port) registers.  This driver assumes that these two registers occupy two unique addresses in a memory spacethat is directly accessible by the CPU executing this driver.  The driverassumes that the RDP register is mapped at a lower address than the RAPregister; the RDP register is therefore considered the "base address."<p><dt>interrupt vector<dd>This parameter is passed to the driver by <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>.<p>This driver configures the LANCE device to generate hardware interruptsfor various events within the device; thus it containsan interrupt handler routine.  The driver calls <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>(&nbsp;)</b> to connect its interrupt handler to the interrupt vector generated as a result of the LANCE interrupt.<p><dt>interrupt level<dd>This parameter is passed to the driver by <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>.<p>Some targets use additional interrupt controller devices to help organizeand service the various interrupt sources.  This driver avoids allboard-specific knowledge of such devices.  During the driver'sinitialization, the external routine <b><i><a href="../bsp/brutus/sysLib.html#sysLanIntEnable" >sysLanIntEnable</a></i>(&nbsp;)</b> is called toperform any board-specific operations required to allow the servicing of aLANCE interrupt.  For a description of <b><i><a href="../bsp/brutus/sysLib.html#sysLanIntEnable" >sysLanIntEnable</a></i>(&nbsp;)</b>, see "ExternalSupport Requirements" below.<p>This parameter is passed to the external routine.<p><dt>shared memory address<dd>This parameter is passed to the driver by <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>.<p>The LANCE device is a DMA type of device and typically shares access tosome region of memory with the CPU.  This driver is designed for systemsthat directly share memory between the CPU and the LANCE.  Itassumes that this shared memory is directly available to itwithout any arbitration or timing concerns.<p>This parameter can be used to specify an explicit memory region for useby the LANCE.  This should be done on hardware that restricts the LANCEto a particular memory region.  The constant NONE can be used to indicatethat there are no memory limitations, in which case, the driver attempts to allocate the shared memory from the system space.<p><dt>shared memory size<dd>This parameter is passed to the driver by <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>.<p>This parameter can be used to explicitly limit the amount of sharedmemory (bytes) this driver will use.  The constant NONE can be used toindicate no specific size limitation.  This parameter is used only ifa specific memory region is provided to the driver.<p><dt>shared memory width<dd>This parameter is passed to the driver by <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>.<p>Some target hardware that restricts the shared memory region to aspecific location also restricts the access width to this region bythe CPU.  On these targets, performing an access of an invalid widthwill cause a bus error.<p>This parameter can be used to specify the number of bytes of accesswidth to be used by the driver during access to the shared memory.The constant NONE can be used to indicate no restrictions.<p>Current internal support for this mechanism is not robust; implementation may not work on all targets requiring these restrictions.<p><dt>Ethernet address<dd>This parameter is obtained directly from a global memory location.<p>During initialization, the driver needs to know the Ethernet address forthe LANCE device.  The driver assumes that this address is available ina global, six-byte character array, lnEnetAddr[].  This array istypically created and stuffed by the BSP code. </dl><p></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p>This driver requires one external support function:<dl><dt>void sysLanIntEnable (int level)<dd>This routine provides a target-specific enable of the interrupt forthe LANCE device.  Typically, this involves interrupt controller hardware,either internal or external to the CPU.<p>This routine is called once, from the <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b> routine. </dl><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;mutual&nbsp;exclusion&nbsp;semaphore<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;one&nbsp;interrupt&nbsp;vector<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;24&nbsp;bytes&nbsp;in&nbsp;the&nbsp;initialized&nbsp;data&nbsp;section&nbsp;(data)<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;208&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>If the driver is not given a specific region of memory via the <b><i><a href="./if_ln.html#lnattach">lnattach</a></i>(&nbsp;)</b>routine, then it calls <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>(&nbsp;)</b> to allocate the memory to be shared with the LANCE.  The size requested is 80,542 bytes.  If a memory regionis provided to the driver, the size of this region is adjustable to suituser needs.<p>The LANCE can only be operated if the shared memory region is write-coherentwith the data cache.  The driver cannot maintain cache coherencyfor the device for data that is written by the driver because fieldswithin the shared structures are asynchronously modified by both the driverand the device, and these fields may share the same cache line.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_ln.html#top">if_ln</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>,  <i>Advanced Micro Devices Local Area Network Controller Am7990 (LANCE) </i><hr><a name="lnattach"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>lnattach</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>lnattach</i>(&nbsp;)</strong> - publish the <b>ln</b> network interface and initialize driver structures</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS lnattach    (    int    unit,     /* unit number */    char * devAdrs,  /* LANCE I/O address */    int    ivec,     /* interrupt vector */    int    ilevel,   /* interrupt level */    char * memAdrs,  /* address of memory pool (-1 = malloc it) */    ULONG  memSize,  /* only used if memory pool is NOT malloc()'d */    int    memWidth, /* byte-width of data (-1 = any width) */    int    spare,    /* not used */    int    spare2    /* not used */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine publishes the <b>ln</b> interface by filling in a network interfacerecord and adding this record to the system list.  This routine alsoinitializes the driver and the device to the operational state.<p>The <i>memAdrs</i> parameter can be used to specify the location of thememory that will be shared between the driver and the device.  The valueNONE is used to indicate that the driver should obtain the memory.<p>The <i>memSize</i> parameter is valid only if the <i>memAdrs</i> parameter is notset to NONE, in which case <i>memSize</i> indicates the size of theprovided memory region.<p>The <i>memWidth</i> parameter sets the memory pool's data port width (in bytes);if it is NONE, any data width is used.<p></blockquote><h4>BUGS</h4><blockquote><p>To zero out LANCE data structures, this routine uses <b><i><a href="./bLib.html#bzero">bzero</a></i>(&nbsp;)</b>, whichignores the <i>memWidth</i> specification and uses any size data access towrite to memory.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_ln.html#top">if_ln</a></b></body></html>

⌨️ 快捷键说明

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