📄 dec21x4xend.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/dec21x4xEnd.html - generated by refgen from dec21x4xEnd.c --> <title> dec21x4xEnd </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>dec21x4xEnd</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dec21x4xEnd</strong> - END style DEC 21x4x PCI Ethernet network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./dec21x4xEnd.html#dec21x4xEndLoad">dec21x4xEndLoad</a></i>( )</b> - initialize the driver and device<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This module implements a DEC 21x4x PCI Ethernet network interface driver andsupports 21040, 21140 and 21143 versions of the chip.<p>The DEC 21x4x PCI Ethernet controller is little endian because it interfaceswith a little endian PCI bus. Although PCI configuration for a device ishandled in the BSP, all other device programming and initialization are handledin this module.<p>This driver is designed to be moderately generic. Without modification, it canoperate across the range of architectures and targets supported by VxWorks.To achieve this, the driver requires a few external support routines as wellas several target-specific parameters. These parameters, and the mechanismsused to communicate them to the driver, are detailed below. If any of theassumptions stated below are not true for your particular hardware, you need tomodify the driver before it can operate correctly on your hardware.<p>On 21040, the driver configures the 10BASE-T interface by default, waits fortwo seconds, and checks the status of the link. If the link status indicatesfailure, AUI interface is configured.<p>On other versions of the 2114x family, the driver reads media information froma DEC serial ROM and configures the media. On targets that do not support aDEC format serial ROM, the driver calls a target-specfic media select routineusing the hook, _func_dec2114xMediaSelect, to configure the media.<p>The driver supports big-endian or little-endian architectures (as a configurable option). The driver also and contains error recovery code that handles known device errata related to DMA activity.<p>Big endian processors can be connected to the PCI bus through some controllerswhich take care of hardware byte swapping. In such cases all the registerswhich the chip DMAs to have to be swapped and written to, so that when thehardware swaps the accesses, the chip would see them correctly. The chip stillhas to be programmed to operate in little endian mode as it is on the PCIbus. If the cpu board hardware automatically swaps all the accesses to andfrom the PCI bus, then input and output byte stream need not be swapped.<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><p>The driver provides one standard external interface, <b><i><a href="./dec21x4xEnd.html#dec21x4xEndLoad">dec21x4xEndLoad</a></i>( )</b>, whicha takes a string of colon separated parameters. The parameters should bespecified as hexadecimal strings, optionally preceded by "0x" or a minus sign"-".<p>Although the parameter string is parsed using <b><i><a href="./ansiString.html#strtok_r">strtok_r</a></i>( )</b>, each parameter isconverted from string to binary by a call to strtoul(parameter, NULL, 16).<p>The format of the parameter string is:<p> "<i>unit number</i>:<i>device addr</i>:<i>PCI addr</i>:<i>ivec</i>:<i>ilevel</i>:<i>mem base</i>:\<i>mem size</i>:<i>user flags</i>:<i>offset</i>"<p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><p><dl><dt>unit number<dd><p>This represents the device instance number relative to this driver. I.e. a value of zero represents the first dec21x4x device, a value of 1represents the second dec21x4x device.<p><dt>device addr<dd><p>This is the base address at which the hardware device registers are located.<p><dt>PCI addr<dd><p>This parameter defines the main memory address over the PCI bus. It is used totranslate physical memory address into PCI accessible address.<p><dt>ivec<dd><p>This is the interrupt vector number of the hardware interrupt generated bythis Ethernet device. The driver uses intConnect, or pciIntConnect (x86 arch),to attach an interrupt handler for this interrupt.<p><dt>ilevel<dd><p>This parameter defines the level of the hardware interrupt.<p><dt>mem base<dd><p>This parameter specifies the base address of a DMA-able, cache free,pre-allocated memory region for use as a memory pool for transmit/receivedescriptors and buffers.<p>If there is no pre-allocated memory available for the driver, this parametershould be -1 (NONE). In which case, the driver allocates cache safe memoryfor its use using <b><i>cacheDmaAlloc</i>( )</b>.<p><dt>mem size<dd><p>The memory size parameter specifies the size of the pre-allocated memoryregion. If memory base is specified as NONE (-1), the driver ignores thisparameter.<p><dt>user flags<dd><p>User flags control the run-time characteristics of the Ethernetchip. Most flags specify non default CSR0 bit values. Refer to<b>dec21x4xEnd.h</b> for the bit values of the flags, and to the device hardwarereference manual for details about device capabilities, and CSR 0.<p>Some of them are worth mentioning:<p>Full Duplex Mode: When set, the <b>DEC_USR_FD</b> flag allows the device towork in full duplex mode, as long as the PHY used has thiscapability. It is worth noting here that in this operation mode,the dec21x40 chip ignores the Collision and the Carrier Sense signals.<p>Transmit treshold value: The <b>DEC_USR_THR_XXX</b> flags enable the user tochoose among different threshold values for the transmit FIFO.Transmission starts when the frame size within the transmit FIFO islarger than the treshold value. This should be selected taking intoaccount the actual operating speed of the PHY. Again, see the devicehardware reference manual for details.<p><dt>offset<dd><p>This parameter defines the offset which is used to solve alignment problem.<p><dt>Device Type<dd><p>Although the default device type is DEC 21040, specifying the <b>DEC_USR_21140</b>or <b>DEC_USR_21143</b> flag bit turns on DEC 21140 or <b>DEC_USR_21143</b> functionality.<p><dt>Ethernet Address<dd><p>The Ethernet address is retrieved from standard serial ROM on DEC 21040, DEC21140 and DEC 21143 devices. If retrieve from ROM fails, the driver calls theBSP routine, <b><i><a href="../bsp/cma220/sysLib.html#sysDec21x4xEnetAddrGet" >sysDec21x4xEnetAddrGet</a></i>( )</b>. Specifying <b>DEC_USR_XEA</b> flag bit tellsthe driver should, by default, retrieve the Ethernet address usingthe BSP routine, <b><i><a href="../bsp/cma220/sysLib.html#sysDec21x4xEnetAddrGet" >sysDec21x4xEnetAddrGet</a></i>( )</b>.<p><dt>Priority RX processing<dd><p>The driver programs the chip to process the transmit and receive queues at thesame priority. By specifying <b>DEC_USR_BAR_RX</b>, the device is programmedto process receives at a higher priority.<p><dt>TX poll rate<dd><p>By default, the driver sets the Ethernet chip into a non-polling mode. In this mode, if the transmit engine is idle, it is kick-started every time a packet needs to be transmitted. Alternately, the chip can be programmed to poll for the next available transmit descriptor if the transmit engine is in idle state. The poll rate is specified by one of DEC_USR_TAP_xxx.<p><dt>Cache Alignment<dd><p>The DEC_USR_CAL_xxx flags specify the address boundaries fordata burst transfers.<p><dt>DMA burst length<dd><p>The DEC_USR_PBL_xxx flags specify the maximum number of longwords in a DMA burst.<p><dt>PCI multiple read<dd><p>The <b>DEC_USR_RML</b> flag specifies that a device supports PCImemory-read-multiple.<p> </dl></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p><p>This driver requires four external support functions, and provides a hookfunction:<p><dl><dt>void sysLanIntEnable (int level)<dd><p>This routine provides a target-specific interface for enabling Ethernet deviceinterrupts at a specified interrupt level.<p><dt>void sysLanIntDisable (void)<dd><p>This routine provides a target-specific interface for disabling Ethernet deviceinterrupts.<p><dt>STATUS sysDec21x4xEnetAddrGet (int unit, char *enetAdrs)<dd><p>This routine provides a target-specific interface for accessing a deviceEthernet address.<p><dt>STATUS sysDec21143Init (<b>DRV_CTRL</b> * pDrvCtrl)<dd><p>This routine performs any target-specific initializationrequired before the dec21143 device is initialized by the driver.The driver calls this routine every time it wants to loadthe device. This routine returns OK, or ERROR if it fails.<p><dt>FUNCPTR _func_dec2114xMediaSelect<dd><p>This driver provides a default media select routine, when<_func_dec2114xMediaSelect> is NULL, to read and setup physical media withconfiguration information from a Version 3 DEC Serial ROM. Any other mediaconfiguration can be supported by initializing <_func_dec2114xMediaSelect>,typically in <b><i><a href="./sysLib.html#sysHwInit">sysHwInit</a></i>( )</b>, to a target-specific media select routine.<p>A media select routine is typically defined as:<p><pre> STATUS decMediaSelect ( DEC21X4X_DRV_CTRL * pDrvCtrl, /* Driver control */ UINT * pCsr6Val /* CSR6 return value */ ) { ... }</pre>Parameter <i>pDrvCtrl</i> is a pointer to the driver control structure which thisroutine may use to access the Ethenet device. The driver control structurefield mediaCount, is initialized to 0xff at startup, while the other mediacontrol fields (mediaDefault, mediaCurrent, and gprModeVal) are initialized tozero. This routine may use these fields in any manner, however all otherdriver control fields should be considered read-only and should not bemodified.<p>This routine should reset, initialize and select an appropriate media, andwrite necessary the CSR6 bits (port select, PCS, SCR, and full duplex) tomemory location pointed to by <i>pCsr6Val</i>. The driver will use this value toprogram register CSR6. This routine should return OK, and ERROR on failure.<p><dt>FUNCPTR _func_dec2114xIntAck<dd><p>This driver does acknowledge the LAN interrupts. However if the board hardwarerequires specific interrupt acknowledgement, not provided by this driver,the BSP should define such a routine and attach it to the driver via_func_dec2114xIntAck. <p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dec21x4xEnd.html#top">dec21x4xEnd</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>, <i>DECchip 21040 Ethernet LAN Controller for PCI. </i><i>Digital Semiconductor 21140A PCI Fast Ethernet LAN Controller. </i><i>Digital Semiconductor 21143 PCI/CardBus Fast Ethernet LAN Controller. </i><i>Using the Digital Semiconductor 21140A with Boot ROM, Serial ROM, </i>and External Register: An Application Note"<i>Using the Digital Semiconductor 21143 with Boot ROM, Serial ROM, </i>and External Register: An Application Note"<hr><a name="dec21x4xEndLoad"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dec21x4xEndLoad</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dec21x4xEndLoad</i>( )</strong> - initialize the driver and device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ * dec21x4xEndLoad ( char * initStr /* 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 the initString.<p>This routine can be called in two modes. If it is called with an empty, butallocated string then it places the name of this device (i.e. dc) into theinitString and returns 0.<p>If the string is allocated then the routine attempts to perform its loadfunctionality.<p></blockquote><h4>RETURNS</h4><blockquote><p>An END object pointer or NULL on error or 0 and the name of thedevice if the initString was NULL.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dec21x4xEnd.html#top">dec21x4xEnd</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -