📄 mbcend.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/mbcEnd.html - generated by refgen from mbcEnd.c --> <title> mbcEnd </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>mbcEnd</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>mbcEnd</strong> - Motorola 68302fads END network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./mbcEnd.html#mbcEndLoad">mbcEndLoad</a></i>( )</b> - initialize the driver and device<br><b><i><a href="./mbcEnd.html#mbcParse">mbcParse</a></i>( )</b> - parse the init string<br><b><i><a href="./mbcEnd.html#mbcMemInit">mbcMemInit</a></i>( )</b> - initialize memory for the chip<br><b><i><a href="./mbcEnd.html#mbcAddrFilterSet">mbcAddrFilterSet</a></i>( )</b> - set the address filter for multicast addresses<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This is a driver for the Ethernet controller on the 68EN302 chip. The devicesupports a 16-bit interface, data rates up to 10 Mbps, a dual-ported RAM, andtransparent DMA. The dual-ported RAM is used for a 64-entry CAM table, and a128-entry buffer descriptor table. The CAM table is used to set the Ethernetaddress of the Ethernet device or to program multicast addresses. The bufferdescriptor table is partitioned into fixed-size transmit and receive tables.The DMA operation is transparent and transfers data between the internal FIFOsand external buffers pointed to by the receive and transmit-buffer descriptorsduring transmits and receives.<p>The driver requires that the memory used for transmit and receive buffers beallocated in cache-safe RAM area. <p>Up to 61 multicast addresses are supported. Multicast addresses aresupported by adding the multicast ethernet addresses to the addresstable in the ethernet part. If more than 61 multicast addresses aredesired, address hashing must be used (the address table holds 62entries at most). However, address hashing does not appear to work inthis ethernet part.<p>A glitch in the EN302 Rev 0.1 device causes the Ethernet transmitter tolock up from time to time. The driver uses a watchdog timer to reset theEthernet device when the device runs out of transmit buffers and cannotrecover within 20 clock ticks.<p></blockquote><h4>BOARD LAYOUT</h4><blockquote><p>This device is on-chip. No jumpering diagram is necessary. <p></blockquote><h4>EXTERNAL INTERFACE</h4><blockquote><p>The only external interface is the <b><i><a href="./mbcEnd.html#mbcEndLoad">mbcEndLoad</a></i>( )</b> routine, which expectsthe <i>initString</i> parameter as input. This parameter passes in a colon-delimited string of the format:<p>unit:memAddr:ivec:txBdNum:rxBdNum:dmaParms:bufBase:offset<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>memAddr</i><dd>This parameter is the base address of the Ethernet module. The driveraddresses all other Ethernet device registers as offsets from this address.<p><dt><i>ivec</i><dd>The interrupt vector to be used in connecting the interrupt handler.<p><dt><i>txBdNum</i><dd>The number of transmit buffer descriptors to use.<p><dt><i>rxBdNum</i><dd>The number of receive buffer descriptors to use.<p>The number of transmit and receive buffer descriptors (BDs) used isconfigurable by the user while attaching the driver. Each BD is 8bytes in size and resides in the chip's dual-ported memory, while itsassociated buffer, 1520 bytes in size, resides in cache-safeconventional RAM. A minimum of 2 receive and 2 transmit BDs should beallocated. If this parameter is 0, a default of 32 BDs will be used.The maximum number of BDs depends on how the dual-ported BD RAM ispartitioned. The 128 BDs in the dual-ported BD RAM can partitionedinto transmit and receive BD regions with 8, 16, 32, or 64 transmitBDs and corresponding 120, 112, 96, or 64 receive BDs.<p><dt><i>dmaParms</i><dd>Ethernet DMA parameters.<p>This parameter is used to specify the settings of burst limit, water-mark, andtransmit early, which control the Ethernet DMA, and is used to set the EDMAregister.<p><dt><i>bufBase</i><dd>Base address of the buffer pool.<p>This parameter is used to notify the driver that space for thetransmit and receive buffers need not be allocated, but should betaken from a cache-coherent private memory space provided by the userat the given address. The user should be aware that memory used forbuffers must be 4-byte aligned and non-cacheable. All the buffersmust fit in the given memory space; no checking will be performed.Each buffer is 1520 bytes. If this parameter is "NULL", space forbuffers will be obtained by calling <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>( )</b> in <b><i><a href="./mbcEnd.html#mbcMemInit">mbcMemInit</a></i>( )</b>.<p><dt><i>offset</i><dd>Specifies the memory alignment offset.<p></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>( )</b>,and <b><i><a href="./intArchLib.html#intEnable">intEnable</a></i>( )</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>The driver requires the following system resources:<p> - one watchdog timer<br> - one interrupt vector<br> - 52 bytes in the initialized data section (data)<br> - 0 bytes in the uninitialized data section (bss)<p>The above data and BSS requirements are for the MC68000 architectureand can vary for other architectures. Code size (text) varies greatly between architectures and is therefore not quoted here.<p>If the driver allocates the memory shared with the Ethernet deviceunit, it does so by calling the <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>( )</b> routine. For thedefault case of 32 transmit buffers, 32 receive buffers, the totalsize requested is roughly 100,000 bytes. If a memory region isprovided to the driver, the size of this region is adjustable to suituser needs.<p>This driver can only operate if the shared memory region is non-cacheable,or if the hardware implements bus snooping. The driver cannot maintaincache coherency for the device because the buffers are asynchronouslymodified by both the driver and the device, and these fields may share thesame cache line. Additionally, the chip's dual-ported RAM must bedeclared as non-cacheable memory where applicable.<p></blockquote><h4>INCLUDES</h4><blockquote><p><p><b>end.h</b> <b>endLib.h</b> <b>etherMultiLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mbcEnd.html#top">mbcEnd</a></b>, <b><a href="./muxLib.html#top">muxLib</a></b>, <b><a href="./endLib.html#top">endLib</a></b><i>Writing and Enhanced Network Driver </i><hr><a name="mbcEndLoad"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>mbcEndLoad</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>mbcEndLoad</i>( )</strong> - initialize the driver and device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ* mbcEndLoad ( char * initString /* String to be parsed 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>The string contains the target specific parameters like this:<p>"unit:memAddr:ivec:txBdNum:rxBdNum:dmaParms:bufBase:offset"<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="./mbcEnd.html#top">mbcEnd</a></b><hr><a name="mbcParse"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>mbcParse</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>mbcParse</i>( )</strong> - parse the init string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mbcParse ( MBC_DEVICE * pDrvCtrl, /* device pointer */ char * initString /* information string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Parse the input string. Fill in values in the driver control structure.<p>The initialization string format is:<pre> "unit:memAddr:ivec:txBdNum:rxBdNum:dmaParms:bufBase:offset"</pre><dl><dt><i>unit</i><dd>Device unit number, a small integer.<p><dt><i>memAddr</i><dd>ethernet module base address.<p><dt><i>ivec</i><dd>Interrupt vector number (used with sysIntConnect)<p><dt><i>txBdNum</i><dd>transmit buffer descriptor<p><dt><i>rxBdNum</i><dd>receive buffer descriptor<p><dt><i>dmaParms</i><dd>dma parameters<p><dt><i>bufBase</i><dd>address of memory pool<p><dt><i>offset</i><dd> packet data offset </dl><p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR for invalid arguments.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mbcEnd.html#top">mbcEnd</a></b><hr><a name="mbcMemInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>mbcMemInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>mbcMemInit</i>( )</strong> - initialize memory for the chip</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mbcMemInit ( MBC_DEVICE * pDrvCtrl /* device to be initialized */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Allocates and initializes the memory pools for the mbc device.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mbcEnd.html#top">mbcEnd</a></b><hr><a name="mbcAddrFilterSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>mbcAddrFilterSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>mbcAddrFilterSet</i>( )</strong> - set the address filter for multicast addresses</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void mbcAddrFilterSet ( MBC_DEVICE * pDrvCtrl /* device to be updated */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine goes through all of the multicast addresses on the listof addresses (added with the <b><i>endAddrAdd</i>( )</b> routine) and sets thedevice's filter correctly.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mbcEnd.html#top">mbcEnd</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -