📄 if_fei.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/if_fei.html - generated by refgen from if_fei.c --> <title> if_fei </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_fei</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>if_fei</strong> - Intel 82557 Ethernet network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b> - publish the <b>fei</b> network interface<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements the Intel 82557 Ethernet network interface driver.<p>This driver is designed to be moderately generic, operating unmodifiedacross the entire range of architectures and targets supported by VxWorks.This driver must be given several target-specific parameters, and someexternal support routines must be provided. These parameters, and themechanisms used to communicate them to the driver, are detailed below.<p>This driver supports up to four individual units.<p></blockquote><h4>EXTERNAL INTERFACE</h4><blockquote><p>The user-callable routine is <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b>, which publishes the <b>fei</b>interface and performs some initialization.<p>After calling <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b> to publish the interface, an initializationroutine must be called to bring the device up to an operational state.The initialization routine is not a user-callable routine; upper layerscall it when the interface flag is set to <b>UP</b>, or when the interface'sIP address is set.<p>There is a global variable <b>feiIntConnect</b> which specifies the interruptconnect routine to be used depending on the BSP. This is by default set to <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>( )</b> and the user can override this to use any other interrupt connect routine ( say <b><i><a href="../bsp/cma220/sysLib.html#pciIntConnect" >pciIntConnect</a></i>( )</b> ) in <b><i><a href="./sysLib.html#sysHwInit">sysHwInit</a></i>( )</b> or any device specific initialization routine called in <b><i><a href="./sysLib.html#sysHwInit">sysHwInit</a></i>( )</b>.<p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><dl><dt>shared memory address<dd>This parameter is passed to the driver via <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b>.<p>The Intel 82557 device is a DMA-type device and typically sharesaccess to some region of memory with the CPU. This driver is designedfor systems that directly share memory between the CPU and the 82557.<p>This parameter can be used to specify an explicit memory region for useby the 82557. This should be done on targets that restrict the 82557to a particular memory region. The constant <b>NONE</b> 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>number of Command, Receive, and Loanable-Receive Frame Descriptors<dd>These parameters are passed to the driver via <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b>.<p>The Intel 82557 accesses frame descriptors (and their associated buffers)in memory for each frame transmitted or received. The number of framedescriptors can be configured at run-time using these parameters.<p><dt>Ethernet address<dd>This parameter is obtained by a call to an external support routine. </dl><p></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p>This driver requires the following external support function:<pre> STATUS sys557Init (int unit, BOARD_INFO *pBoard)</pre>This routine performs any target-specific initializationrequired before the 82557 device is initialized by the driver.The driver calls this routine every time it wants to [re]initializethe device. This routine returns OK, or ERROR if it fails.<p></blockquote><h4>SYSTEM RESOURCE USAGE</h4><blockquote><p>The driver uses <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>( )</b> to allocate memory to share with the 82557.The size of this area is affected by the configuration parameters specifiedin the <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b> call. The size of one RFD (Receive Frame Descriptor) isis the same as one CFD (Command Frame Descriptor): 1536 bytes. For moreinformation about RFDs and CFDs, see the<i>Intel 82557 User's Manual. </i><p>Either the shared memory region must be non-cacheable, or elsethe hardware must implement bus snooping. The driver cannot maintaincache coherency for the device because fields within the commandstructures are asynchronously modified by both the driver and the device,and these fields may share the same cache line.<p>Additionally, this version of the driver does not handle virtual-to-physicalor physical-to-virtual memory mapping.<p></blockquote><h4>TUNING HINTS</h4><blockquote><p>The only adjustable parameters are the number of Frame Descriptors that will becreated at run-time. These parameters are given to the driver when <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b>is called. There is one CFD and one RFD associated with each transmittedframe and each received frame, respectively. For memory-limited applications,decreasing the number of CFDs and RFDs may be desirable. Increasing the numberof CFDs will provide no performance benefit after a certain point.Increasing the number of RFDs will provide more buffering before packets aredropped. This can be useful if there are tasks running at a higher prioritythan the net task.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_fei.html#top">if_fei</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>, <i>Intel 82557 User's Manual </i><hr><a name="feiattach"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>feiattach</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>feiattach</i>( )</strong> - publish the <b>fei</b> network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS feiattach ( int unit, /* unit number */ char * memBase, /* address of shared memory (NONE = malloc) */ int nCFD, /* command frames (0 = default) */ int nRFD, /* receive frames (0 = default) */ int nRFDLoan /* loanable rx frames (0 = default, -1 = 0) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine publishes the <b>fei</b> interface by filling in a network interfacerecord and adding the record to the system list.<p>The 82557 shares a region of main memory with the CPU. The caller of thisroutine can specify the address of this shared memory region through the<i>memBase</i> parameter; if <i>memBase</i> is set to the constant <b>NONE</b>, thedriver will allocate the shared memory region.<p>If the caller provides the shared memory region, the driver assumesthat this region does not require cache coherency operations.<p>If the caller indicates that <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b> must allocate the shared memoryregion, <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b> will use <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>( )</b> to obtain a blockof non-cacheable memory. The attributes of this memory will be checked,and if the memory is not both read and write coherent, <b><i><a href="./if_fei.html#feiattach">feiattach</a></i>( )</b> willabort and return ERROR.<p>A default number of 32 command (transmit) and 32 receive frames can beselected by passing zero in the parameters <i>nCFD</i> and <i>nRFD</i>, respectively.If <i>nCFD</i> or <i>nRFD</i> is used to select the number of frames, the valuesshould be greater than two.<p>A default number of 8 loanable receive frames can be selected by passingzero in the parameters <i>nRFDLoan</i>, else set <i>nRFDLoan</i> to the desirednumber of loanable receive frames. If <i>nRFDLoan</i> is set to -1, noloanable receive frames will be allocated/used.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the driver could not be published and initialized.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_fei.html#top">if_fei</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>, <i>Intel 82557 User's Manual </i></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -