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

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

?? usbehcdutil.c

?? vxWorks下USB2.0中的EHCI的HCD源碼,極具有參考價值
?? C
?? 第 1 頁 / 共 5 頁
字號:
** This function is used to calculate the bus time required for the endpoint.** <uSpeed> - Speed of the device.* <uDirection> - Direction of the pipe.* <uPipeType> - Type of the endpoint.* <uDataByteCount>  - maximum byte count supported by the pipe.** RETURNS: Calculated bus time in nanoseconds.** ERRNO:*   None.** \NOMANUAL*/INT32 usbEhcdCalculateBusTime    (    UINT32 uSpeed,     /* Speed of the device */    UINT32 uDirection, /* Direction of the pipe */    UINT32 uPipeType,  /* type of the pipe */    UINT32 uDataByteCount /* Maximum byte count supported by the pipe */    )    {    /* Calculate the bus time for a low speed pipe */    if(USBHST_LOW_SPEED == uSpeed)        {        /* Calculate the bustime for an IN pipe */        if (USB_EHCD_DIR_IN == uDirection)            {            return (INT32)(64060+(2*USB_EHCD_HUB_LS_SETUP)+(676.67*                    floor(3.167+USB_EHCD_BIT_STUFF_TIME(uDataByteCount)))+                    USB_EHCD_HOST_DELAY);            }        /* Calculate the bustime for an OUT pipe */        else            {            return (INT32)(64107+(2*USB_EHCD_HUB_LS_SETUP)+(667.0*                    floor(3.167+USB_EHCD_BIT_STUFF_TIME(uDataByteCount)))+                    USB_EHCD_HOST_DELAY);            }        }        /* End of if(Speed == USBHST_LOW_SPEED) */    /* Calculate the bus time for a Full speed pipe */    else if(USBHST_FULL_SPEED == uSpeed)        {        /* Calculate the bus time for a control, bulk or interrupt pipe */        if( USBHST_ISOCHRONOUS_TRANSFER != uPipeType)            {            return(INT32)(9107 +(83.54 *                   floor(3.167+                   USB_EHCD_BIT_STUFF_TIME(uDataByteCount)))+                   USB_EHCD_HOST_DELAY);            }            /* Calculate the bus time for an isochronous pipe */        else            {#if 0	/* Just to recheck BW calculation currently returning 'zero'*/            /* Calculate the bus time for an IN endpoint */            if  (USB_EHCD_DIR_IN == uDirection)                {                return (INT32)(7268+(83.54 *                        floor(3.167+                        USB_EHCD_BIT_STUFF_TIME(uDataByteCount)))+                        USB_EHCD_HOST_DELAY);                }                /* Calculate the bus time for an OUT endpoint */            else                {                return (INT32)(6265+(83.54 *                        floor(3.167+USB_EHCD_BIT_STUFF_TIME(uDataByteCount)))+                        USB_EHCD_HOST_DELAY);                }#endifreturn 1;            }            /* End of else */        }        /* End of else if(Speed == USBHST_FULL_SPEED) */    /* Calculate the bus time for a high speed pipe */    else if(USBHST_HIGH_SPEED == uSpeed)        {        /* Calculate the bus time for a control, bulk or interrupt pipe */        if(USBHST_ISOCHRONOUS_TRANSFER != uPipeType)            {            return (INT32)((55 * 8 * 2.083)+(2.083*                    floor(3.167 + USB_EHCD_BIT_STUFF_TIME(uDataByteCount))) +                    USB_EHCD_HOST_DELAY);            }        /* Calculate the bus time for an isochronous pipe */        else            {            return (INT32)((38 * 8 * 2.083)+(2.083*                    floor(3.167 + USB_EHCD_BIT_STUFF_TIME(uDataByteCount))) +                    USB_EHCD_HOST_DELAY);            }        }        /* End of else if(Speed == USBHST_HIGH_SPEED) */    return -1;    }    /* End of usbEhcdCalculateBusTime() *//***************************************************************************** usbEhcdCheckBandwidth - checks the bandwidth availability** This function is used to check whether bandwidth is available and returns the* list which can hold the endpoint and also the mask value which indicates the* microframes which can hold the endpoint transfers.** <pHCDData> - Pointer to the EHCD_DATA structure.* <uBandwidth > - Bandwidth to be reserved.* <uSpeed> - Speed of the transfer.* <pEndpointDesc>  - Pointer to the endpoint descriptor.* <puListIndex> - Pointer which can hold the list index which holds the endpoint*                 transfers* <puMicroFrameMask> - Pointer to the mask value which can hold the microframes*                      which can hold the endpoint transfers.* <puStepValue> - Pointer to the step value used for stepping into the*                 frame list for isochronous transfers.* RETURNS: TRUE if the bandwidth can be accomodated.*          FALSE if the bandwidth cannot be accomodated.** ERRNO:*   None.** \NOMANUAL*/BOOLEAN usbEhcdCheckBandwidth    (    pUSB_EHCD_DATA  pHCDData,  /* Pointer to the EHCD_DATA structure */    ULONG       uBandwidth, /* Bandwidth to be reserved */    UINT32      uSpeed,     /* Speed of the transfer */    pUSBHST_ENDPOINT_DESCRIPTOR pEndpointDesc, /* Pointer to the endpoint desc */    UINT32  *   puListIndex,/* Pointer to the list index */    UINT32  *   puMicroFrameMask, /* Pointer to the microframe mask value */    UINT32  *   puStepValue /* Pointer to the step value into the framelist */    )    {    /* To hold the index into the periodic frame list */    UINT32 uCount = 0;    /* To hold the polling interval */    UINT32 uPollInterval = 0;    /* To hold the bandwidth calculated */    UINT32 uCalculatedBandwidth = 0;    /* To hold the least occupied bandwidth */    UINT32 uLeastBandwidth = 0;    /* To hold the index of the frame which has the least occupied bandwidth */    UINT32 uLeastBwIndex = 0;    OS_LOG_MESSAGE_LOW(EHCD,"usbEhcdCheckBandwidth - Entry\n",0,0,0,0);    /* Check the validity of the parameters */    if ((NULL == pHCDData) ||        (0 == uBandwidth) ||        (NULL == pEndpointDesc) ||        (USBHST_HIGH_SPEED != uSpeed &&         USBHST_FULL_SPEED != uSpeed &&         USBHST_LOW_SPEED != uSpeed) ||        (NULL == puStepValue) ||        (NULL == puListIndex) ||        (NULL == puMicroFrameMask))        {        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdCheckBandwidth - Invalid parameter\n",0,0,0,0);        return FALSE;        }    /* Return error if the type is not a periodic endpoint type */    if ((USBHST_ISOCHRONOUS_TRANSFER !=         (pEndpointDesc->bmAttributes & USB_EHCD_ENDPOINT_TYPE_MASK)) &&        (USBHST_INTERRUPT_TRANSFER !=         (pEndpointDesc->bmAttributes & USB_EHCD_ENDPOINT_TYPE_MASK)))        {        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdCheckBandwidth - Not a periodic endpoint\n",0,0,0,0);        return FALSE;        }    /* Exclusively access the bandwidth resource */    OS_WAIT_FOR_EVENT(pHCDData->BandwidthEventID,OS_WAIT_INFINITE);    if (USBHST_ISOCHRONOUS_TRANSFER ==        (pEndpointDesc->bmAttributes & USB_EHCD_ENDPOINT_TYPE_MASK))    {        UINT32 uMaxBandwidth = 0;   /* Starting from the leaf nodes, check whether    * supplied bandwidth can be accomodated here */    for (uCount = 0; USB_EHCD_MAX_FRAMELIST_SIZE > uCount; uCount++)        {        uCalculatedBandwidth = 0;        /* Calculate the bandwidth occupied in this frame */        USB_EHCD_CALCULATE_FRAME_BANDWIDTH(pHCDData,                                           uCount,                                           uCalculatedBandwidth);        /* Get the maximum bandwidth used in a frame */        if (uCalculatedBandwidth > uMaxBandwidth)            {            uMaxBandwidth = uCalculatedBandwidth;            }        }    /* End of for () */    /* If there is no bandwidth available, return an error */    if ((USB_EHCD_EIGHTY_PERCENT_BW * USB_EHCD_MAX_MICROFRAME_NUMBER) <        (uMaxBandwidth + uBandwidth))        {        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdCheckBandwidth - Bandwidth not available\n",0,0,0,0);        /* Release the bandwidth exclusive access */        OS_RELEASE_EVENT(pHCDData->BandwidthEventID);        return FALSE;        }    }    /* Initialize the least bandwidth to be the maximum bandwidth applicable */    uLeastBandwidth = USB_EHCD_EIGHTY_PERCENT_BW * USB_EHCD_MAX_MICROFRAME_NUMBER;    /* Starting from the leaf nodes, check whether bandwidth is available */    for (uCount = 0; USB_EHCD_MAX_FRAMELIST_SIZE > uCount; uCount++)        {        /* initialize the calculated bandwidth to be 0 */        uCalculatedBandwidth = 0;        /* Calculate the bandwidth occupied in this frame */        USB_EHCD_CALCULATE_FRAME_BANDWIDTH(pHCDData,                                           uCount,                                           uCalculatedBandwidth);        /* If the bandwidth occupied is less than the previous least bandwidth,         * this becomes the least bandwidth reserved.         */        if (uCalculatedBandwidth < uLeastBandwidth)            {            uLeastBandwidth = uCalculatedBandwidth;            uLeastBwIndex = uCount;            }        }    /* End of for () */    /* If there is no bandwidth available, return an error */    if ((USB_EHCD_EIGHTY_PERCENT_BW * USB_EHCD_MAX_MICROFRAME_NUMBER) <        (uLeastBandwidth + uBandwidth))        {        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdCheckBandwidth - Bandwidth not available\n",0,0,0,0);        /* Release the bandwidth exclusive access */        OS_RELEASE_EVENT(pHCDData->BandwidthEventID);        return FALSE;        }    /* Get the polling interval of the endpoint */    uPollInterval = pEndpointDesc->bInterval;    /* Check if it is a low or full speed device endpoint */    if (USBHST_HIGH_SPEED != uSpeed)        {        /* Check if it is an interrupt endpoint */        if (USBHST_INTERRUPT_TRANSFER ==            (pEndpointDesc->bmAttributes & USB_EHCD_ENDPOINT_TYPE_MASK))            {            /* Array holding the start and complete split masks */            UINT32 uSplitMask[USB_EHCD_MAX_INT_SPLIT_MASKS] =   {                USB_EHCD_SPLIT_MASK_1,                USB_EHCD_SPLIT_MASK_2,                USB_EHCD_SPLIT_MASK_3,                USB_EHCD_SPLIT_MASK_4            };            /* Identify the index of the leaf of the tree, which is to be used*/            *puListIndex =            pHCDData->FrameListData[uLeastBwIndex].uNextListIndex;            /* 32 is the maximum polling interval which is supported.             * So if the polling interval is greater than 32, the endpoint             * will be polled every 32 ms.             */            if (USB_EHCD_MAX_USB11_INTERRUPT_POLL_INTERVAL > uPollInterval)                {                /* To hold the number of times the list is to be traversed */                UINT8 uTraversalCount = 0;                /* Calculate the traversal count */                USB_EHCD_CALCULATE_TRAVERSAL_COUNT(uPollInterval,uTraversalCount);                /* Get the Tree Index */                while (0 < uTraversalCount)                    {                    *puListIndex =                    pHCDData->TreeListData[*puListIndex].uNextListIndex;                    /* Decrement the traversal count */                    uTraversalCount--;                    }/* End of while */                }/* End of if (EHCD_MAX_USB11_INTERRUPT_POLL_INTERVAL > ...*/            /* Initialize the least bandwidth occupied */            uLeastBandwidth = USB_EHCD_EIGHTY_PERCENT_BW *                              USB_EHCD_MAX_MICROFRAME_NUMBER;            /* Retrieve the mask value which best fits this bandwidth */            for (uCount = 0; USB_EHCD_MAX_INT_SPLIT_MASKS > uCount; uCount++)                {                /* Initialize the uCalculatedBandwidth = 0 */                uCalculatedBandwidth = 0;                /* Calculate the bandwidth with the node element added */                USB_EHCD_CALCULATE_BW_MICROFRAMES(pHCDData,                                                  uSplitMask[uCount],                                                  uLeastBwIndex,                                                  uCalculatedBandwidth);                /* If this mask has the least bandwidth occupied, use this */                if (uCalculatedBandwidth < uLeastBandwidth)                    {                    uLeastBandwidth = uCalculatedBandwidth;                    *puMicroFrameMask = uSplitMask[uCount];                    }                }            /* Check if the bandwidth cannot be accomodated */            if (USB_EHCD_EIGHTY_PERCENT_BW * USB_EHCD_MAX_MICROFRAME_NUMBER                < (uLeastBandwidth + uBandwidth))                {                OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdCheckBandwidth - No bandwidth \n",0,0,0,0);                /* Release the bandwidth exclusive access */                OS_RELEASE_EVENT(pHCDData->BandwidthEventID);                return FALSE;                }            /* Update the step value */            *puStepValue = 0;            }/* End of if (USBHST_INTERRUPT_TRANSFER... */        /* The following is for isochronous transfer type */        else            {            /* Array holding the split masks */            UINT32 uSplitMask[USB_EHCD_MAX_MICROFRAME_NUMBER];            /* Initialize the split mask as per direction */            if (0 == (pEndpointDesc->bEndpointAddress & USB_EHCD_DIR_IN))            {            /* Array holding the start split masks for OUT transaction */                        uSplitMask[0] = 0x01; /* 00000001 */            uSplitMask[1] = 0x02; /* 00000010 */            uSplitMask[2] = 0x04; /* 00000100 */            uSplitMask[3] = 0x08; /* 00001000 */            uSplitMask[4] = 0x10; /* 00010000 */            uSplitMask[5] = 0x20; /* 00100000 */            uSplitMask[6] = 0x40; /* 01000000 */            uSplitMask[7] = 0x80; /* 10000000 */                        }            else            {            /* Array holding the start and complete split masks for IN transaction*/            uSplitMask[0] = USB_EHCD_SPLIT_MASK_1;            uSplitMask[1] = USB_EHCD_SPLIT_MASK_2;            uSplitMask[2] = USB_EHCD_SPLIT_MASK_3;            uSplitMask[3] = USB_EHCD_SPLIT_MASK_4;            uSplitMask[4] = 0x00;            uSplitMask[5] = 0x00;            uSplitMask[6] = 0x00;            uSplitMask[7] = 0x00;                                }            /* Initialize the least bandwidth occupied */            uLeastBandwidth = USB_EHCD_EIGHTY_PERCENT_BW                             * USB_EHCD_MAX_MICROFRAME_NUMBER;            /* Retrieve the mask value which best fits this bandwidth */            for (uCount = 0;                 ((USB_EHCD_MAX_MICROFRAME_NUMBER > uCount) &&                  (0 != uSplitMask[uCount]));                uCount++)                {                /* Initialize the uCalculatedBandwidth = 0 */                uCalculatedBandwidth = 0;                /* Calculate the bandwidth with the node element added */                USB_EHCD_CALCULATE_BW_MICROFRAMES(pHCDData,                                                  uSplitMask[uCount],                                                  uLeastBwIndex,                                                  uCalculatedBandwidth);                /* If this mask has the least bandwidth occupied, use this */                if (uCalculatedBandwidth < uLeastBandwidth)                    {                

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美天堂一区二区三区| 国产精品私人自拍| 精品奇米国产一区二区三区| 国产精品污www在线观看| 丝袜亚洲另类欧美| 91香蕉视频mp4| 精品国产乱码久久久久久闺蜜| 亚洲人成电影网站色mp4| 精品中文av资源站在线观看| 色综合久久综合中文综合网| 国产日韩欧美一区二区三区乱码 | 国产suv一区二区三区88区| 欧美亚洲国产怡红院影院| 久久精品视频免费观看| 麻豆精品久久久| 欧美日韩午夜在线视频| 亚洲日本免费电影| 成人免费看的视频| 久久久综合精品| 日韩不卡一二三区| 欧美亚洲高清一区| 夜夜嗨av一区二区三区中文字幕| 国产一区二区调教| 精品国产百合女同互慰| 日韩不卡一二三区| 欧美一区二区免费视频| 香蕉久久夜色精品国产使用方法| 色综合中文综合网| 在线视频国产一区| 亚洲另类在线视频| 色综合久久久网| 亚洲精品一二三| 色哟哟欧美精品| 一区二区视频免费在线观看| 99精品一区二区三区| 国产精品国产精品国产专区不蜜| 国产精品一线二线三线| 久久久精品日韩欧美| 国产精品一区二区在线播放| 久久青草欧美一区二区三区| 国产99久久久久久免费看农村| 久久综合狠狠综合久久综合88| 精彩视频一区二区三区| 久久久久久一二三区| 国产很黄免费观看久久| 国产精品毛片无遮挡高清| 成人av在线网站| 一区二区三区不卡在线观看| 精品视频免费在线| 蜜桃视频免费观看一区| 久久久www免费人成精品| 成人av在线播放网站| 亚洲自拍偷拍麻豆| 欧美电影在哪看比较好| 黄色资源网久久资源365| 中文字幕久久午夜不卡| 91美女视频网站| 日韩精品乱码av一区二区| 精品乱人伦一区二区三区| 国产河南妇女毛片精品久久久 | 精品国产99国产精品| 国产成人在线视频网站| 亚洲精品成人在线| 制服丝袜成人动漫| 国产99久久久国产精品潘金 | 欧美大片国产精品| 高清在线成人网| 一区二区三区四区在线免费观看| 制服丝袜激情欧洲亚洲| 成人午夜av在线| 亚洲午夜av在线| 久久久蜜臀国产一区二区| 日本久久一区二区| 精品亚洲porn| 夜夜精品视频一区二区| 久久精品人人做| 欧美日韩三级视频| aaa欧美色吧激情视频| 日本在线播放一区二区三区| 欧美国产激情二区三区| 欧美三级电影网站| 成人毛片老司机大片| 日韩av不卡一区二区| 国产精品乱码妇女bbbb| 欧美日韩一区二区三区不卡| 国产成人免费在线观看不卡| 婷婷亚洲久悠悠色悠在线播放| 国产亚洲午夜高清国产拍精品| 在线观看日韩电影| 不卡一二三区首页| 韩国一区二区视频| 五月天丁香久久| 亚洲男人的天堂av| 久久精子c满五个校花| 制服丝袜成人动漫| 欧美吻胸吃奶大尺度电影| 国产成人一区二区精品非洲| 婷婷丁香激情综合| 亚洲一区二区在线播放相泽| 国产精品久久久一本精品| 久久伊99综合婷婷久久伊| 欧美日产国产精品| 欧美综合视频在线观看| 99久久精品久久久久久清纯| 国产成人精品亚洲777人妖| 国内精品免费**视频| 老司机午夜精品| 青草av.久久免费一区| 五月天婷婷综合| 视频一区二区三区中文字幕| 亚洲地区一二三色| 亚洲精品五月天| 成人免费视频在线观看| 中文字幕av一区二区三区免费看| 日韩精品一区二区三区视频播放| 欧美群妇大交群中文字幕| 欧美日韩国产在线观看| 欧美日韩国产精品成人| 91精品啪在线观看国产60岁| 欧美高清dvd| 欧美日韩精品电影| 日韩一卡二卡三卡四卡| 综合婷婷亚洲小说| 精品系列免费在线观看| 亚洲视频一区二区在线| 欧美国产欧美综合| 国产精品区一区二区三| 国产精品久久久久影院色老大| 久久网这里都是精品| 久久免费电影网| 国产精品久久久久久久午夜片 | 秋霞av亚洲一区二区三| 久久精品国产免费| 国产激情视频一区二区三区欧美 | 国产色综合一区| 亚洲欧洲精品一区二区三区| 亚洲精品写真福利| 午夜成人免费电影| 国产一区二区三区不卡在线观看 | 国产麻豆一精品一av一免费| 国产一区二区电影| av高清不卡在线| 欧美日韩精品福利| 26uuu欧美| 亚洲日本va在线观看| 天天综合网天天综合色| 国内精品伊人久久久久影院对白| 国模少妇一区二区三区| 99国产精品国产精品久久| 欧美中文字幕一区| 欧美一区三区二区| 中文在线一区二区| 午夜精品在线看| 国产在线精品免费| 色综合天天综合| 欧美一区2区视频在线观看| 国产欧美日韩亚州综合| 亚洲一区二区三区四区在线免费观看 | 日韩美女精品在线| 日韩高清欧美激情| gogo大胆日本视频一区| 欧美精品在线一区二区三区| 久久久亚洲综合| 亚洲国产中文字幕在线视频综合 | 精品少妇一区二区三区| 亚洲欧美日韩系列| 激情综合色综合久久综合| 色八戒一区二区三区| 国产亚洲精品aa| 亚洲mv在线观看| www.综合网.com| 91精品福利在线一区二区三区| 国产精品沙发午睡系列990531| 视频一区二区三区在线| 91在线porny国产在线看| 欧美大片一区二区| 亚洲国产精品一区二区www在线| 国产成人精品亚洲日本在线桃色| 欧美美女一区二区在线观看| 亚洲精品视频免费看| 大胆亚洲人体视频| 欧美v日韩v国产v| 亚洲chinese男男1069| 在线日韩国产精品| 国产精品女同一区二区三区| 久久精工是国产品牌吗| 欧美日本在线播放| 亚洲一区二区成人在线观看| 波多野结衣在线一区| 精品国产91洋老外米糕| 麻豆91在线观看| 日韩免费视频线观看| 日韩精品一区第一页| 欧美日韩免费一区二区三区视频| 一区二区三区中文免费| 9l国产精品久久久久麻豆| 中文字幕精品在线不卡| 国产aⅴ综合色| 中文字幕不卡在线播放| 成人午夜电影网站|