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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usbdlib.c

?? Vxworks5.5的USB驅動程序,包括主機和設備型
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* usbdLib.c - USBD functional interface *//* Copyright 2000-2001 Wind River Systems, Inc. *//*Modification history--------------------01f,18sep01,wef  merge from wrs.tor2_0.usb1_1-f for veloce01e,08aug01,dat  Removing warnings01d,26jan00,rcb  Redefine <bandwidth> parameter to usbdPipeCreate() to		 express the number of bytes per second or bytes per frame		 depending on type of pipe.01c,29nov99,rcb  Increase frame number fields to 32-bits in 		 usbdCurrentFrameGet().01b,07sep99,rcb  Add management callbacks and set-bus-state API.01a,03jun99,rcb  First.*//*DESCRIPTIONImplements the USBD functional interface.  Functions are provided to invokeeach of the underlying USBD URBs (request blocks).In order to use the USBD, it is first necessary to invoke usbdInitialize().Multiple calls to usbdInitialize() may be nested so long as a correspondingnumber of calls to usbdShutdown() are also made.  This allows multiple USBDclients to be written independently and without concern for coordinating theinitialization of the independent clients.After calling usbdInitialize(), a typical system will call usbdHcdAttach()at least one time in order to attach a USB HCD (Host Controller Driver) to the USBD.  The call to usbdHcdAttach() is not typically made by normal USBDclients.  Rather, this call is generally made by a "super client" or bysystem initialization code.  After the USBD has been initialized and at least one HCD has been attached,then normal USBD operation may begin.  Normal USBD clients must registerwith the USBD by calling usbdClientRegister().	In response to this call, theUSBD allocates per-client data structures and a client callback task.Callbacks for each client are invoked from this client-unique task.  Thisimproves the USBD's ability to shield clients from one-another and to helpensure the real-time response for all clients.After a client has registered, it will most often also register for dynamicattachment notification using usbdDynamicAttachRegister().  This functionallows a special client callback routine to be invoked each time a USB deviceis attached or removed from the system.  In this way, clients may discover thereal-time attachment and removal of devices.Finally, clients may use a combination of the USBD configuration and transferfunctions to configure and exchange data with USB devices.*//* includes */#include "usb/usbPlatform.h"#include "string.h"#include "usb/ossLib.h" 	/* OS services */#include "usb/usbQueueLib.h"#include "usb/usbdLib.h"	/* our API */#include "usb/usbdCoreLib.h"	/* interface to USBD core library *//* defines */#define MAX_SYNCH_SEM	    8		/* Max simultaneous requests which */					/* can be synchronized */#define SYNCH_SEM_TIMEOUT   1000	/* Time to wait for synch sem to be */					/* released during shutdown *//* locals */LOCAL int initCount = 0;		/* init nesting count */LOCAL BOOL ossInitialized = FALSE;	/* TRUE if we initialized ossLib */LOCAL BOOL coreLibInitialized = FALSE;	/* TRUE if we initialized usbdCoreLib */LOCAL QUEUE_HANDLE semPoolQueue = NULL; /* pool of synchronizing semaphores *//***************************************************************************** urbInit - Initialize a URB** Initialize the caller's URB to zeros, then store the <clientHandle>,* <function>, <callback>, <userPtr>, and <totalLen> fields passed by the* caller.** RETURNS: N/A*/LOCAL VOID urbInit    (    pURB_HEADER pUrb,			/* Clients URB */    USBD_CLIENT_HANDLE clientHandle,	/* Client handle */    UINT16 function,			/* USBD function code for header */    URB_CALLBACK callback,		/* Completion callback routine */    pVOID userPtr,			/* User-defined pointer */    UINT16 totalLen			/* Total len of URB to be allocated */    )    {    memset (pUrb, 0, totalLen);    pUrb->handle = clientHandle;    pUrb->function = function;    pUrb->callback = callback;    pUrb->userPtr = userPtr;    pUrb->urbLength = totalLen;    }/***************************************************************************** urbCallback - Internal callback used for asynchronous USBD functions** This callback will be used by urbExecBlock() as the URB_HEADER.callback* routine when urbExecBlock() executes an asynchronous USBD function.* By convention, the URB_HEADER.userPtr field will contain the SEM_HANDLE* of a semaphore which should be signalled.** RETURNS: N/A*/LOCAL VOID urbCallback    (    pVOID pUrb				/* Completed URB */    )    {    OSS_SEM_GIVE ((SEM_HANDLE) ((pURB_HEADER) pUrb)->userPtr);    }/***************************************************************************** urbExecBlock - Block on the execution of the caller's URB** Execute the <pUrb> passed by the caller and block until execution* completes. ** RETURNS: OK, or ERROR if error detected while trying to execute URB*/LOCAL STATUS urbExecBlock    (    pURB_HEADER pUrb			/* Caller's URB */    )    {    USB_MESSAGE msg;        /* Have we been initialized? */    if (initCount == 0)	return ossStatus (S_usbdLib_NOT_INITIALIZED);    /* Get a semaphore from the pool of synchronization semaphores to be     * used for this URB.     */    if (usbQueueGet (semPoolQueue, &msg, OSS_BLOCK) != OK)	return ossStatus (S_usbdLib_OUT_OF_RESOURCES);    /* msg.lParam is an available SEM_HANDLE. */    pUrb->callback = urbCallback;    pUrb->userPtr = (pVOID) msg.lParam;    if (usbdCoreEntry (pUrb) == OK)	{	/* wait for the URB to complete */	OSS_SEM_TAKE ((SEM_HANDLE) msg.lParam, OSS_BLOCK);	}    else	{	/* If the USBD reported an error, we don't know if the URB	 * callback was invoked or not (depends on how bad an error	 * the USBD detected, e.g., malformed URB).  So, we need to	 * make sure the semaphore is returned to the cleared state	 * before we put it back on the queue.	 */	OSS_SEM_TAKE ((SEM_HANDLE) msg.lParam, OSS_DONT_BLOCK);	}    usbQueuePut (semPoolQueue, 0, 0, msg.lParam, OSS_BLOCK);    return (pUrb->result == OK) ? OK : ERROR;    }/***************************************************************************** usbdInitialize - Initialize the USBD** usbdInitialize() must be called at least once prior to calling other* USBD functions.  usbdInitialize() prepares the USBD to process URBs.* Calls to usbdInitialize() may be nested, allowing multiple USBD clients* to be written independently.** RETURNS: OK, or ERROR if initialization failed.** ERRNO:*  S_usbdLib_GENERAL_FAULT*  S_usbdLib_OUT_OF_RESOURCES*  S_usbdLib_INTERNAL_FAULT*/STATUS usbdInitialize (void)    {    URB_CLIENT_UNREG urb;    SEM_HANDLE semHandle;    STATUS s = OK;    int i;    /* If not already initialized... */    if (++initCount == 1)	{	/* Initialize osServices */	if (ossInitialize () != OK)	    {	    s = ossStatus (S_usbdLib_GENERAL_FAULT);	    }	else	    {	    ossInitialized = TRUE;	    /* Create a pool of semaphores which will be used to synchronize 	     * URB completion. */	    if (usbQueueCreate (MAX_SYNCH_SEM, &semPoolQueue) != OK)		{		s = ossStatus (S_usbdLib_OUT_OF_RESOURCES);		}	    else		{		for (i = 0; s == OK && i < MAX_SYNCH_SEM; i++)		    {		    if (OSS_SEM_CREATE (1, 0, &semHandle) != OK ||			usbQueuePut (semPoolQueue, 0, 0, (UINT32) semHandle,			    OSS_DONT_BLOCK) != OK)			{			s = ossStatus (S_usbdLib_INTERNAL_FAULT);			}		    }		/* Initialize USBD core library */		if (s == OK)		    {		    urbInit (&urb.header, NULL, USBD_FNC_INITIALIZE, NULL, NULL,			sizeof (urb));		    if ((s = urbExecBlock (&urb.header)) == OK)			{			coreLibInitialized = TRUE;			}		    }		}	    }	}    if (s != OK)	usbdShutdown ();    return s;    }/***************************************************************************** usbdShutdown - Shuts down the USBD** usbdShutdown() should be called once for every successful call to * usbdInitialize().  This function frees memory and other resources used* by the USBD.** RETURNS: OK, or ERROR if shutdown failed.** ERRNO:*  S_usbdLib_NOT_INITIALIZED*/STATUS usbdShutdown (void)    {    URB_CLIENT_UNREG urb;    USB_MESSAGE msg;    STATUS s = OK;    int i;    if (initCount == 0)	{	/* Not initialized */	s = ossStatus (S_usbdLib_NOT_INITIALIZED);	}    else	{	/* We've been initialized at least once. */	if (initCount == 1)	    {	    if (coreLibInitialized)		{		/* Execute Shutdown URB */		urbInit (&urb.header, NULL, USBD_FNC_SHUTDOWN, NULL, NULL,		    sizeof (urb));		urbExecBlock (&urb.header);		coreLibInitialized = FALSE;		}	    if (semPoolQueue != NULL)		{		for (i = 0; i < MAX_SYNCH_SEM &&		    usbQueueGet (semPoolQueue, &msg, SYNCH_SEM_TIMEOUT) == OK; 		    i++)		    {		    OSS_SEM_DESTROY ((SEM_HANDLE) msg.lParam); 		    }		usbQueueDestroy (semPoolQueue);		semPoolQueue = NULL;		}	    if (ossInitialized)		{		/* Shut down osServices library */		ossShutdown ();		ossInitialized = FALSE;		}	    }	--initCount;	}    return s;    }/***************************************************************************** usbdClientRegister - Registers a new client with the USBD** This routine invokes the USBD function to register a new client.  * <pClientName> should point to a string of not more than USBD_NAME_LEN * characters (excluding terminating NULL) which can be used to uniquely * identify the client.	If successful, upon return the <pClientHandle>* will be filled with a newly assigned USBD_CLIENT_HANDLE.** RETURNS: OK, or ERROR if unable to register new client.*/STATUS usbdClientRegister     (    pCHAR pClientName,			/* Client name */    pUSBD_CLIENT_HANDLE pClientHandle	/* Client hdl returned by USBD */    )    {    URB_CLIENT_REG urb;    STATUS s;        /* Initialize URB */    urbInit (&urb.header, 0, USBD_FNC_CLIENT_REG, NULL, NULL, sizeof (urb));        if (pClientName != NULL)	strncpy (urb.clientName, pClientName, USBD_NAME_LEN);    /* Execute URB */    s = urbExecBlock (&urb.header);    /* Return result */    if (pClientHandle != NULL)	*pClientHandle = urb.header.handle;    return s;    }/***************************************************************************** usbdClientUnregister - Unregisters a USBD client** A client invokes this function to release a previously assigned * USBD_CLIENT_HANDLE.  The USBD will release all resources allocated to * the client, aborting any outstanding URBs which may exist for the client.  ** Once this function has been called with a given clientHandle, the client* must not attempt to reuse the indicated <clientHandle>.** RETURNS: OK, or ERROR if unable to unregister client.*/STATUS usbdClientUnregister    (    USBD_CLIENT_HANDLE clientHandle	/* Client handle */    )    {    URB_CLIENT_UNREG urb;    /* Initialize URB */    urbInit (&urb.header, clientHandle, USBD_FNC_CLIENT_UNREG, NULL, NULL,	sizeof (urb));    /* Execute URB */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
看电影不卡的网站| 欧美色图12p| 在线亚洲人成电影网站色www| 欧美日韩一区中文字幕| 国产欧美日本一区视频| 亚洲激情成人在线| 粉嫩av一区二区三区在线播放 | 国产一区二区福利视频| 色综合久久66| 久久精品视频网| 蜜桃久久久久久| 欧美挠脚心视频网站| 中文字幕一区免费在线观看| 激情国产一区二区| 欧美精品久久久久久久多人混战| 国产精品久久久久久久久免费丝袜| 日韩av在线发布| 欧美性大战xxxxx久久久| 中文字幕中文字幕中文字幕亚洲无线 | 亚洲卡通动漫在线| 成人一区在线观看| 久久久五月婷婷| 黄色日韩三级电影| 日韩写真欧美这视频| 亚洲高清中文字幕| 色婷婷亚洲一区二区三区| 国产精品久久久久婷婷| 国产高清久久久| 久久午夜免费电影| 国模冰冰炮一区二区| 欧美大片日本大片免费观看| 天堂va蜜桃一区二区三区| 欧洲另类一二三四区| 亚洲日本成人在线观看| 99久久精品免费看| 成人免费小视频| 91理论电影在线观看| 国产精品久久久久久久蜜臀| 成人app软件下载大全免费| 亚洲国产精品成人综合色在线婷婷| 国产乱妇无码大片在线观看| 久久久九九九九| 成人一级视频在线观看| 国产精品白丝在线| 91精品办公室少妇高潮对白| 亚洲一二三专区| 欧美久久久久中文字幕| 青娱乐精品在线视频| 精品久久久久久久人人人人传媒| 国产自产视频一区二区三区| 国产日韩一级二级三级| 不卡视频一二三四| 亚洲自拍偷拍欧美| 欧美精品自拍偷拍| 精品综合久久久久久8888| 久久精品亚洲一区二区三区浴池 | 国产日韩亚洲欧美综合| 99国产精品久久久久| 一区二区三区免费在线观看| 69堂国产成人免费视频| 国模大尺度一区二区三区| 中文字幕日本乱码精品影院| 欧美日韩一区二区三区在线| 裸体在线国模精品偷拍| 国产精品丝袜久久久久久app| 一本一道久久a久久精品综合蜜臀| 一区二区三区精品视频在线| 欧美一区二区视频网站| 丰满放荡岳乱妇91ww| 亚洲一区欧美一区| 精品国产人成亚洲区| 91一区二区在线观看| 日韩精品乱码免费| 国产精品美女久久久久久2018| 欧美色图免费看| 国产传媒欧美日韩成人| 午夜在线电影亚洲一区| 2021久久国产精品不只是精品| 一本到不卡免费一区二区| 日本不卡视频在线| 亚洲精选在线视频| 欧美精品一区二区三区久久久| 色综合久久中文综合久久97| 激情都市一区二区| 亚洲成人资源在线| 国产欧美精品一区二区色综合| 欧美久久久久久久久久| 波多野结衣在线aⅴ中文字幕不卡| 日本不卡一区二区三区高清视频| 自拍偷自拍亚洲精品播放| 日韩精品在线网站| 欧美精品1区2区3区| www.视频一区| 国产成人av一区二区| 日韩va亚洲va欧美va久久| 一区二区三区在线免费| 国产欧美一区二区精品仙草咪| 欧美日韩五月天| 色综合色综合色综合色综合色综合| 国产在线麻豆精品观看| 视频一区二区三区入口| 亚洲综合免费观看高清在线观看| 欧美激情一区不卡| 久久久99久久| 精品国产乱码久久久久久久| 51午夜精品国产| 在线观看国产91| 色综合天天综合网天天看片| 北条麻妃国产九九精品视频| 福利一区二区在线| 丁香五精品蜜臀久久久久99网站 | 亚洲精品高清在线| 国产欧美一区二区精品性| 2020国产精品自拍| 亚洲精品一区二区三区影院| 制服视频三区第一页精品| 欧美三级三级三级爽爽爽| 在线亚洲一区二区| 欧美最猛性xxxxx直播| 欧美中文字幕一二三区视频| 色婷婷久久99综合精品jk白丝| 色综合一个色综合亚洲| 色狠狠色狠狠综合| 欧美亚洲国产bt| 欧美日本一道本| 777精品伊人久久久久大香线蕉| 91麻豆精品91久久久久久清纯 | 午夜精品一区在线观看| 天堂一区二区在线| 日本一道高清亚洲日美韩| 免费看日韩a级影片| 久久99精品久久久久久国产越南 | 蜜臀久久99精品久久久久宅男| 免费观看在线色综合| 黄色日韩网站视频| 成人精品gif动图一区| 91日韩精品一区| 9191成人精品久久| 日韩视频在线你懂得| 久久精品日产第一区二区三区高清版| 欧美经典一区二区| 一区二区三区在线视频观看| 日本不卡一二三| 国产jizzjizz一区二区| 日本久久电影网| 日韩免费电影一区| 国产精品成人在线观看| 日日摸夜夜添夜夜添亚洲女人| 麻豆精品一区二区三区| av成人免费在线观看| 欧美一区中文字幕| 日本一区二区视频在线观看| 亚洲精品国产一区二区三区四区在线| 日韩和欧美一区二区三区| 精品亚洲国产成人av制服丝袜| youjizz久久| 欧美精品vⅰdeose4hd| 日本一区二区动态图| 亚洲成a天堂v人片| 成人黄色片在线观看| 欧美丰满嫩嫩电影| 国产精品久久久一区麻豆最新章节| 亚洲成va人在线观看| 不卡电影一区二区三区| 欧美一区二区黄| 亚洲欧美日韩一区二区| 国产一区二区在线观看视频| 色综合网站在线| 国产欧美精品一区| 性感美女极品91精品| 99这里只有久久精品视频| 精品国产乱码久久久久久久| 亚洲国产精品久久艾草纯爱| 国产 欧美在线| 日韩欧美国产麻豆| 亚洲大片在线观看| av中文一区二区三区| 2020国产精品久久精品美国| 天堂在线一区二区| 欧美性三三影院| 亚洲男人的天堂一区二区| 粉嫩aⅴ一区二区三区四区五区| 欧美一区二区日韩| 亚洲成人黄色影院| 色狠狠桃花综合| 亚洲精选免费视频| 91色乱码一区二区三区| 国产精品久久久久久妇女6080| 久久9热精品视频| 91精品国产丝袜白色高跟鞋| 午夜久久久久久久久久一区二区| 在线影视一区二区三区| 国产精品超碰97尤物18| 成人黄色软件下载| 国产精品丝袜久久久久久app| 国产91在线看| 国产精品乱人伦中文| 成人精品在线视频观看| 国产精品看片你懂得| 成人aaaa免费全部观看|