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

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

?? usbcbiufidevlib.c

?? This the compressed USB driver source code for vxworks5.6. It has device controller driver and other
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* usbCbiUfiDevLib.c - USB CBI Mass Storage class driver for UFI sub-class *//* Copyright 2000-2002 Wind River Systems, Inc. *//*modification history--------------------01r,26oct04,ami  Debug Message Changes01q,21oct04,pdg  IRP timeout handling01p,15oct04,ami  Apigen Changes01o,07oct04,ami  SPR #91732 Fix01n,07oct04,mta  SPR 94016:If device unplugged during a transfer, a corruption                 (pagefault) may appear01m,07oct04,mta  Merge from Integration branch01l,06oct04,mta  SPR 97415:when addressing an endpoint, we omit the direction                 bit01k,06oct04,ami  SPR #94684 Fix01j,26feb04,cfc  Merge fixes for SPR 93986 and 94016 from adh01i,19sep03,cfc  Fix for creating USB Interrupt Pipe w/USB2 Host Stack01h,30apr02,wef  fix little endian swap problem in usbCbiUfiPhysDevCreate01g,05mar02,wef  fix bug - sizeof a macro01f,19nov01,dee  fix continuation line syntax error01e,06nov01,wef  Remove automatic buffer creations and repalce with OSS_xALLOC                 remove more warnings, fix condition where no disk is in drive 		 - SPR #69753.01d,08aug01,dat  Removing warnings01c,02sep00,bri  added support for multiple devices.01b,04aug00,bri  updated as per review.01a,26jun00,bri	 written.*//*DESCRIPTIONThis module implements the USB Mass Storage class driver for the vxWorks operating system.  This module presents an interface which is a superset of the vxWorks Block Device driver model.  The driver implements external APIs which would be expected of a standard block device driver. This class driver restricts to Mass Storage class devices with UFI subclass,that follow CBI (Control/Bulk/Interrupt) transport.  For CBI devices transport of command, data and status occurs via control, bulk and interrupt endpoints respectively. Interrupt endpoint is used to signal command completion.The class driver is a client of the Universal Serial Bus Driver (USBD).  Allinteraction with the USB buses and devices is handled through the USBD.INITIALISATIONThe driver initialisation routine usbCbiUfiDevInit() must be invoked first prior to any other driver routines.  It is assumed that USBD is already initialised and attached to atleast one USB Host Controller.  usbCbiUfiDevInit() registers the class driver as a client module with USBD.  It also registers a callback routine to get notified whenever a USB MSC/UFI/CBI device is attached or removed from the system.  The callback routinecreates a USB_CBI_UFI_DEV structure to represent the USB device attached.  Italso sets device configuration, interface settings and creates pipes for BULK_IN, BULK_OUT and INTERRUPT transfers.DATA FLOWFor every USB/CBI/UFI device detected, the device configuration is set to theconfiguration that follows the CBI/UFI command set.  Pipes are created for bulkin, bulk out and interrupt endpoints.  To initiate transactions, ADSC class specific request is used to send a command block on the control endpoint.  Command blocks are formed as per the UFI command specifications.  If the command requires transport of data to/from the device, it is done via bulk-out/bulk-in pipes using IRPs.  This is followed by status transport via interrupt endpoint.OTHER FUNCTIONSNumber of USB CBI_UFI devices supported by this driver is not fixed.  UFI devices may be added or removed from the USB system at any point of time.  The user of this client driver must be aware of the device attachment and removal.To facilitate this, an user-specific callback routine may be registered, usingusbCbiUfiDynamicAttachRegister() routine. The USBD_NODE_ID assigned to the device being attached or removed, is passed on to the user callback routine. This unique ID may be used to create a block device using usbCbiUfiBlkDevCreate() and further launch file system.NOTE : The user callback routine is invoked from the USBD client task created for this class driver. The callback routine should not invoke any class driverfunction, which will further submit IRPs. For example,  usbCbiUfiBlkDevCreate() should not be invoked from the user's callback. Typically, the user may create a task, as a client of UFI driver, and invokethe driver routines from the task's context.  The user callback routine maybe used to notify device attachment and removal to the task. INCLUDE FILES: usbCbiUfiDevLib.h, blkIo.hSEE ALSO:  '<USB Mass Storage Class - Control/Bulk/Interrupt Transport Specification Revision 1.0>'  '<USB Mass Storage Class - UFI Command specification Revision 1.0>'*//* includes */#include "vxWorks.h"#include "string.h"#include "errno.h"#include "errnoLib.h"#include "ioLib.h"#include "blkIo.h"#include "stdio.h"#include "logLib.h"#include "taskLib.h"#include "drv/timer/timerDev.h"#include "usb/usbPlatform.h"#include "usb/ossLib.h"             /* operations system srvcs */#include "usb/usb.h"                /* general USB definitions */#include "usb/usbListLib.h"         /* linked list functions   */#include "usb/usbdLib.h"            /* USBD interface          */#include "usb/usbLib.h"             /* USB utility functions   */#include "drv/usb/usbCbiUfiDevLib.h"/* defines */#define USB_DEBUG_MSG        0x01#define USB_DEBUG_ERR        0x02extern void usbLogMsg (char *,int,int,int,int,int,int);#define USB_CBI_UFI_DEBUG                  \        if (usbCbiUfiDebug & USB_DEBUG_MSG)   \            usbLogMsg#define USB_CBI_UFI_ERR                    \        if (usbCbiUfiDebug & USB_DEBUG_ERR)   \            usbLogMsg#define CBI_TEST_READY_NOCHANGE  0   /* no media change detected           */#define CBI_TEST_READY_CHANGED   1   /* media change detected              */#define CBI_TEST_READY_FAILED    2   /* failed to checked ready status     */#define CBI_TEST_READY_MXRETRIES 200 /* Retry count for testing unit ready *//* typedefs */typedef struct usbCbiUfiDev    {    BLK_DEV           blkDev;         /* Vxworks block device structure */                                      /* Must be the first one          */    USBD_NODE_ID      cbiUfiDevId;    /* USBD node ID of the device     */	     UINT16            configuration;  /* Configuration value            */        UINT16            interface;      /* Interface number               */    UINT16            altSetting;     /* Alternate setting of interface */     UINT16            outEpAddress;   /* Bulk out EP address            */       UINT16            inEpAddress;    /* Bulk in EP address             */    UINT16            intrEpAddress;  /* Interrupt EP address           */    USBD_PIPE_HANDLE  outPipeHandle;  /* Pipe handle for Bulk out EP    */    USBD_PIPE_HANDLE  inPipeHandle;   /* Pipe handle for Bulk in EP     */    USBD_PIPE_HANDLE  intrPipeHandle; /* Pipe handle for interrupt EP   */    USB_IRP           inIrp;          /* IRP used for bulk-in data      */    USB_IRP           outIrp;         /* IRP used for bulk-out data     */    USB_IRP           statusIrp;      /* IRP used for status data       */       USB_UFI_CMD_BLOCK ufiCmdBlk;      /* Store for UFI Command block    */    UINT8 *           bulkInData;     /* Pointer for bulk-in data       */    UINT8 *           bulkOutData;    /* Pointer for bulk-out data      */       UINT8             intrStatus[2];  /* Store for Status bytes         */    UINT16            lockCount;      /* Count of times structure locked*/    UINT16            inEpAddressMaxPkt;  /* Max In Pipe Packet size       */    UINT16            outEpAddressMaxPkt; /* Max Out Pipe Packet size      */    BOOL              connected;      /* TRUE if CBI_UFI device connected  */        SEM_HANDLE        cbiUfiIrpSem;   /* Semaphore for IRP Synchronisation */    LINK              cbiUfiDevLink;  /* Link to other USB_CBI_UFI devices */      } USB_CBI_UFI_DEV, *pUSB_CBI_UFI_DEV;/* Attach request for user callback */typedef struct attach_request    {    LINK reqLink;                       /* linked list of requests */    USB_UFI_ATTACH_CALLBACK callback;   /* client callback routine */    pVOID callbackArg;                  /* client callback argument*/    } ATTACH_REQUEST, *pATTACH_REQUEST;/* globals */BOOL usbCbiUfiDebug = 0;/* locals */LOCAL UINT16 initCount = 0;           /* Count for UFI device initialisation */LOCAL USBD_CLIENT_HANDLE usbdHandle;  /* Handle for this class driver */LOCAL LIST_HEAD    cbiUfiDevList;     /* Linked list of USB_CBI_UFI_DEV */LOCAL LIST_HEAD    reqList;           /* Attach callback request list */LOCAL MUTEX_HANDLE cbiUfiDevMutex;    /* Mutex used to protect internal structs *//* forward declarations */LOCAL  STATUS usbCbiUfiDescShow (USBD_NODE_ID nodeId);LOCAL  STATUS usbCbiUfiConfigDescShow  (USBD_NODE_ID nodeId, UINT8 index);LOCAL  pUSB_CBI_UFI_DEV usbCbiUfiPhysDevCreate (USBD_NODE_ID nodeId,                                                 UINT16 config, 						UINT16 interface);LOCAL  pUSB_CBI_UFI_DEV usbCbiUfiDevFind (USBD_NODE_ID nodeId);LOCAL  STATUS usbCbiUfiDevBlkRd (BLK_DEV *blkDev,				 UINT32 offset, 				 UINT32 num, 				 char * buf);LOCAL  STATUS usbCbiUfiDevBlkWrt (BLK_DEV *blkDev, 				  UINT32 offset, 				  UINT32 num, 				  char * buf);LOCAL  STATUS usbCbiUfiDevStChk (BLK_DEV *blkDev);LOCAL  STATUS usbCbiUfiDevReset (BLK_DEV *blkDev);LOCAL  VOID   usbCbiUfiIrpCallback (pVOID p);LOCAL  STATUS usbCbiUfiFormCmd (pUSB_CBI_UFI_DEV pCbiUfiDev, 				UINT ufiCmd, 				UINT cmdParam1, 				UINT cmdParam2);LOCAL  USB_COMMAND_STATUS usbCbiUfiCmdExecute (pUSB_CBI_UFI_DEV pCbiUfiDev);LOCAL  VOID usbCbiUfiDevDestroy (pUSB_CBI_UFI_DEV pCbiUfiDev); LOCAL  VOID notifyAttach (USBD_NODE_ID nodeId, UINT16 attachCode);LOCAL STATUS usbCbiUfiDevUnitReady ( BLK_DEV *);LOCAL UINT8 usbCbiUfiDevTestReady ( BLK_DEV *); /***************************************************************************** usbCbiUfiAttachCallback - called by USBD when UFI device is attached/detached** This function is invoked by the USBD driver when a mass storage device, * following CBI protocol and UFI command set, is attached or removed.  * * <nodeId> is the USBD_NODE_ID of the node being attached or removed.	* <attachAction> is USBD_DYNA_ATTACH or USBD_DYNA_REMOVE.* <configuration> and <interface> indicate the configuration/interface* that reports itself as a MSC/CBI/UFI device.  * <deviceClass>, <deviceSubClass>, and <deviceProtocol> will identify a * MSC/CBI/UFI device.** NOTE: The USBD will invoke this function once for each configuration/* interface which reports itself as a MSC/CBI/UFI.  So, it is possible * that a single device insertion/removal may trigger multiple callbacks. *** RETURNS: N/A** ERRNO: none**\NOMANUAL*/LOCAL VOID usbCbiUfiAttachCallback    (    USBD_NODE_ID nodeId,        /* USBD Node ID of the device attached       */    UINT16 attachAction,        /* Whether device attached / detached        */    UINT16 configuration,       /* Configur'n value for  MSC/CBI/UFI         */    UINT16 interface,           /* Interface number for  MSC/CBI/UFI         */    UINT16 deviceClass,         /* Interface class   - 0x8  for MSC          */    UINT16 deviceSubClass,      /* Device sub-class  - 0x4  for UFI command  */        UINT16 deviceProtocol       /* Interfaceprotocol - 0x00 for CBI          */    )    {    pUSB_CBI_UFI_DEV  pCbiUfiDev;      OSS_MUTEX_TAKE (cbiUfiDevMutex, OSS_BLOCK);     switch (attachAction)        {         case USBD_DYNA_ATTACH:             /* MSC/CBI/UFI Device attached */            USB_CBI_UFI_DEBUG ("usbCbiUfiAttachCallback : New MSC/CBI/UFI device "\                               "attached\n", 0, 0, 0, 0, 0, 0);            /* Check out whether we already have a structure for this device */            USB_CBI_UFI_DEBUG ("usbCbiUfiAttachCallback: Configuration = %d, " \                               "Interface = %d, Node Id = %d \n", configuration,                               interface, (UINT)nodeId, 0, 0, 0);             if (usbCbiUfiDevFind (nodeId) != NULL)                break;            /* create a USB_CBI_UFI_DEV structure for the device detected */                     if ((pCbiUfiDev = usbCbiUfiPhysDevCreate (nodeId,  configuration,  interface)) ==NULL )                {                USB_CBI_UFI_ERR ("usbCbiUfiAttachCallback : Error creating " \                                 "MSC/CBI/UFI device\n", 0, 0, 0, 0, 0, 0);                break;                }                          /* Notify registered callers that a CBI_UFI_DEV has been added */	    notifyAttach (pCbiUfiDev->cbiUfiDevId, USB_UFI_ATTACH);             break;        case USBD_DYNA_REMOVE:            /* MSC/CBI/UFI Device detached */            USB_CBI_UFI_DEBUG ("usbCbiUfiAttachCallback : MSC/CBI/UFI Mass storage "\                               "device detached\n", 0, 0, 0, 0, 0, 0);            if ((pCbiUfiDev = usbCbiUfiDevFind (nodeId)) == NULL)                break;            /* Check the connected flag  */            if (pCbiUfiDev->connected == FALSE)                break;                        pCbiUfiDev->connected = FALSE;	    /* Notify registered callers that the CBI_UFI device has been	     * removed 	     *	     * NOTE: We temporarily increment the device's lock count	     * to prevent usbCbiUfiDevUnlock() from destroying the	     * structure while we're still using it.	     */            pCbiUfiDev->lockCount++;             notifyAttach (pCbiUfiDev->cbiUfiDevId, USB_UFI_REMOVE);             pCbiUfiDev->lockCount--;                         if (pCbiUfiDev->lockCount == 0)                 usbCbiUfiDevDestroy (pCbiUfiDev);             USB_CBI_UFI_DEBUG ("usbCbiUfiDevAttachCallback : CbiUfi Mass \			     storage device detached\n", 0, 0, 0, 0, 0, 0);                            break;        default :            break;         }    OSS_MUTEX_RELEASE (cbiUfiDevMutex);      }/***************************************************************************** usbCbiUfiDevShutDown - shuts down the USB CBI mass storage class driver* * This routine unregisters UFI driver from USBD and releases any resources * allocated for the devices.** RETURNS: OK or ERROR.** ERRNO:* \is* \i S_usbCbiUfiDevLib_NOT_INITIALIZED* CBI Device is not initialized * \ie */STATUS usbCbiUfiDevShutDown     (    int errCode                  /* Error code - reason for shutdown */    )    {    pUSB_CBI_UFI_DEV pCbiUfiDev;    pATTACH_REQUEST  pRequest;    if (initCount == 0)        return ossStatus (S_usbCbiUfiDevLib_NOT_INITIALIZED);    /* release any UFI devices */    while ((pCbiUfiDev = usbListFirst (&cbiUfiDevList)) != NULL)        usbCbiUfiDevDestroy (pCbiUfiDev);     /* Dispose of any outstanding notification requests */    while ((pRequest = usbListFirst (&reqList)) != NULL)        {      	usbListUnlink (&pRequest->reqLink);        OSS_FREE (pRequest);         }    /*      * Unregister with the USBD. USBD will automatically release any pending     * IRPs or attach requests.     */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美精品区一区二区三区 | 久久综合久久久久88| 国产欧美精品一区二区色综合| 亚洲一区二区三区四区在线观看 | 国产成人在线免费观看| 色噜噜狠狠色综合中国| 久久亚洲精品国产精品紫薇 | 中文字幕一区二区三区蜜月 | 午夜精品福利一区二区三区av| 国产精品一区二区x88av| 欧美人与性动xxxx| 亚洲宅男天堂在线观看无病毒| 国产91精品一区二区| 精品人在线二区三区| 丝袜脚交一区二区| 在线观看国产91| 亚洲欧美日韩综合aⅴ视频| 国产一区二区毛片| 日韩免费高清视频| 丝袜美腿一区二区三区| 欧美曰成人黄网| 亚洲特黄一级片| gogogo免费视频观看亚洲一| 久久精品视频网| 国产在线国偷精品产拍免费yy| 制服丝袜一区二区三区| 亚洲18影院在线观看| 欧美系列亚洲系列| 亚洲第一会所有码转帖| 欧美日韩在线播放三区四区| 一卡二卡三卡日韩欧美| 在线欧美小视频| 亚洲午夜久久久久久久久电影院 | 国产在线视频一区二区三区| 日韩欧美一区二区三区在线| 日韩av中文在线观看| 91精品国产乱码久久蜜臀| 日韩精品亚洲一区| 欧美一区二区三区在线观看| 老司机精品视频一区二区三区| 欧美不卡一区二区| 国产jizzjizz一区二区| 亚洲国产精品国自产拍av| 99国内精品久久| 亚洲一区二区三区视频在线| 538prom精品视频线放| 久久精品国产精品亚洲精品| 久久只精品国产| 成人a免费在线看| 亚洲综合图片区| 91精品国产麻豆| 国产成人aaa| 一区二区三区蜜桃网| 91麻豆精品国产自产在线| 九色|91porny| 国产精品女同一区二区三区| 色哦色哦哦色天天综合| 蜜臀av性久久久久蜜臀aⅴ| 久久综合九色综合97_久久久| 国产传媒欧美日韩成人| 亚洲自拍偷拍av| 精品国产精品网麻豆系列| 99麻豆久久久国产精品免费| 亚洲小说欧美激情另类| 久久综合九色综合欧美98| 91丨九色丨蝌蚪丨老版| 秋霞午夜av一区二区三区| 亚洲国产岛国毛片在线| 欧美视频在线一区| 国内精品国产成人国产三级粉色 | 亚洲www啪成人一区二区麻豆| 精品国产一区二区三区不卡 | 成人欧美一区二区三区| 欧美精品久久久久久久多人混战| 国产在线精品一区二区夜色| 亚洲最色的网站| 久久精品视频网| 6080亚洲精品一区二区| 99re这里都是精品| 国产一区二区导航在线播放| 亚洲狠狠爱一区二区三区| 欧美高清在线视频| 欧美成人性战久久| 色女孩综合影院| 成人精品视频一区二区三区尤物| 图片区小说区国产精品视频| 亚洲人午夜精品天堂一二香蕉| 精品人伦一区二区色婷婷| 欧美精品久久久久久久多人混战 | 51精品国自产在线| 色综合一区二区三区| 国产在线精品不卡| 免费久久精品视频| 亚洲动漫第一页| 亚洲精品综合在线| 中文子幕无线码一区tr| 日韩区在线观看| 欧美日韩在线免费视频| 色婷婷精品久久二区二区蜜臂av| 国产成人鲁色资源国产91色综| 日本不卡123| 天天亚洲美女在线视频| 亚洲一区国产视频| 亚洲精品菠萝久久久久久久| 亚洲天堂2016| 亚洲色图另类专区| ...av二区三区久久精品| 国产午夜精品在线观看| 久久久久久久久岛国免费| 精品国产成人系列| 日韩欧美一区在线| 日韩手机在线导航| 欧美一级欧美一级在线播放| 欧美精品亚洲二区| 91精品久久久久久久久99蜜臂| 欧美日韩国产免费一区二区| 欧美人与禽zozo性伦| 欧美老女人第四色| 51久久夜色精品国产麻豆| 91精品视频网| 精品第一国产综合精品aⅴ| 久久青草欧美一区二区三区| 日本一区二区在线不卡| 国产精品不卡在线| 亚洲综合色视频| 亚洲成年人网站在线观看| 日本欧美肥老太交大片| 激情国产一区二区| 成人免费毛片高清视频| 99在线精品观看| 欧美图片一区二区三区| 欧美一级黄色录像| 久久蜜臀中文字幕| ●精品国产综合乱码久久久久| 一区二区三区四区不卡在线 | 亚洲综合免费观看高清完整版在线| 国产精品毛片高清在线完整版| 中文字幕亚洲电影| 午夜伊人狠狠久久| 国内精品在线播放| eeuss影院一区二区三区| 欧美日韩国产综合久久| 久久久久久久久久久黄色| 亚洲精品五月天| 麻豆精品一区二区| 9色porny自拍视频一区二区| 欧美精品1区2区3区| 国产亚洲欧美日韩在线一区| 亚洲欧美欧美一区二区三区| 亚洲一区二区三区小说| 国产乱人伦偷精品视频免下载| 91视频观看免费| 日韩欧美一二三| 17c精品麻豆一区二区免费| 免费在线一区观看| 色综合久久久久综合99| 欧美精品一区二区三区四区 | 国产亚洲欧美色| 亚洲成av人片在www色猫咪| 国产在线精品不卡| 欧美日韩大陆一区二区| 久久久91精品国产一区二区精品| 玉米视频成人免费看| 国产盗摄一区二区| 911精品国产一区二区在线| 国产精品免费视频网站| 精油按摩中文字幕久久| 在线免费观看日韩欧美| 国产人久久人人人人爽| 奇米综合一区二区三区精品视频| 91在线你懂得| 国产亚洲欧洲997久久综合 | 日韩免费一区二区三区在线播放| 亚洲欧洲另类国产综合| 国产精品一区在线| 欧美一区二区精品在线| 亚洲综合一区在线| 91亚洲精品乱码久久久久久蜜桃| 久久日一线二线三线suv| 日韩在线观看一区二区| 欧美性大战xxxxx久久久| |精品福利一区二区三区| 国产成人精品免费在线| 精品国产网站在线观看| 日韩精品乱码免费| 欧美精品18+| 婷婷综合另类小说色区| 欧美色偷偷大香| 亚洲主播在线观看| 日本韩国精品在线| 亚洲日本va午夜在线影院| aaa国产一区| 国产精品国产三级国产专播品爱网 | 在线观看免费视频综合| 亚洲视频一二区| 91在线视频播放| 亚洲日本一区二区三区| av电影天堂一区二区在线| 亚洲欧洲国产日韩| 94-欧美-setu|