亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? wdbtemplatepktdrv.c

?? vxworks的源代碼
?? C
字號(hào):
/* wdbTemplatektDrv.c - template packet driver for lightweight UDP/IP *//*modification history--------------------01b,08jul97,dgp  doc: change WDB_COMM_UDPL_CUSTOM to WDB_COMM_CUSTOM (SPR 7831)01a,23aug95,ms   written.*//*DESCRIPTIONOVERVIEW--------This module is a template 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.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.Throughout this file the word "template" 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 "template"with "ln" throughout this file.PACKET READY CALLBACK---------------------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 wdbTemplateDevInit() 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.MODES-----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.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:   doSomeStuff();   pPktDev->wdbDrvIf.stackRcv (pMbuf);   /@ invoke the callback @/   doMoreStuff();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 doSomeStuff() processing rather than the doMoreStuff() processing.USAGE-----The driver is typically only called only from usrWdb.c. The only directlycallable routine in this module is wdbTemplatePktDevInit().You will need to modify usrWdb.c to allow your driver to be initializedby the debug agent.You will want to modify usrWdb.c to include your driver's headerfile, which should contain a definition of WDB_TEMPLATE_PKT_MTU.There is a default user-selectable macro called WDB_MTU, which mustbe no larger than WDB_TEMPLATE_PKT_MTU. Modify the begining ofusrWdb.c to insure that this is the case by copying the wayit is done for the other drivers.The routine wdbCommIfInit() also needs to be modified so that if yourdriver is selected as the WDB_COMM_TYPE, then your drivers initroutine will be called. Search usrWdb.c for the macro "WDB_COMM_CUSTOM"and mimic that style of initialization for your driver.DATA BUFFERING--------------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.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 wdbMbufChainFree() to free them.The header file wdbMbuflib.h 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 usrWdb.c.*/#include "string.h"#include "errno.h"#include "sioLib.h"#include "intLib.h"#include "wdb/wdbMbufLib.h"#include "drv/wdb/wdbTemplatePktDrv.h"/* pseudo-macros */#define DRIVER_INIT_HARDWARE(pDev) {}#define DRIVER_MODE_SET(pDev, mode)#define DRIVER_PACKET_IS_READY(pDev) FALSE#define DRIVER_RESET_INPUT(pDev) {pDev->inputBusy=FALSE;}#define DRIVER_RESET_OUTPUT(pDev) {pDev->outputBusy=FALSE;}#define DRIVER_GET_INPUT_PACKET(pDev, pBuf) (50)#define DRIVER_DATA_FROM_MBUFS(pDev, pBuf) {}#define DRIVER_POLL_TX(pDev, pBuf) {}#define DRIVER_TX_START(pDev) {}#define DRIVER_DROP_PACKET(pDev) {}/* forward declarations */static STATUS wdbTemplatePoll (void *pDev);static STATUS wdbTemplateTx   (void *pDev, struct mbuf * pMbuf);static STATUS wdbTemplateModeSet (void *pDev, uint_t newMode);static void   wdbTemplateFree (void *pDev);/******************************************************************************** wdbTemplatePktDevInit - initialize a template packet device.*/void wdbTemplatePktDevInit    (    WDB_TEMPLATE_PKT_DEV *pPktDev,	/* template device structure to init */    void	(*stackRcv)()		/* receive packet callback (udpRcv) */    )    {    /* initialize the wdbDrvIf field with driver info */    pPktDev->wdbDrvIf.mode	= WDB_COMM_MODE_POLL | WDB_COMM_MODE_INT;    pPktDev->wdbDrvIf.mtu	= WDB_TEMPLATE_PKT_MTU;    pPktDev->wdbDrvIf.stackRcv	= stackRcv;		/* udpRcv */    pPktDev->wdbDrvIf.devId	= (WDB_TEMPLATE_PKT_DEV *)pPktDev;    pPktDev->wdbDrvIf.pollRtn	= wdbTemplatePoll;    pPktDev->wdbDrvIf.pktTxRtn	= wdbTemplateTx;    pPktDev->wdbDrvIf.modeSetRtn = wdbTemplateModeSet;    /* initialize the device specific fields in the driver structure */    pPktDev->inputBusy		= FALSE;    pPktDev->outputBusy		= FALSE;    /*     * Put your hardware initialization code here. It should initialze     * the device structure's register addresses and initialize     * the hardware.     * You can either connect the driver's ISR handler(s) here (in which     * case you should have the interrupt vector passed to this driver init     * routine), or just require the BSP to connect the driver interrupt     * handler in sysHwInit2() routine.     */    DRIVER_INIT_HARDWARE(pPktDev);    /* put the device in a quiescent state (setting polled mode is one way) */    wdbTemplateModeSet (pPktDev, WDB_COMM_MODE_POLL);    }/******************************************************************************** wdbTemplateInt - template driver interrupt handler** RETURNS: N/A*/void wdbTemplateInt    (    WDB_TEMPLATE_PKT_DEV	* pPktDev    )    {    struct mbuf * pMbuf;    int           packetSize;    /*     * The code below is for handling a packet-recieved interrupt.     * A real driver may also have to check for other interrupting     * conditions such as DMA errors, etc.     */    /* input buffer already in use - drop this packet */    if (pPktDev->inputBusy)	{        DRIVER_DROP_PACKET(pPktDev);	return;	}    /*     * Fill the input buffer with the packet. Use an mbuf cluster to pass     * the packet on to the agent.     */    packetSize = DRIVER_GET_INPUT_PACKET (pPktDev, pPktDev->inBuf);    pMbuf = wdbMbufAlloc();    if (pMbuf == NULL)	{	DRIVER_DROP_PACKET(pPktDev);	return;	}    wdbMbufClusterInit (pMbuf, pPktDev->inBuf, packetSize, \			(int (*)())wdbTemplateFree, (int)pPktDev);    pPktDev->inputBusy = TRUE;    (*pPktDev->wdbDrvIf.stackRcv) (pMbuf);  /* invoke callback */    }/******************************************************************************** wdbTemplateTx - transmit a packet.** The packet is realy a chain of mbufs. We may have to just queue up* this packet is we are already transmitting.** RETURNS: OK or ERROR*/static STATUS wdbTemplateTx    (    void *	pDev,    struct mbuf * pMbuf    )    {    WDB_TEMPLATE_PKT_DEV *pPktDev = pDev;    int 	lockKey;    /* if we are in polled mode, transmit the packet in a loop */    if (pPktDev->mode == WDB_COMM_MODE_POLL)	{	DRIVER_POLL_TX(pPktDev, pMbuf);	return (OK);	}    lockKey = intLock();    /* if the txmitter isn't cranking, queue the packet and start txmitting */    if (pPktDev->outputBusy == FALSE)	{	pPktDev->outputBusy = TRUE;	DRIVER_DATA_FROM_MBUFS(pPktDev, pMbufs);	DRIVER_TX_START(pPktDev);	}    /* else just queue the packet */    else	{	DRIVER_DATA_FROM_MBUFS(pPktDev, pMbufs);	}    intUnlock (lockKey);    wdbMbufChainFree (pMbuf);    return (OK);    }/******************************************************************************** wdbTemplateFree - free the input buffer** This is the callback used to let us know the agent is done with the* input buffer we loaded it.** RETURNS: N/A*/static void wdbTemplateFree    (    void *	pDev    )    {    WDB_TEMPLATE_PKT_DEV *	pPktDev = pDev;    pPktDev->inputBusy = FALSE;    }/******************************************************************************** wdbTemplateModeSet - switch driver modes** RETURNS: OK for a supported mode, else ERROR*/static STATUS wdbTemplateModeSet    (    void *	pDev,    uint_t	newMode    )    {    WDB_TEMPLATE_PKT_DEV * pPktDev = pDev;    DRIVER_RESET_INPUT  (pPktDev);    DRIVER_RESET_OUTPUT (pPktDev);    if (newMode == WDB_COMM_MODE_INT)	DRIVER_MODE_SET (pPktDev, WDB_COMM_MODE_INT);    else if (newMode == WDB_COMM_MODE_POLL)	DRIVER_MODE_SET (pPktDev, WDB_COMM_MODE_POLL);    else	return (ERROR);    return (ERROR);    }/******************************************************************************** wdbTemplatePoll - poll for a packet** This routine polls for a packet. If a packet has arrived it invokes* the agents callback.** RETURNS: OK if a packet has arrived, else ERROR.*/ static STATUS wdbTemplatePoll    (    void *	pDev    )    {    WDB_TEMPLATE_PKT_DEV * pPktDev = pDev;    struct mbuf * pMbuf;    int           packetSize;    if (DRIVER_PACKET_IS_READY(pPktDev))	{	/*	 * Fill the input buffer with the packet. Use an mbuf cluster to pass	 * the packet on to the agent.	 */	packetSize = DRIVER_GET_INPUT_PACKET (pPktDev, pPktDev->inBuf);	pMbuf = wdbMbufAlloc();	if (pMbuf == NULL)	    {	    DRIVER_RESET_INPUT(pPktDev);	    return (ERROR);	    }	wdbMbufClusterInit (pMbuf, pPktDev->inBuf, packetSize, \			(int (*)())wdbTemplateFree, (int)pPktDev);	pPktDev->inputBusy = TRUE;	(*pPktDev->wdbDrvIf.stackRcv) (pMbuf);  /* invoke callback */	return (OK);	}    return (ERROR);    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级片在线| 精品av久久707| 国产在线精品不卡| 亚洲精品中文在线| 26uuu另类欧美| 欧美日韩亚洲综合在线| 成人激情视频网站| 久久av中文字幕片| 亚洲一二三区视频在线观看| 久久久久久久久一| 91精品国产综合久久久久久 | 丁香婷婷综合网| 蜜桃视频一区二区三区在线观看| 亚洲欧美影音先锋| 国产亚洲欧美中文| 欧美一级久久久| 欧美另类久久久品| 色天天综合久久久久综合片| 粉嫩在线一区二区三区视频| 麻豆精品在线看| 日韩精品久久理论片| 亚洲午夜精品17c| 亚洲免费视频中文字幕| 中文字幕不卡在线播放| 久久综合视频网| 国产精品蜜臀av| 精品美女在线播放| 91精品国产综合久久蜜臀| 在线视频国内一区二区| 97久久久精品综合88久久| 国产福利精品一区| 国产精品一区二区果冻传媒| 久久精品国产一区二区三 | 日韩黄色免费电影| 一区二区三区在线视频观看58| 国产性色一区二区| 精品国产乱码久久| 欧美一级片在线观看| 91精品免费观看| 91麻豆精品国产| 日韩欧美国产一区二区在线播放| 欧美一区二区三区在| 欧美一区二区免费视频| 91精品婷婷国产综合久久竹菊| 欧美日韩一级片在线观看| 欧美美女bb生活片| 6080yy午夜一二三区久久| 91精品欧美久久久久久动漫| 在线成人免费视频| 欧美大肚乱孕交hd孕妇| 久久女同性恋中文字幕| 国产精品日韩精品欧美在线| 国产精品视频看| 亚洲情趣在线观看| 亚洲伊人伊色伊影伊综合网| 婷婷久久综合九色综合绿巨人| 香港成人在线视频| 久久不见久久见免费视频7| 国产乱对白刺激视频不卡| 国产不卡在线播放| 99久精品国产| 欧美日韩的一区二区| 欧美成人aa大片| 欧美精彩视频一区二区三区| 1区2区3区精品视频| 亚洲综合一区二区| 麻豆免费看一区二区三区| 大胆欧美人体老妇| 欧美在线综合视频| 精品国精品自拍自在线| 国产精品久久久久久亚洲伦| 一区二区三区在线观看网站| 免费成人美女在线观看.| 国产精品18久久久久久久久久久久 | 欧美激情一区二区| 亚洲综合精品自拍| 久久99精品久久久久久国产越南 | 中文字幕日本乱码精品影院| 亚洲电影激情视频网站| 狠狠色综合日日| 色婷婷国产精品久久包臀| 欧美一区午夜视频在线观看 | 久久午夜老司机| 亚洲精品国产品国语在线app| 日本亚洲三级在线| 国产成人精品免费在线| 欧美网站大全在线观看| 久久一日本道色综合| 亚洲一区国产视频| 国产精品99久久久久久久vr| 欧美性色综合网| 欧美国产一区视频在线观看| 午夜精品久久久久| 99精品黄色片免费大全| 精品国产伦理网| 亚洲午夜激情网站| 成人av在线网站| 日韩午夜在线播放| 亚洲色图在线视频| 国产一区二区精品在线观看| 欧美日韩在线不卡| 亚洲欧洲成人自拍| 国产米奇在线777精品观看| 在线观看日韩精品| 国产精品久久午夜| 91精品国产综合久久精品app| 亚洲激情一二三区| 欧美色综合天天久久综合精品| 成人久久久精品乱码一区二区三区| 国产激情一区二区三区四区| 精品视频免费在线| 亚洲精品乱码久久久久久黑人 | 在线免费观看日本一区| 久久久精品2019中文字幕之3| 久久综合九色综合欧美就去吻| 久久电影网电视剧免费观看| 久久综合九色综合97婷婷女人 | 亚洲与欧洲av电影| 欧美日韩国产精选| 蜜桃视频在线观看一区| 精品国产乱码久久久久久久久 | 色综合咪咪久久| 亚洲亚洲精品在线观看| 91精品国产综合久久久蜜臀粉嫩| 伦理电影国产精品| 久久蜜臀中文字幕| 99久久久久久99| 亚洲一区二区三区四区不卡| 欧美一区二区三区公司| 国产乱理伦片在线观看夜一区| 国产精品午夜在线观看| 色八戒一区二区三区| 亚洲成人自拍偷拍| 日韩欧美中文一区二区| 国产激情91久久精品导航| 亚洲免费资源在线播放| 欧美一区二区三区在| 国产成人啪免费观看软件| 亚洲视频在线一区二区| 欧美老女人在线| 国产成人av电影| 亚洲精品国产一区二区精华液 | 成人午夜av电影| 亚洲一区二区在线播放相泽| 日韩精品一区二区三区在线 | 久久欧美中文字幕| 91蝌蚪porny九色| 奇米亚洲午夜久久精品| 欧美国产禁国产网站cc| 欧美日韩中文另类| 国产精品888| 一级精品视频在线观看宜春院| 日韩欧美一二三区| 91网站在线观看视频| 青青草成人在线观看| 自拍偷拍国产精品| 精品久久一区二区三区| 91成人免费在线视频| 国产一区二区三区在线观看免费| 亚洲免费观看高清在线观看| 欧美不卡在线视频| 欧美综合在线视频| 国产成人99久久亚洲综合精品| 亚洲最快最全在线视频| 国产欧美一区二区三区沐欲 | 亚洲一二三四在线| 久久九九影视网| 在线播放91灌醉迷j高跟美女| 高清成人在线观看| 蜜臀精品一区二区三区在线观看| 欧美激情在线观看视频免费| 欧美一区二区三区四区久久| 91小视频免费看| 国产成人在线视频网站| 天天av天天翘天天综合网| 中文字幕欧美一| 国产情人综合久久777777| 日韩一区二区麻豆国产| 色综合天天综合| 国产成人精品一区二区三区四区 | 日韩一区欧美小说| 久久综合九色综合欧美98| 91麻豆精品国产| 精品视频一区三区九区| 91麻豆成人久久精品二区三区| 国产99久久久久| 国产在线播放一区| 麻豆精品视频在线观看免费| 亚洲va中文字幕| 亚洲女同一区二区| 国产精品毛片无遮挡高清| 精品国产1区2区3区| 欧美一级在线视频| 欧美高清www午色夜在线视频| 日本高清不卡在线观看| 96av麻豆蜜桃一区二区| 成人激情图片网| 粉嫩嫩av羞羞动漫久久久| 国产成人免费视频网站| 国产一区二区三区免费在线观看|