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

📄 ln7990end.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ln7990End.html - generated by refgen from ln7990End.c --> <title> ln7990End </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>ln7990End</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ln7990End</strong> - END style AMD 7990 LANCE Ethernet network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./ln7990End.html#ln7990EndLoad">ln7990EndLoad</a></i>(&nbsp;)</b>  -  initialize the driver and device<br><b><i><a href="./ln7990End.html#ln7990InitParse">ln7990InitParse</a></i>(&nbsp;)</b>  -  parse the initialization string<br><b><i><a href="./ln7990End.html#ln7990InitMem">ln7990InitMem</a></i>(&nbsp;)</b>  -  initialize memory for Lance chip<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements the Advanced Micro Devices Am7990 LANCE Ethernet networkinterface driver.  The driver can be configured to support big-endian orlittle-endian architectures, and it contains error recovery code to handle known device errata related to DMA activity.<p>This driver is designed to be moderately generic.  Thus, it operates unmodified across the range of architectures and targets supported by VxWorks.  To achieve this, the driver load routine requires an input string consisting of several target-specific values.  The driver also requires some external support routines.  These target-specific values and the external support routines are described below.  If any of the assumptions stated below are not true for your particular hardware, this driver might not function correctly with that hardware.<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>The only external interface is the <b><i><a href="./ln7990End.html#ln7990EndLoad">ln7990EndLoad</a></i>(&nbsp;)</b> routine, which expectsthe <i>initString</i> parameter as input.  This parameter passes in a colon-delimited string of the format:<p><i>unit</i>:<i>CSR_reg_addr</i>:<i>RAP_reg_addr</i>:<i>int_vector</i>:<i>int_level</i>:<i>shmem_addr</i>:<i>shmem_size</i>:<i>shmem_width</i>:<i>offset</i>:<i>csr3B</i><p>The <b><i><a href="./ln7990End.html#ln7990EndLoad">ln7990EndLoad</a></i>(&nbsp;)</b> function uses <b><i><a href="./ansiString.html#strtok">strtok</a></i>(&nbsp;)</b> to parse the string.<p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><dl><dt><i>unit</i><dd>A convenient holdover from the former model.  This parameter is used onlyin the string name for the driver.<p><dt><i>CSR_register_addr</i><dd>Tells the driver where to find the CSR register.<p><dt><i>RAP_register_addr</i><dd>Tells the driver where to find the RAP register.<p><dt><i>int_vector</i><dd>Configures the LANCE device to generate hardware interruptsfor various events within the device. Thus, it containsan interrupt handler routine.  The driver calls <b><i>sysIntConnect</i>(&nbsp;)</b> to connectits interrupt handler to the interrupt vector generated as a result ofthe LANCE interrupt.<p><dt><i>int_level</i><dd>This parameter is passed to an external support routine, <b><i><a href="../bsp/brutus/sysLib.html#sysLanIntEnable" >sysLanIntEnable</a></i>(&nbsp;)</b>,which is described below in "External Support Requirements." This routine is called during as part of driver's initialization.  It handles any board-specific operations required to allow the servicing of a LANCE interrupt on targets that use additional interrupt controller devices to help organize and service the various interrupt sources.  This parameter makes it possible for this driver to avoid all board-specific knowledge of such devices.  <p><dt><i>shmem_addr</i><dd>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 driverattempts to allocate the shared memory from the system space.<p><dt><i>shmem_size</i><dd>Use this parameter to explicitly limit the amount of shared memory (bytes) that this driver uses.  Use "NONE" to indicate that there is no specific size limitation.  This parameter is used only if a specific memory region is provided to the driver.<p><dt><i>shmem_width</i><dd>Some target hardware that restricts the shared memory region to aspecific location also restricts the access width to this region bythe CPU.  On such targets, performing an access of an invalid widthcauses a bus error.  Use this parameter to specify the number of bytes on which data must be aligned if it is to be used by the driver during access to the shared memory.  Use "NONE" to indicate that there are no restrictions.  The support for this mechanism is not robust. Thus, its current implementation might not work on all targets requiring these restrictions.<p><dt><i>offset</i><dd>Specifies the memory alignment offset.<p><dt><i>csr3B</i><dd>Specifies the value that is placed into LANCE control register #3. Thisvalue determines the bus mode of the device and thus allows the support ofbig-endian and little-endian architectures.  The default value supportsMotorola-type buses.  Normally this value is 0x4.  For SPARC CPUs, it isnormally set to 0x7 to add the ACON and BCON control bits.  For moreinformation on this register and the bus mode of the LANCE controller, see<i>Advanced Micro Devices Local Area Network Controller Am7990 (LANCE). </i> </dl><p></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p>This driver requires several external support functions, defined as macros:<pre>    SYS_INT_CONNECT(pDrvCtrl, routine, arg)    SYS_INT_DISCONNECT (pDrvCtrl, routine, arg)    SYS_INT_ENABLE(pDrvCtrl)    SYS_OUT_SHORT(pDrvCtrl, reg, data)    SYS_IN_SHORT(pDrvCtrl, reg, pData)</pre>There are default values in the source code for these macros.  They presumememory-mapped accesses to the device registers and the normal <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>(&nbsp;)</b>,and <b><i><a href="./intArchLib.html#intEnable">intEnable</a></i>(&nbsp;)</b> BSP functions.  The first argument to each is the devicecontroller structure. Thus, each has access back to all the device-specificinformation.  Having the pointer in the macro facilitates the addition of new features to this driver.<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;68&nbsp;bytes&nbsp;in&nbsp;the&nbsp;initialized&nbsp;data&nbsp;section&nbsp;(data)&nbsp;/@HELP@/<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;0&nbsp;bytes&nbsp;of&nbsp;bss&nbsp;/@HELP@/<p>The above data and BSS requirements are for the MC68020 architectureand can vary for other architectures.  Code size (text) varies greatly between architectures and is therefore not quoted here.<p>If the driver is not given a specific region of memory using the <b><i><a href="./ln7990End.html#ln7990EndLoad">ln7990EndLoad</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 sharedwith 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 coherency for data that is written by the driver. That is because members within the shared structures are asynchronously modified by both the driver and the device, and these members might share the same cache line.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ln7990End.html#top">ln7990End</a></b>, <b><a href="./muxLib.html#top">muxLib</a></b>,  <i>Advanced Micro Devices Local Area Network Controller Am7990 (LANCE) </i><hr><a name="ln7990EndLoad"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ln7990EndLoad</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ln7990EndLoad</i>(&nbsp;)</strong> - initialize the driver and device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ* ln7990EndLoad    (    char* initString /* string to be parse by the driver */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the driver and the device to the operational state.All of the device-specific parameters are passed in <i>initString</i>, whichexpects a string of the following format:<p><i>unit</i>:<i>CSR_reg_addr</i>:<i>RAP_reg_addr</i>:<i>int_vector</i>:<i>int_level</i>:<i>shmem_addr</i>:<i>shmem_size</i>:<i>shmem_width</i><p>This routine can be called in two modes. If it is called with an empty butallocated string, it places the name of this device (that is, "ln") into the <i>initString</i> and returns 0.<p>If the string is allocated and not empty, the routine attempts to loadthe driver using the values specified in the string.<p></blockquote><h4>RETURNS</h4><blockquote><p>An END object pointer, or NULL on error, or 0 and the name of thedevice if the <i>initString</i> was NULL.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ln7990End.html#top">ln7990End</a></b><hr><a name="ln7990InitParse"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ln7990InitParse</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ln7990InitParse</i>(&nbsp;)</strong> - parse the initialization string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ln7990InitParse    (    LN7990END_DEVICE * pDrvCtrl,    char *             initString    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Parse the input string.  Fill in values in the driver control structure.The initialization string format is:<i>unit</i>:<i>csrAdr</i>:<i>rapAdr</i>:<i>vecnum</i>:<i>intLvl</i>:<i>memAdrs</i>:<i>memSize</i>:<i>memWidth</i>:<i>offset</i>:<i>csr3B</i><p><dl><dt><i>unit</i><dd>Device unit number, a small integer.<p><dt><i>csrAdr</i><dd>Address of CSR0 register.<p><dt><i>rapAdr</i><dd>Address of RAP register.<p><dt><i>vecNum</i><dd>Interrupt vector number (used with <b><i>sysIntConnect</i>(&nbsp;)</b> ).<p><dt><i>intLvl</i><dd>Interrupt level.<p><dt><i>memAdrs</i><dd>Memory pool address or NONE.<p><dt><i>memSize</i><dd>Memory pool size or zero.<p><dt><i>memWidth</i><dd>Memory system size, 1, 2, or 4 bytes (optional).<p><dt><i>offset</i><dd>Memory offset for alignment.<p><dt><i>csr3B</i><dd> CSR register 3B control value, normally 0x4 or 0x7.<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;any&nbsp;arguments&nbsp;are&nbsp;invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ln7990End.html#top">ln7990End</a></b><hr><a name="ln7990InitMem"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ln7990InitMem</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ln7990InitMem</i>(&nbsp;)</strong> - initialize memory for Lance chip</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ln7990InitMem    (    LN7990END_DEVICE * pDrvCtrl /* device to be initialized */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Using data in the control structure, setup and initialize the memoryareas needed.  If the memory address is not already specified, then allocatecache safe memory.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ln7990End.html#top">ln7990End</a></b></body></html>

⌨️ 快捷键说明

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