📄 dec21x40end.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/dec21x40End.html - generated by refgen from dec21x40End.c --> <title> dec21x40End </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>dec21x40End</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dec21x40End</strong> - END-style DEC 21x40 PCI Ethernet network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./dec21x40End.html#dec21x40EndLoad">dec21x40EndLoad</a></i>( )</b> - initialize the driver and device<br><b><i><a href="./dec21x40End.html#dec21140SromWordRead">dec21140SromWordRead</a></i>( )</b> - read two bytes from the serial ROM<br><b><i><a href="./dec21x40End.html#dec21x40PhyLinkPoll">dec21x40PhyLinkPoll</a></i>( )</b> - Poll the PHY for link status<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements a DEC 21x40 PCI Ethernet network interface driver andsupports both the 21040, 21140, and 21143 versions of the chip.<p>The DEC 21x40 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 needs are handled in this module.<p>This driver is designed to be moderately generic. Without modification, it canoperate across the full 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 to modify the driver before it can operate correctly on your hardware.<p>On the 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 21x40 family, the driver reads media information froma DEC serial ROM and configures the media. To configure the media on targets that do not support a DEC format serial ROM, the driver calls the target-specific media-select routine referenced inthe <b>_func_dec21x40MediaSelect</b> hook. <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 controllersthat 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>The driver provides one standard external interface, <b><i><a href="./dec21x40End.html#dec21x40EndLoad">dec21x40EndLoad</a></i>( )</b>. As input, this function expects a string of colon-separated parameters. The parameters should be specified as hexadecimal strings (optionally preceded by "0x" or a minus sign "-"). Although the parameter string is parsed using <b><i><a href="./ansiString.html#strtok_r">strtok_r</a></i>( )</b>, each parameter is converted from string to binary by a call to:<pre> strtoul(parameter, NULL, 16).</pre>The format of the parameter string is:<p><i>device_addr</i>:<i>PCI_addr</i>:<i>ivec</i>:<i>ilevel</i>:<i>num_rds</i>:<i>num_tds</i>:<i>mem_base</i>:<i>mem_size</i>:<i>user_flags</i><p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><dl><dt><i>device_addr</i><dd>This is the base address at which the hardware device registers are located.<p><dt><i>PCI_addr</i><dd>This parameter defines the main memory address over the PCI bus. It is used totranslate a physical memory address into a PCI-accessible address.<p><dt><i>ivec</i><dd>This is the interrupt vector number of the hardware interrupt generated bythis Ethernet device. The driver uses <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>( )</b> to attach an interrupthandler for this interrupt.<p><dt><i>ilevel</i><dd>This parameter defines the level of the hardware interrupt.<p><dt><i>num_rds</i><dd>The number of receive descriptors to use. This controls how much datathe device can absorb under load. If this is specified as NONE (-1), the default of 32 is used.<p><dt><i>num_tds</i><dd>The number of transmit descriptors to use. This controls how much datathe device can absorb under load. If this is specified as NONE (-1) thenthe default of 64 is used.<p><dt><i>mem_base</i><dd>This parameter specifies the base address of a DMA-able cache-freepre-allocated memory region for use as a memory pool for transmit/receivedescriptors and buffers.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><i>mem_size</i><dd>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><i>user_flags</i><dd>User flags control the run-time characteristics of the Ethernetchip. Most flags specify non default CSR0 and CSR6 bit values. Refer to<b>dec21x40End.h</b> for the bit values of the flags and to the device hardwarereference manual for details about device capabilities, CSR6 and CSR0.<p>Device Type: Although the default device type is DEC 21040, specifying the <b>DEC_USR_21140</b> flag bit turns on DEC 21140 functionality.<p>Ethernet Address: The Ethernet address is retrieved from standard serial ROM on both DEC 21040, and DEC 21140 devices. If the retrieve from ROM fails, the driver calls the <b><i><a href="../bsp/mcp750/sysLib.html#sysDec21x40EnetAddrGet" >sysDec21x40EnetAddrGet</a></i>( )</b> BSP routine. Specifying <b>DEC_USR_XEA</b> flag bit tells the driver should, by default, retrieve the Ethernet address using the <b><i><a href="../bsp/mcp750/sysLib.html#sysDec21x40EnetAddrGet" >sysDec21x40EnetAddrGet</a></i>( )</b> BSP routine.<p>Priority RX processing: The driver programs the chip to process the transmit and receive queues at the same priority. By specifying <b>DEC_USR_BAR_RX</b>,the device is programmed to process receives at a higher priority.<p>TX poll rate: 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. Alternatively, 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_<i>xxx</i> flags.<p>Cache Alignment: The DEC_USR_CAL_<i>xxx</i> flags specify the address boundaries for data burst transfers.<p>DMA burst length: The DEC_USR_PBL_<i>xxx</i> flags specify the maximum number of long words in a DMA burst.<p>PCI multiple read: The <b>DEC_USR_RML</b> flag specifies that a device supports PCI memory-read-multiple.<p>Full Duplex Mode: When set, the <b>DEC_USR_FD</b> flag allows the device to work 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>MII/Phy Checking: When set, and when a MII interface is being utilizedthe <b>DEC_USR_PHY_CHK</b> flag instructs the driver to wait until the PHY linkstatus has changed to <b>up</b> before continuing. This time period could beas long as six seconds, but in general is on the order of two seconds.If clear, the check will not be performed. This option may be selected ifthe delay is unacceptable, but it is possible that a fast target mayattempt to send packets before the link is up. This will result in<b>no carrier</b> errors in packet transmission.<p>Transmit treshold value: The <b>DEC_USR_THR_XXX</b> flags enable the user to choose among different threshold values for the transmit FIFO. Transmission starts when the frame size within the transmit FIFO is larger than the treshold value. This should be selected taking into account the actual operating speed of the PHY. Again, see the device hardware reference manual for details.<p></dl></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p><p>This driver requires three external support functions and provides a hookfunction:<p><dl><dt><b><i><a href="../bsp/brutus/sysLib.html#sysLanIntEnable" >sysLanIntEnable</a></i>( )</b><dd><pre> void sysLanIntEnable (int level)</pre>This routine provides a target-specific interface for enabling Ethernet deviceinterrupts at a specified interrupt level.<p><dt><b><i><a href="../bsp/brutus/sysLib.html#sysLanIntDisable" >sysLanIntDisable</a></i>( )</b><dd><pre> void sysLanIntDisable (void)</pre>This routine provides a target-specific interface for disabling Ethernet deviceinterrupts.<p><dt><b><i><a href="../bsp/mcp750/sysLib.html#sysDec21x40EnetAddrGet" >sysDec21x40EnetAddrGet</a></i>( )</b><dd><pre> STATUS sysDec21x40EnetAddrGet (int unit, char *enetAdrs)</pre>This routine provides a target-specific interface for accessing a deviceEthernet address.<p><dt><b>_func_dec21x40MediaSelect</b><dd><pre> FUNCPTR _func_dec21x40MediaSelect</pre>If <b>_func_dec21x40MediaSelect</b> is NULL, this driver provides a default media-select routine that reads and sets up physical media using the configuration information from a Version 3 DEC Serial ROM. Any other mediaconfiguration can be supported by initializing <b>_func_dec21x40MediaSelect</b>,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 ( DEC21X40_DRV_CTRL * pDrvCtrl, /* driver control */ UINT * pCsr6Val /* CSR6 return value */ ) { ... }</pre>The <i>pDrvCtrl</i> parameter is a pointer to the driver control structure that thisroutine can use to access the Ethenet device. The driver control structuremember <b>mediaCount</b>, is initialized to 0xff at startup, while the other mediacontrol members (<b>mediaDefault</b>, <b>mediaCurrent</b>, and <b>gprModeVal</b>) are initialized to zero. This routine can use these fields in any manner. However, all other driver control structure members should be considered read-only and should not be modified.<p>This routine should reset, initialize, and select an appropriate media. Itshould also write necessary the CSR6 bits (port select, PCS, SCR, and full duplex) to the memory location pointed to by <i>pCsr6Val</i>. The driver uses this value to program register CSR6. This routine should return OK or ERROR.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dec21x40End.html#top">dec21x40End</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>Using the Digital Semiconductor 21140A with Boot ROM, Serial ROM, and External Register: An Application Note </i><hr><a name="dec21x40EndLoad"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dec21x40EndLoad</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dec21x40EndLoad</i>( )</strong> - initialize the driver and device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ* dec21x40EndLoad ( 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 an operational state.All of the device-specific parameters are passed in the <i>initStr</i>.If this routine is called with an empty but allocated string, it puts the name of this device (that is, "dc") into the <i>initStr</i> and returns 0.If the string is allocated but not empty, this routine tries to loadthe device.<p></blockquote><h4>RETURNS</h4><blockquote><p>An END object pointer or NULL on error.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dec21x40End.html#top">dec21x40End</a></b><hr><a name="dec21140SromWordRead"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dec21140SromWordRead</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dec21140SromWordRead</i>( )</strong> - read two bytes from the serial ROM</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>USHORT dec21140SromWordRead ( DRV_CTRL * pDrvCtrl, UCHAR lineCnt /* Serial ROM line Number */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the two bytes of information that is associated with it the specified ROM line number. This will later be used by the dec21140GetEthernetAdr function. It can also be used to review the ROM contents itself.The function must first send some initial bit patterns to the CSR9 that contains the Serial ROM Control bits. Then the line index into the ROMis evaluated bit-by-bit to program the ROM. The 2 bytes of dataare extracted and processed into a normal pair of bytes. <p></blockquote><h4>RETURNS</h4><blockquote><p>Value from ROM or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dec21x40End.html#top">dec21x40End</a></b><hr><a name="dec21x40PhyLinkPoll"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dec21x40PhyLinkPoll</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dec21x40PhyLinkPoll</i>( )</strong> - Poll the PHY for link status</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>UINT dec21x40PhyLinkPoll ( DRV_CTRL * pDrvCtrl, UINT linkTry )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p></blockquote><h4>RETURNS</h4><blockquote><p>number of poll iterations remaining when link became active</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dec21x40End.html#top">dec21x40End</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -