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

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

?? usbtcdisp1582endpoint.c

?? This the compressed USB driver source code for vxworks5.6. It has device controller driver and other
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* usbTcdIsp1582Endpoint.c - Endpoint Related Routines *//* Copyright 2004 Wind River Systems, Inc. *//*Modification history--------------------01g,17sep04,ami  WindView Instrumentation Changes01f,02aug04,mta  Modification History Changes01e,19jul04,ami  Coding Convention Changes01d,14jul04,mta  ISP1582 and Mass Storage Functionality Changes01c,08jul04,mta  ISP1582 with mass storage on SH changes01b,30jun04,pdg  Bug fixes - isp1582 full speed testing01a,21apr04,ami  First*//*DESCRIPTIONThis file implements the endpoint related functionalities of TCD(Target Controller Driver) for the Philips ISP 1582.INCLUDE FILES: usb/usbPlatform.h, usb/ossLib.h, usb/usbPciLib.h, usb/usb.h,               string.h, usb/target/usbHalCommon.h, usb/target/usbTcd.h               drv/usb/target/usbisp1582.h,               drv/usb/target/usbIsp1582Eval.h,               drv/usb/target/usbIsp1582Tcd.h*//* includes */#include "usb/usbPlatform.h"	   #include "usb/ossLib.h" 		     #include "usb/usbPciLib.h"	                 #include "usb/usb.h"                       #include "string.h"                          #include "usb/target/usbHalCommon.h"            #include "usb/target/usbTcd.h"                 #include "drv/usb/target/usbIsp1582.h"         #include "drv/usb/target/usbIsp1582Eval.h"	  #include "drv/usb/target/usbIsp1582Tcd.h"      #include "usb/target/usbPeriphInstr.h"/* defines */#define MAX_PACK_SIZE_MASK	0x07FF       /* max packet size mask */#define NTRANS_SIZE_MASK	0x1800       /* number of transaction per */                                             /* frame mask */#define NTRANS_SHIFT		0xB	     /* ntrans shift value */	#undef DMA_SUPPORTED/* globals */#ifdef DMA_SUPPORTED/*  *In order to demonstrate the proper operation of the Philips * PDIUSBD12 with DMA, we use these buffers for DMA transfers. */IMPORT UINT	sysFdBuf;		/* physical address of DMA bfr */IMPORT UINT	sysFdBufSize;		/* size of DMA buffer *//* forward declaration */LOCAL VOID disableDma (pUSB_TCD_ISP1582_TARGET pTarget, UINT8 endpointIndex);LOCAL VOID initializeDma (pUSB_TCD_ISP1582_TARGET pTarget, UINT8 endpointIndex,                          UINT8 command);#endif/* functions *//********************************************************************************* usbTcdIsp1582FncEndpointAssign - implements TCD_FNC_ENDPOINT_ASSIGN** This utility function is called to assign an endpoint depending on the* endpoint descriptor value.** RETURNS: OK or ERROR, if not able to assign the endpoint.** ERRNO:* \is* \i S_usbTcdLib_BAD_PARAM* Bad Parameter is passed.** \i S_usbTcdLib_HW_NOT_READY* Hardware is not ready.** \i S_usbTcdLib_GENERAL_FAULT* Fault in the upper software layer.** \i S_usbTcdLib_OUT_OF_MEMORY* Heap is out of memory.* \ie** \NOMANUAL*/LOCAL STATUS usbTcdIsp1582FncEndpointAssign    (    pTRB_ENDPOINT_ASSIGN	pTrb		/* Trb to be executed */    )    {    pTRB_HEADER	pHeader = (pTRB_HEADER) pTrb;	/* TRB_HEADER */    pUSB_TCD_ISP1582_TARGET	pTarget = NULL;	/* USB_TCD_ISP1582_TARGET */    pUSB_TCD_ISP1582_ENDPOINT	pEndpointInfo = NULL;/*USB_TCD_ISP1582_ENDPOINT*/    pUSB_ENDPOINT_DESCR		pEndptDescr = NULL;  /* pUSB_ENDPOINT_DESCR */	    UINT8	transferType = 0;		/* trasfer type of endpoint */    UINT8	direction = 0;			/* direction 1-IN, 0-OUT */    UINT16	maxPacketSize = 0;		/* max packet size */    BOOL	indexFound = FALSE;		    UINT8	endpointIndex = 0;		/* endpoint index */    UINT8	i = 0;    UINT8	nTrans = 0;    UINT16	data16 = 0;    UINT32	data32 = 0;			    UINT8	endpointNum = 0;		/* endpoint number */    /* WindView Instrumentation */     USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,    "usbTcdIsp1582FncEndpointAssign entered...", USB_TCD_ISP582_WV_FILTER);       USBISP1582_DEBUG ("usbTcdIsp1582FncEndpointAssign : Entered...\n",    0,0,0,0,0,0);    /* Validate parameters */    if ((pHeader == NULL) || (pHeader->trbLength < sizeof (TRB_HEADER)) ||        (pHeader->handle == NULL) || (pTrb->pEndpointDesc == NULL))    	{        /* WindView Instrumentation */         USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,        "usbTcdIsp1582FncEndpointAssign exiting...Bad Parameters Received",         USB_TCD_ISP582_WV_FILTER);       	USBISP1582_ERROR ("usbTcdIsp1582FncEndpointAssign : Bad Parameters \        ...\n",0,0,0,0,0,0);        return ossStatus (S_usbTcdLib_BAD_PARAM);        }    /* Get the endpoint descriptor */    pEndptDescr = pTrb->pEndpointDesc;    pTarget = (pUSB_TCD_ISP1582_TARGET)pHeader->handle;    /* Determine direction */    if ((pEndptDescr->endpointAddress & USB_ENDPOINT_DIR_MASK) != 0)        direction = USB_ENDPOINT_IN;    else        direction = USB_ENDPOINT_OUT;    /* Determine the endpoint number */    endpointNum = (pEndptDescr->endpointAddress & USB_ENDPOINT_MASK);    /* Determine the transfer type */    transferType = pEndptDescr->attributes & USB_ATTR_EPTYPE_MASK;    /*     * Determine the Max Packet Size. According to USB Specification only     * first 10 bits signifies max packet size and bits 11 & 12 states     * number of transaction per frame.     */    maxPacketSize = FROM_LITTLEW (pEndptDescr->maxPacketSize) &                     MAX_PACK_SIZE_MASK;    /* Determine the number of transaction per frame and validate it. */       nTrans =  (FROM_LITTLEW(pEndptDescr->maxPacketSize) & NTRANS_SIZE_MASK)              >> NTRANS_SHIFT;        /*     * Determine if Max Packet size is supported by the hardware (Total FIFO     * Size should not exceed 8K). If not, return ERROR.     */    if (pTarget->bufSize + maxPacketSize > ISP1582_FIFO_SIZE)        {        /* WindView Instrumentation */         USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,        "usbTcdIsp1582FncEndpointAssign exiting...ISP1582 FIFO full",        USB_TCD_ISP582_WV_FILTER);           return ossStatus (S_usbTcdLib_HW_NOT_READY);        }     if (transferType == USB_ATTR_CONTROL)        {        if (maxPacketSize > ISP1582_MAXPSIZE_64)            {            /* WindView Instrumentation */             USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,            "usbTcdIsp1582FncEndpointAssign exiting...wrong control max packet size",            USB_TCD_ISP582_WV_FILTER);               return ossStatus (S_usbTcdLib_HW_NOT_READY);            }        else            maxPacketSize = ISP1582_MAXPSIZE_64;        }    if ((transferType == USB_ATTR_CONTROL) || (transferType == USB_ATTR_BULK))        {        if (nTrans != ISP1582_NTRANS_1)            return ossStatus (S_usbTcdLib_HW_NOT_READY);        }    /* Determine a valid endpoint index */    /* Control Transfer */    if (transferType == USB_ATTR_CONTROL)        {        if (direction == USB_ENDPOINT_OUT)            {            /*              * Control Out Transfer.             * If Bit 0 of endpointIndexInUse is 0, then the corresponding             * endpoint is not in use, allocate it.             */            if ((pTarget->endpointIndexInUse & ( 0x1 << ISP1582_ENDPT_0_RX))==0)                {                indexFound = TRUE;                endpointIndex = ISP1582_ENDPT_0_RX;                }            }        else if (direction == USB_ENDPOINT_IN)            {            /* Control In Transfer. */            if ((pTarget->endpointIndexInUse & ( 0x1 << ISP1582_ENDPT_0_TX))==0)                {                indexFound = TRUE;                endpointIndex = ISP1582_ENDPT_0_TX;                }            }        }    else        {        /*         * Generic Transfer type. Any endpoint other then control in and out         * can be alloted. Hence we need to check only the direction and         * allocated endpoints accordingly.         */        if (direction == USB_ENDPOINT_OUT)            {            i = endpointNum * 2;            if ((pTarget->endpointIndexInUse & ( 0x1 << i)) == 0)                {                indexFound = TRUE;                endpointIndex = i;                }            }        else if (direction == USB_ENDPOINT_IN)            {            i = endpointNum * 2 + 1;            if ((pTarget->endpointIndexInUse & ( 0x1 << i)) == 0)                {                indexFound = TRUE;                endpointIndex = i;                }            }        }    if ( indexFound == FALSE )        {        /* WindView Instrumentation */         USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,        "usbTcdIsp1582FncEndpointAssign exiting...endpoint index not found",        USB_TCD_ISP582_WV_FILTER);           /* Valid Index not found */        return ossStatus (S_usbTcdLib_GENERAL_FAULT);        }     /* Allocate USB_TCD_ISP1582_ENDPOINT structure */    if ((pEndpointInfo = OSS_CALLOC (sizeof (USB_TCD_ISP1582_ENDPOINT)))== NULL)        {        /* WindView Instrumentation */         USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,        "usbTcdIsp1582FncEndpointAssign exiting...memory not free",        USB_TCD_ISP582_WV_FILTER);           USBISP1582_ERROR ("usbTcdIsp1582FncEndpointAssign : Bad Parameters \        ...\n",0,0,0,0,0,0);        return ossStatus (S_usbTcdLib_OUT_OF_MEMORY);        }    /*     * Store Direction, transfer type, max packet size and endpoint index in     * the USB_TCD_ISP1582_ENDPOINT.     */    pEndpointInfo->transferType = transferType;    pEndpointInfo->direction = direction;    pEndpointInfo->maxPacketSize = FROM_LITTLEW (pEndptDescr->maxPacketSize) &                                    MAX_PACK_SIZE_MASK;    pEndpointInfo->endpointIndex = endpointIndex;    pEndpointInfo->isDoubleBufSup = FALSE;    /*     * If transfer type is bulk or isochronous, endpoint may support double     * buffering.     */#ifdef DOUBLEBUF_SUPPORT    if (((transferType == USB_ATTR_BULK) || (transferType == USB_ATTR_ISOCH))          && (pTarget->bufSize + 2 * maxPacketSize <= ISP1582_FIFO_SIZE))        {        pTarget->bufSize += (2 * maxPacketSize);        pEndpointInfo->isDoubleBufSup = TRUE;        }    else        pTarget->bufSize += maxPacketSize;#else        pTarget->bufSize += maxPacketSize;#endif    /* Update endpointIndexInUse */    pTarget->endpointIndexInUse |=  (1 << endpointIndex);    /*     * If this endpoint is alloted to the DMA as an un-used endpoint, alot any     * other un-used endpoint to the DMA and write into the DMA endpoint     * register.     */    if (endpointIndex == pTarget->dmaEndptNotInUse)        {        for (i = ISP1582_ENDPT_7_TX ; i >= ISP1582_ENDPT_1_RX ; i--)            {            if ((pTarget->endpointIndexInUse & (0x1 << i)) == 0)                break;            }        if ( i < ISP1582_ENDPT_1_RX)            {            /* WindView Instrumentation */             USB_TCD_LOG_EVENT(USB_TCD_ISP1582_ENDPOINT,            "usbTcdIsp1582FncEndpointAssign exiting...no unused endpoint",            USB_TCD_ISP582_WV_FILTER);               USBISP1582_ERROR ("usbTcdIsp1582FncEndpointAssign : No Unused  \            endpoint...\n",0,0,0,0,0,0);            return ossStatus (S_usbTcdLib_HW_NOT_READY);            }        /* Initialize the DMA Endpoint Register to endpoint not used. */        isp1582Write8 (pTarget , ISP1582_DMA_ENDPT_REG , i);        pTarget->dmaEndptNotInUse = i;        }    /* Initialize the endpoint index register */    isp1582Write8 ( pTarget , ISP1582_ENDPT_INDEX_REG , endpointIndex);    /* Initialize Max Packet Size Register */    isp1582Write16 (pTarget , ISP1582_ENDPT_MAXPSIZE_REG ,              ISP1582_ENDPT_MAXPSIZE_REG_SHIFT_NTRANS (nTrans) | maxPacketSize);    /* Initialize Buffer Length Register */    isp1582Write16 (pTarget , ISP1582_BUF_LEN_REG ,maxPacketSize);    /* Form the value to be written into endpoint type register */    /* Determine transfer type */    switch (transferType)        {        case USB_ATTR_ISOCH:            data16 = ISP1582_ENDPT_TYPE_REG_EPTYPE_ISO |                     ISP1582_ENDPT_TYPE_REG_ENDPT_ENABLE;            if (pEndpointInfo->isDoubleBufSup)                data16 |= ISP1582_ENDPT_TYPE_REG_DOUBLE_BUF;            break;        case USB_ATTR_BULK :            data16 = ISP1582_ENDPT_TYPE_REG_EPTYPE_BULK |                     ISP1582_ENDPT_TYPE_REG_ENDPT_ENABLE;                        if (pEndpointInfo->isDoubleBufSup)                data16 |= ISP1582_ENDPT_TYPE_REG_DOUBLE_BUF;            break;        case USB_ATTR_INTERRUPT :            data16 = ISP1582_ENDPT_TYPE_REG_EPTYPE_INTP |                     ISP1582_ENDPT_TYPE_REG_ENDPT_ENABLE;            break;        case USB_ATTR_CONTROL :

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一线二线三线精华| 日韩精品中文字幕一区二区三区| 欧美丰满一区二区免费视频 | 色欧美日韩亚洲| 日韩美女主播在线视频一区二区三区 | 国产欧美一区二区精品性色超碰 | 精品国产免费视频| 亚洲色图丝袜美腿| 国产麻豆精品一区二区| 91精品黄色片免费大全| 亚洲一级片在线观看| 成人免费毛片app| 精品福利视频一区二区三区| 亚洲国产精品麻豆| 91看片淫黄大片一级| 国产精品毛片久久久久久| 国模大尺度一区二区三区| 欧美一级午夜免费电影| 天天综合色天天| 欧美三区免费完整视频在线观看| 亚洲精品一二三区| yourporn久久国产精品| 国产精品国产三级国产普通话99| 国产大陆a不卡| 国产人久久人人人人爽| 国产福利一区在线| 中文字幕不卡一区| 成人视屏免费看| 国产精品美女久久久久高潮| 成人av网站在线| 中文字幕一区av| 91丨九色丨黑人外教| 国产精品天天看| 97精品国产露脸对白| 亚洲精品视频在线看| 欧美伊人久久久久久午夜久久久久| 一区二区在线观看免费视频播放| 欧美亚洲综合一区| 五月天久久比比资源色| 欧美一区二区三区日韩视频| 九九视频精品免费| 欧美国产综合色视频| 一本色道久久综合亚洲精品按摩| 亚洲欧美激情一区二区| 欧美在线不卡视频| 水野朝阳av一区二区三区| 日韩一区二区在线看| 激情另类小说区图片区视频区| 久久精品免费在线观看| 91在线视频观看| 首页综合国产亚洲丝袜| 久久综合丝袜日本网| 不卡的看片网站| 亚洲高清免费一级二级三级| 精品欧美一区二区久久| 99国产一区二区三精品乱码| 亚洲国产精品尤物yw在线观看| 欧美成人高清电影在线| 成人av第一页| 婷婷开心激情综合| 国产三级精品三级在线专区| 欧美自拍丝袜亚洲| 国产精品一区二区在线播放| 亚洲综合清纯丝袜自拍| 久久久国产一区二区三区四区小说 | 欧美三级欧美一级| 国精产品一区一区三区mba视频| 中文字幕视频一区| 欧美一级理论片| www.欧美.com| 奇米影视7777精品一区二区| 国产精品美女一区二区在线观看| 欧美福利视频一区| 99久久久国产精品| 久久国产三级精品| 一区二区不卡在线播放| 精品成a人在线观看| 欧美亚州韩日在线看免费版国语版| 九九九精品视频| 亚洲综合激情网| 国产精品无码永久免费888| 欧美一级爆毛片| 欧美丝袜自拍制服另类| 国产精品一区在线观看你懂的| 亚洲国产精品一区二区久久| 国产精品美女久久久久aⅴ国产馆| 欧美一区二区黄色| 91久久人澡人人添人人爽欧美| 国产乱码精品一区二区三| 日本欧美大码aⅴ在线播放| 亚洲嫩草精品久久| 中文字幕成人av| 国产喂奶挤奶一区二区三区| 日韩你懂的在线观看| 欧美老肥妇做.爰bbww| 色综合久久88色综合天天 | 欧美日韩高清一区二区三区| 99久久国产综合色|国产精品| 黄色精品一二区| 青草av.久久免费一区| 日韩国产精品久久久| 亚洲香肠在线观看| 一区二区三区精品久久久| 最好看的中文字幕久久| 国产精品久久777777| 国产欧美一区二区精品性色超碰 | 日韩精品一级中文字幕精品视频免费观看| 中文字幕+乱码+中文字幕一区| 久久久久久影视| 日本一区二区高清| 国产亚洲精久久久久久| 国产日韩欧美制服另类| 欧美国产日本视频| 国产精品久久久久久久久快鸭| 国产精品人妖ts系列视频| 日本一区二区三区四区| 国产三级欧美三级| 欧美激情艳妇裸体舞| 国产精品乱码妇女bbbb| 亚洲色图.com| 亚洲国产视频直播| 日韩高清国产一区在线| 麻豆精品一区二区三区| 国产精品一区二区免费不卡| 波多野结衣亚洲| 一本久久a久久精品亚洲| 欧美日韩精品一区二区天天拍小说 | 精品一区免费av| 国产一区不卡在线| www.激情成人| 欧美午夜在线观看| 欧美一区二区三区免费大片| 久久噜噜亚洲综合| 亚洲欧洲在线观看av| 亚洲图片一区二区| 紧缚捆绑精品一区二区| 成人av片在线观看| 在线精品观看国产| 欧美va亚洲va| 亚洲精品在线免费播放| 中文字幕日韩一区二区| 亚洲国产精品久久人人爱蜜臀| 久草热8精品视频在线观看| 成人av资源网站| 欧美精品日韩一区| 国产三级久久久| 亚洲国产精品精华液网站| 国产乱子伦视频一区二区三区| 色综合咪咪久久| 精品国产免费视频| 亚洲欧美日韩国产手机在线| 日本欧美一区二区| av在线综合网| 日韩欧美一区二区不卡| 亚洲视频网在线直播| 免费成人性网站| 色婷婷综合久久久| 精品欧美一区二区在线观看| 亚洲人成小说网站色在线| 国产综合色视频| 精品视频一区二区不卡| 国产精品免费丝袜| 美国一区二区三区在线播放| 91啪亚洲精品| 日本一区二区视频在线| 蜜桃av一区二区三区| 色欧美片视频在线观看在线视频| 精品三级在线观看| 亚洲午夜成aⅴ人片| 不卡一卡二卡三乱码免费网站| 欧美成人官网二区| 婷婷综合五月天| 在线视频国内自拍亚洲视频| 中文乱码免费一区二区| 国精产品一区一区三区mba视频| 欧美日韩精品综合在线| 一级中文字幕一区二区| 99精品久久只有精品| 日本一区二区在线不卡| 国产乱国产乱300精品| 日韩视频免费观看高清完整版在线观看 | 一级特黄大欧美久久久| 成人av中文字幕| 欧美国产禁国产网站cc| 国产精品一区在线观看乱码| 日韩精品一区二区三区四区视频| 亚洲福利视频一区二区| 欧美丝袜自拍制服另类| 亚洲一区二区精品久久av| 91麻豆高清视频| 亚洲欧美激情小说另类| 91浏览器入口在线观看| 自拍偷拍欧美精品| 93久久精品日日躁夜夜躁欧美| 国产精品女主播av| 大陆成人av片| 自拍偷拍亚洲综合| 在线观看亚洲a| 亚洲国产成人91porn| 欧美精品日韩综合在线|