📄 wdbpipepktdrv.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/wdbPipePktDrv.html - generated by refgen from wdbPipePktDrv.c --> <title> wdbPipePktDrv </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>wdbPipePktDrv</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wdbPipePktDrv</strong> - pipe packet driver for lightweight UDP/IP </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./wdbPipePktDrv.html#wdbPipePktDevInit">wdbPipePktDevInit</a></i>( )</b> - initialize a pipe packet device.<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p></blockquote><h4>OVERVIEW</h4><blockquote><p>This module is a pipe for drivers interfacing with the WDB agent'slightweight UDP/IP interpreter. It can be used as a starting pointwhen writing new drivers. Such drivers are the lightweight equivalentof a network interface driver.<p>These drivers, along with the lightweight UDP-IP interpreter, have twobenefits over the stand combination of a netif driver + the full VxWorksnetworking stack; First, they can run in a much smaller amout of targetmemory because the lightweight UDP-IP interpreter is much smaller thanthe VxWorks network stack (about 800 bytes total). Second, they providea communication path which is independant of the OS, and thus can beused to support an external mode (e.g., monitor style) debug agent.<p>Throughout this file the word "pipe" is used in place of a realdriver name. For example, if you were writing a lightweight driverfor the lance ethernet chip, you would want to substitute "pipe"with "ln" throughout this file.<p></blockquote><h4>PACKET READY CALLBACK</h4><blockquote><p>When the driver detects that a packet has arrived (either in its receiverISR or in its poll input routine), it invokes a callback to pass thedata to the debug agent. Right now the callback routine is called "udpRcv",however other callbacks may be added in the future. The driver's <b><i>wdbPipeDevInit</i>( )</b> routine should be passed the callback asa parameter and place it in the device data structure. That way the driverwill continue to work if new callbacks are added later.<p></blockquote><h4>MODES</h4><blockquote><p>Ideally the driver should support both polled and interrupt mode, and becapable of switching modes dynamically. However this is not required.When the agent is not running, the driver will be placed in "interrupt mode"so that the agent can be activated as soon as a packet arrives.If your driver does not support an interrupt mode, you can simulate thismode by spawning a VxWorks task to poll the device at periodic intervalsand simulate a receiver ISR when a packet arrives.<p>For dynamically mode switchable drivers, be aware that the driver may beasked to switch modes in the middle of its input ISR. A driver's input ISRwill look something like this:<p><pre> doSomeStuff(); pPktDev->wdbDrvIf.stackRcv (pMbuf); /* invoke the callback */ doMoreStuff();</pre>If this channel is used as a communication path to an external modedebug agent, then the agent's callback will lock interrupts, switchthe device to polled mode, and use the device in polled mode for awhile.Later on the agent will unlock interrupts, switch the device back tointerrupt mode, and return to the ISR.In particular, the callback can cause two mode switches, first to polled modeand then back to interrupt mode, before it returns.This may require careful ordering of the callback within the interrupthandler. For example, you may need to acknowledge the interrupt withinthe <b><i>doSomeStuff</i>( )</b> processing rather than the <b><i>doMoreStuff</i>( )</b> processing.<p></blockquote><h4>USAGE</h4><blockquote><p>The driver is typically only called only from <b>usrWdb.c</b>. The only directlycallable routine in this module is <b><i><a href="./wdbPipePktDrv.html#wdbPipePktDevInit">wdbPipePktDevInit</a></i>( )</b>.You will need to modify <b>usrWdb.c</b> to allow your driver to be initializedby the debug agent.You will want to modify <b>usrWdb.c</b> to include your driver's headerfile, which should contain a definition of <b>WDB_PIPE_PKT_MTU</b>.There is a default user-selectable macro called <b>WDB_MTU</b>, which mustbe no larger than <b>WDB_PIPE_PKT_MTU</b>. Modify the begining of<b>usrWdb.c</b> to insure that this is the case by copying the wayit is done for the other drivers.The routine <b><i>wdbCommIfInit</i>( )</b> also needs to be modified so that if yourdriver is selected as the <b>WDB_COMM_TYPE</b>, then your drivers initroutine will be called. Search <b>usrWdb.c</b> for the macro "<b>WDB_COMM_CUSTOM</b>"and mimic that style of initialization for your driver.<p></blockquote><h4>DATA BUFFERING</h4><blockquote><p>The drivers only need to handle one input packet at a time becausethe WDB protocol only supports one outstanding host-request at a time.If multiple input packets arrive, the driver can simply drop them.The driver then loans the input buffer to the WDB agent, and the agentinvokes a driver callback when it is done with the buffer.<p>For output, the agent will pass the driver a chain of mbufs, whichthe driver must send as a packet. When it is done with the mbufs,it calls <b><i>wdbMbufChainFree</i>( )</b> to free them.The header file <b>wdbMbuflib.h</b> provides the calls for allocating, freeing,and initializing mbufs for use with the lightweight UDP/IP interpreter.It ultimatly makes calls to the routines wdbMbufAlloc and wdbMbufFree, whichare provided in source code in <b>usrWdb.c</b>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wdbPipePktDrv.html#top">wdbPipePktDrv</a></b><hr><a name="wdbPipePktDevInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>wdbPipePktDevInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>wdbPipePktDevInit</i>( )</strong> - initialize a pipe packet device.</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS wdbPipePktDevInit ( WDB_PIPE_PKT_DEV * pPktDev, /* pipe device structure to init */ void (* stackRcv)() /* receive packet callback (udpRcv) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wdbPipePktDrv.html#top">wdbPipePktDrv</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -