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

📄 if_dc.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/if_dc.html - generated by refgen from if_dc.c --> <title> if_dc </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_dc</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>if_dc</strong> - DEC 21x4x Ethernet LAN network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>  -  publish the <b>dc</b> network interface.<br><b><i><a href="./if_dc.html#dcReadAllRom">dcReadAllRom</a></i>(&nbsp;)</b>  -  read entire serial rom<br><b><i><a href="./if_dc.html#dcViewRom">dcViewRom</a></i>(&nbsp;)</b>  -  display lines of serial ROM for dec21140<br><b><i><a href="./if_dc.html#dcCsrShow">dcCsrShow</a></i>(&nbsp;)</b>  -  display dec 21040/21140 status registers 0 thru 15<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This module implements an ethernet interface driver for the DEC 21x4x family,and currently supports the following variants -- 21040, 21140, and 21140A.<p>The DEC 21x4x PCI Ethernet controllers are inherently little-endian since theyare designed for a little-endian PCI bus. While the 21040 only supports a10Mps interface, other members of this family are dual-speed devices whichsupport both 10 and 100 Mbps.<p>This driver is designed to be moderately generic, operating unmodified acrossthe range of architectures and targets supported by VxWorks; and on multipleversions of the dec21x4x family. To achieve this, the driver takes severalparameters, and external support routines which are detailed below. Alsostated below are assumptions made by the driver of the hardware, and if any ofthese assumptions are not true for your hardware, the driver will probably notfunction correctly.<p>This driver supports up to 4 ethernet units per CPU, and can beconfigured for either big-endian or little-endian architectures.  Itcontains error-recovery code to handle known device errata related to DMAactivity.<p>On a dec21040, this driver configures the 10BASE-T interface by default andwaits for two seconds to check the status of the link. If the link status is"fail," it then configures the AUI interface.<p>The dec21140, and dec21140A devices support both 10 and 100Mbps and also avariety of MII and non-MII PHY interfaces. This driver reads a DEC version 2.0SROM device for PHY initialization information, and automatically configuresan apropriate active PHY media.<p></blockquote><h4>BOARD LAYOUT</h4><blockquote><p><p>This device is on-board.  No jumpering diagram is necessary.<p></blockquote><h4>EXTERNAL INTERFACE</h4><blockquote><p><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_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>, which publishes the <b>dc</b>interface and initializes the driver and device.<p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><p><dl><dt>bus mode<dd><p>This parameter is a global variable that can be modified at run-time.<p>The LAN control register #0 determines the bus mode of the device,allowing the support of big-endian and little-endian architectures.This parameter, defined as "ULONG dcCSR0Bmr", is the value that willbe placed into device control register #0. The default is mode is littleendian.<p>For information about changing this parameter, see the manual<p><i>DEC  Local Area Network Controller DEC21040 or DEC21140 for PCI. </i><p><dt>base address of device registers<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>.<p><dt>interrupt vector<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>.<p>This driver configures the 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 device interrupt.<p><dt>interrupt level<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>.<p>Some targets use additional interrupt controller devices to help organize andservice the various interrupt sources.  This driver avoids all board-specificknowledge of such devices.  During the driver's initialization, the externalroutine <b><i><a href="../bsp/brutus/sysLib.html#sysLanIntEnable" >sysLanIntEnable</a></i>(&nbsp;)</b> is called to perform any board-specific operationsrequired to allow the servicing of a device interrupt.  For a description of<b><i><a href="../bsp/brutus/sysLib.html#sysLanIntEnable" >sysLanIntEnable</a></i>(&nbsp;)</b>, see "External Support Requirements" below.<p>This parameter is passed to the external routine.<p><dt>shared memory address<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>.<p>The DEC 21x4x device is a DMA type of device and typically shares access tosome region of memory with the CPU.  This driver is designed for systems thatdirectly share memory between the CPU and the DEC 21x4x.  It assumes that thisshared memory is directly available to it without any arbitration or timingconcerns.<p>This parameter can be used to specify an explicit memory region for use by theDEC 21x4x device.  This should be done on hardware that restricts the DEC21x4x device to a particular memory region.  The constant NONE can be used toindicate that there are no memory limitations, in which case, the driverattempts to allocate the shared memory from the system space.<p><dt>shared memory size<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</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><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</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>shared memory buffer size<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>.<p>The driver and DEC 21x4x device exchange network data in buffers.  Thisparameter permits the size of these individual buffers to be limited.A value of zero indicates that the default buffer size should be used.The default buffer size is large enough to hold a maximum-size Ethernetpacket.<p><dt>pci Memory base<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>. This parametergives the base address of the main memory on the PCI bus. <p><dt>dcOpMode<dd><p>This parameter is passed to the driver by <b><i><a href="./if_dc.html#dcattach">dcattach</a></i>(&nbsp;)</b>. This parametergives the mode of initialization of the device. The mode flags for boththe DEC21040 and DEC21140 interfaces are listed below.  <p><b>DC_PROMISCUOUS_FLAG</b>     0x01 <b>DC_MULTICAST_FLAG</b>       0x02<p>The mode flags specific to the DEC21140 interface are listed below.<p><b>DC_100_MB_FLAG</b>          0x04<b>DC_21140_FLAG</b>           0x08<b>DC_SCRAMBLER_FLAG</b>       0x10<b>DC_PCS_FLAG</b>             0x20<b>DC_PS_FLAG</b>              0x40<p><b>DC_FULLDUPLEX_FLAG</b>      0x10<p>Loopback mode flags<b>DC_ILOOPB_FLAG</b>          0x100 <b>DC_ELOOPB_FLAG</b>          0x200<b>DC_HBE_FLAG</b>             0x400<p><dt>Ethernet address<dd><p>This is obtained by the driver by reading an ethernet ROM register or the DECserial ROM.<p></dl><p></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p><p>This driver requires one external support function:<p><dl><dt>void sysLanIntEnable (int level)<dd><p>This routine provides a target-specific enable of the interrupt for the DEC21x4x device.  Typically, this involves interrupt controller hardware, eitherinternal or external to the CPU.<p>This routine is called once via the macro <b><i>SYS_INT_ENABLE</i>(&nbsp;)</b>. </dl><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_dc.html#top">if_dc</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>,  <i>DECchip 21040 or 21140 Ethernet LAN Controller for PCI. </i><hr><a name="dcattach"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dcattach</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dcattach</i>(&nbsp;)</strong> - publish the <b>dc</b> network interface.</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dcattach    (    int    unit,       /* unit number */    ULONG  devAdrs,    /* device 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) */    ULONG  pciMemBase, /* main memory base as seen from PCI bus */    int    dcOpMode    /* mode of operation */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine publishes the <b>dc</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>unit</i> parameter is used to specify the device unit to initialize.<p>The <i>devAdrs</i> is used to specify the I/O address base of the device.<p>The <i>ivec</i> parameter is used to specify the interrupt vector associatedwith the device interrupt.<p>The <i>ilevel</i> parater is used to specify the level of the interrupt whichthe device would use.<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>The <i>pciMemBase</i> parameter defines the main memory base as seen from PCI bus.<p>The <i>dcOpMode</i> parameter defines the mode in which the device should beoperational.<p></blockquote><h4>BUGS</h4><blockquote><p><p>To zero out DEC 21x4x 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 to writeto memory.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_dc.html#top">if_dc</a></b><hr><a name="dcReadAllRom"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dcReadAllRom</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dcReadAllRom</i>(&nbsp;)</strong> - read entire serial rom</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void dcReadAllRom    (    ULONG   devAdrs, /* device base I/O address */    UCHAR * buffer,  /* destination bufferr */    int     cnt      /* Amount to extract in bytes */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Function to read all of serial rom and store the data in thedata structure passed to the function.  The count value willindicate how much of the serial rom to read.  The routine with alsoswap the the bytes as the come in. <p></blockquote><h4>RETURNS</h4><blockquote><p>N/A.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_dc.html#top">if_dc</a></b><hr><a name="dcViewRom"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dcViewRom</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dcViewRom</i>(&nbsp;)</strong> - display lines of serial ROM for dec21140</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int dcViewRom    (    ULONG devAdrs, /* device base I/O address */    UCHAR lineCnt, /* Serial ROM line Number */    int   cnt      /* Amount to display */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p></blockquote><h4>RETURNS</h4><blockquote><p>Number of bytes displayed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_dc.html#top">if_dc</a></b><hr><a name="dcCsrShow"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dcCsrShow</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dcCsrShow</i>(&nbsp;)</strong> - display dec 21040/21140 status registers 0 thru 15</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int dcCsrShow    (    int unit    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Display the 16 registers of the DEC 21140 device on the console.Each register is printed in hexadecimal format.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./if_dc.html#top">if_dc</a></b></body></html>

⌨️ 快捷键说明

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