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

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

?? usbehcdrhemulation.c

?? vxWorks下USB2.0中的EHCI的HCD源碼,極具有參考價值
?? C
?? 第 1 頁 / 共 5 頁
字號:
            OS_MEMCPY(&uPortStatus,
                      (pHCDData->RHData.pPortStatus +
                       (pSetup->wIndex -1)),
                      USB_EHCD_RH_PORT_STATUS_SIZE);

            /* Swap the data to the LE format */

            uPortStatus = OS_UINT32_LE_TO_CPU(uPortStatus);

            /* Clear the suspend bit */

            uPortStatus &= ~(USB_EHCD_RH_PORT_SUSPEND_MASK);

            /* Update the suspend change */

            uPortStatus |= USB_EHCD_RH_PORT_SUSPEND_CHANGE;

            /* Swap the data to CPU format data */

            uPortStatus = OS_UINT32_CPU_TO_LE(uPortStatus);

            /* Copy the status back to the port status */

            OS_MEMCPY((pHCDData->RHData.pPortStatus +
                       (pSetup->wIndex -1)),
                       &uPortStatus,
                       USB_EHCD_RH_PORT_STATUS_SIZE);
            /*
             * Call the function to populate the interrupt
             * status data
             */

            usbEhcdCopyRHInterruptData(
                     pHCDData,
                     (USB_EHCD_RH_MASK_VALUE << (pSetup->wIndex -1)));
            break;
            }
        case USB_EHCD_RH_PORT_POWER:  /* Port Power */
            {
            /* Switch off power in the port */

            USB_EHCD_CLR_BIT_PORT(pHCDData,
                              (pSetup->wIndex) -1,
                              PORT_POWER);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;
            break;
            }
        case USB_EHCD_RH_C_PORT_CONNECTION:/* c_port_connection */
            {
            if (USB_EHCD_GET_FIELD_PORT(pHCDData,
                                        ((pSetup->wIndex) -1),
                                        CONNECT_STATUS_CHANGE) != 0)
                {

                /* Clear the connection status change */

                USB_EHCD_CLR_BIT_PORT(pHCDData,
                                  ((pSetup->wIndex) -1),
                                  CONNECT_STATUS_CHANGE);
                }
            /* This condition can happen if the EHCI does not support
             * port power switching. In this case, if a device is connected
             * while the target boots up, there is no connect status change
             * and no root hub status change interrupt which is generated
             */
            else
                {
                /* To hold the status of the port */

                UINT32 uPortStatus = 0;

                /* Copy the value in the port status register */

                OS_MEMCPY(&uPortStatus,
                          (pHCDData->RHData.pPortStatus +
                           ((pSetup->wIndex) -1)),
                          USB_EHCD_RH_PORT_STATUS_SIZE);

                /* Swap the data from the LE format */

                uPortStatus = OS_UINT32_LE_TO_CPU(uPortStatus);

                /* Update the connect status change */

                uPortStatus &= ~(USB_EHCD_RH_PORT_CONNECT_CHANGE);

                /* Swap the data to LE format data */

                uPortStatus = OS_UINT32_CPU_TO_LE(uPortStatus);

                /* Copy the status back to the port status */

                OS_MEMCPY((pHCDData->RHData.pPortStatus +
                           ((pSetup->wIndex) -1)),
                           &uPortStatus,
                           USB_EHCD_RH_PORT_STATUS_SIZE);

                }
            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;
            break;
            }
        case USB_EHCD_RH_C_PORT_ENABLE:/* c_port_enabled */
            {
            /* Clear the port enable disable change */

            USB_EHCD_CLR_BIT_PORT(pHCDData,
                              ((pSetup->wIndex) -1),
                              PORT_ENABLE_DISABLE_CHANGE);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;
            break;
            }
        case USB_EHCD_RH_C_PORT_OVER_CURRENT:/* c_port_over_current */
            {
            /* Clear the overcurrent change */

            USB_EHCD_CLR_BIT_PORT(pHCDData,
                              ((pSetup->wIndex) -1),
                              OVER_CURRENT_CHANGE);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;
            break;
            }
        case USB_EHCD_RH_PORT_INDICATOR:/* Port Indicator */
            {
            /* Clear the Port indicator */

            USB_EHCD_CLR_BIT_PORT(pHCDData,
                              ((pSetup->wIndex & USB_EHCD_RH_PORT_NUMBER_MASK) -1),
                              PORT_INDICATOR_CONTROL);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;
            break;
            }
        case USB_EHCD_RH_PORT_TEST: /* Port test */
            {
            /* Clear the Port test */

            USB_EHCD_CLR_BIT_PORT(pHCDData,
                              ((pSetup->wValue & USB_EHCD_RH_PORT_NUMBER_MASK) -1),
                              PORT_TEST_CONTROL);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;
            break;
            }

        case USB_EHCD_RH_C_PORT_RESET:/* c_port_reset */
            {
            /* To hold the status of the port */

            UINT32 uPortStatus = 0;

            /* Clear the internal data for reset change */
            /* Copy the value in the port status register */

            OS_MEMCPY(&uPortStatus,
                      (pHCDData->RHData.pPortStatus +
                       (pSetup->wIndex -1)),
                      USB_EHCD_RH_PORT_STATUS_SIZE);

            /* Swap the data to the LE format */

            uPortStatus = OS_UINT32_LE_TO_CPU(uPortStatus);

            /* Update the reset change */

            uPortStatus &= (~USB_EHCD_RH_PORT_RESET_CHANGE);

            /* Swap the data to CPU format data */

            uPortStatus = OS_UINT32_CPU_TO_LE(uPortStatus);

            /* Copy the status back to the port status */

            OS_MEMCPY((pHCDData->RHData.pPortStatus +
                       (pSetup->wIndex -1)),
                       &uPortStatus,
                       USB_EHCD_RH_PORT_STATUS_SIZE);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;

            /*
             * Call the function to populate the interrupt
             * status data
             */
#if 0
            usbEhcdCopyRHInterruptData(
                     pHCDData,
                     (USB_EHCD_RH_MASK_VALUE << (pSetup->wIndex -1))); 
#endif
            break;
            }

        case USB_EHCD_RH_C_PORT_SUSPEND:/* c_port_suspend */
            {
            /* To hold the status of the port */

            UINT32 uPortStatus = 0;

            /* Clear the internal data for suspend change */

            /* Copy the value in the port status register */

            OS_MEMCPY(&uPortStatus,
                      (pHCDData->RHData.pPortStatus +
                       (pSetup->wIndex -1)),
                      USB_EHCD_RH_PORT_STATUS_SIZE);

            /* Update the suspend change */

            uPortStatus &= (~USB_EHCD_RH_PORT_SUSPEND_CHANGE);

            /* Copy the status back to the port status */

            OS_MEMCPY((pHCDData->RHData.pPortStatus +
                       (pSetup->wIndex -1)),
                       &uPortStatus,
                       USB_EHCD_RH_PORT_STATUS_SIZE);

            /* Update the URB status */

            pURB->nStatus = USBHST_SUCCESS;

            /*
             * Call the function to populate the interrupt
             * status data
             */

            usbEhcdCopyRHInterruptData(
                     pHCDData,
                     (USB_EHCD_RH_MASK_VALUE << (pSetup->wIndex -1)));
            break;
            }
        default:  /* Unknown feature */
            {
            pURB->nStatus = USBHST_INVALID_REQUEST;
            break;
            }/* End of default */
        }/* End of switch () */

    OS_LOG_MESSAGE_LOW(EHCD,"usbEhcdRhClearPortFeature - Exit\n",0,0,0,0);

    return Status;
    }
    /* End of usbEhcdRhClearPortFeature() */

/***************************************************************************
*
* usbEhcdRhGetHubDescriptor - get the hub descriptor
*
* This routine gets the hub descriptor.
*
* RETURNS: USBHST_SUCCESS if the URB is submitted successfully.
* USBHST_INVALID_PARAMETER if the parameters are not valid.
*
* ERRNO:
*   None.
*/

USBHST_STATUS usbEhcdRhGetHubDescriptor
    (
    pUSB_EHCD_DATA pHCDData,           /* Ptr to HCD block           */
    pUSBHST_URB	   pURB                /* Ptr to User Request Block  */
    )
    {
    /* To hold the request status */

    USBHST_STATUS Status = USBHST_SUCCESS;

    /* Pointer to the setup packet */

    pUSBHST_SETUP_PACKET pSetup = NULL;

    /* To hold the number of bytes alloted for the port information */

    UINT32 uPortBytes = 0;

    /* To hold the index into the ports */

    UINT32 uIndex = 0;

    /* Pointer to the buffer */

    UCHAR *pBuffer = NULL;

    OS_LOG_MESSAGE_LOW(EHCD,"usbEhcdRhGetHubDescriptor - Entry\n",0,0,0,0);

    /* Check the validity of the parameters */

    if (NULL == pHCDData ||
        NULL == pURB ||
        NULL == pURB->pTransferSpecificData ||
        NULL == pURB->pTransferBuffer)
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhGetHubDescriptor - \
                                           Invalid parameters\n",0,0,0,0);

        pURB->nStatus = USBHST_INVALID_PARAMETER;

        return USBHST_INVALID_PARAMETER;
        }

    /* Extract the setup packet */

    pSetup = (pUSBHST_SETUP_PACKET)pURB->pTransferSpecificData;

    /*
     * Check whether there are any invalid conditions.
     * i.e invalid DevRequest parameters
     */

    if(0x2900 != pSetup->wValue ||
       0 != pSetup->wIndex)
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhGetHubDescriptor - \
                                           Invalid parameters\n",0,0,0,0);
        pURB->nStatus = USBHST_INVALID_PARAMETER;
        return USBHST_INVALID_PARAMETER;
        }

    /*
     * Determine the number of bytes that the descriptor would occupy
     * ie. the num of bytes req to accomodate info about the ports
     */

    uPortBytes = (pHCDData->RHData.uNumDownstreamPorts) / 8;
    if(0 != pHCDData->RHData.uNumDownstreamPorts % 8)
        {
        uPortBytes++;
        }

    /* Allocate memory for the buffer */

    pBuffer = (UCHAR *)OS_MALLOC(7 + (uPortBytes * 2));

    /* Check if memory allocation is successful */

    if(NULL == pBuffer)
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhGetHubDescriptor - \
                                           Memory not allocated\n",0,0,0,0);
        pURB->nStatus = USBHST_MEMORY_NOT_ALLOCATED;
        return USBHST_MEMORY_NOT_ALLOCATED;
        }

    /* Population of the values of hub descriptor - Start */

    /* Length of the descriptor */

    pBuffer[0] = 7 + (uPortBytes * 2);

    /* Hub Descriptor type */

    pBuffer[1] = 0x29;

    /* Number of downstream ports */

    pBuffer[2] = pHCDData->RHData.uNumDownstreamPorts;

    /*
     * The following 2 bytes give the hub characteristics
     * The root hub has individual port overcurrent indication
     * Read the Port power control field and update whether the root hub
     * supports per port power switching or ganged power switching.
     */

    pBuffer[3] = 0x08 | USB_EHCD_GET_FIELD(pHCDData,
                                       HCSPARAMS,
                                       PPC);
    pBuffer[4] = 0;

    /* The power On to Power Good Time for the Root hub is 1 * 2ms */
    pBuffer[5] = 1;

    /* There are no specific maximim current requirements */

    pBuffer[6] = 0;

    /* The last few bytes of the descriptor is based on the number of ports */

    for(uIndex = 0;uIndex < uPortBytes ; uIndex++)
        {
        /* Indicates whether the hub is removable */

        pBuffer[7+uIndex] = 0;

        /* Port power control mask should be 1 for all the ports */

        pBuffer[7+uPortBytes+uIndex] = 0xff;
        }

    /* Population of the values of hub descriptor - End */

    /* Update the length */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久日韩精品一区二区五区| 亚洲国产一区二区三区青草影视| 色素色在线综合| 欧美疯狂性受xxxxx喷水图片| 91国产精品成人| 精品免费国产一区二区三区四区| 欧美日韩国产天堂| 国产精品视频在线看| 蜜臀91精品一区二区三区| 91免费小视频| 日本一区二区三区dvd视频在线| 久久蜜桃av一区二区天堂| 国产偷国产偷精品高清尤物 | 亚洲精品一区二区三区影院| 欧美一区二区不卡视频| 一区二区三区免费看视频| 高清久久久久久| 久久亚洲一区二区三区四区| 五月激情六月综合| 欧美优质美女网站| 亚洲欧洲三级电影| 成人国产免费视频| 国产午夜精品一区二区| 久久精品国产在热久久| 6080亚洲精品一区二区| 亚洲一区二区三区在线| 欧洲一区在线观看| 亚洲男人电影天堂| 91丨九色丨蝌蚪丨老版| 国产精品国产三级国产普通话蜜臀| 亚洲欧美偷拍三级| 91免费国产视频网站| 国产精品久久久久精k8| 一区二区三区高清在线| 99久久精品情趣| 成人欧美一区二区三区白人| 成人黄页毛片网站| 国产精品久久久久久久久免费桃花 | 免费欧美在线视频| 91麻豆精品久久久久蜜臀| 国产午夜精品在线观看| 国产一区91精品张津瑜| 91久久精品一区二区| 一区二区三区高清| 欧美三级在线播放| 欧美a级一区二区| 日韩欧美在线1卡| 九九久久精品视频| 在线观看视频一区二区| 精品久久久三级丝袜| 国内精品伊人久久久久av影院 | 国产日韩精品一区| 国产精品99久久久久久似苏梦涵 | 亚洲日本va在线观看| 老司机精品视频一区二区三区| 99热99精品| 亚洲女爱视频在线| 日韩欧美一级精品久久| 国产高清不卡一区| 亚洲老妇xxxxxx| 7799精品视频| 国产一区二区免费在线| 日韩理论片中文av| 欧美精品一级二级| 国产一区二区电影| 欧美不卡一二三| 91在线精品一区二区三区| 一区二区激情小说| 日韩欧美高清dvd碟片| 国产成人精品三级| 亚洲国产综合视频在线观看| 日韩一级二级三级| 国产**成人网毛片九色| 亚洲成a人片在线观看中文| 精品国产三级a在线观看| 青青草国产精品97视觉盛宴| 久久久99久久精品欧美| 91久久奴性调教| 国产一区不卡视频| 午夜精品123| 国产精品亲子乱子伦xxxx裸| 制服丝袜在线91| 不卡电影一区二区三区| 麻豆精品在线看| 亚洲精品伦理在线| 日本一区二区免费在线| 国产xxx精品视频大全| 亚洲福利视频导航| 欧美一区二区三区在线电影| av成人免费在线| 精品在线亚洲视频| 亚洲午夜电影网| ...av二区三区久久精品| 亚洲精品在线免费播放| 制服丝袜在线91| 日本韩国欧美在线| 成人激情综合网站| 国产美女精品在线| 蜜臀国产一区二区三区在线播放| 欧美一级久久久久久久大片| 91女厕偷拍女厕偷拍高清| 国产黄人亚洲片| 精品一区二区综合| 中文字幕在线不卡一区二区三区| 91在线观看美女| 成人av在线观| 高清av一区二区| 国产精品一区二区三区网站| 国产精品久久一级| 国产欧美精品区一区二区三区| 91在线精品一区二区三区| 成人a区在线观看| 国产成人精品影视| 国产成人亚洲综合色影视| 韩国精品在线观看| 国产精品一二三四五| 国产中文字幕一区| 国产美女av一区二区三区| 激情亚洲综合在线| 国产在线观看一区二区| 亚洲午夜免费电影| 天天色天天爱天天射综合| 亚洲h在线观看| 日韩精品乱码免费| 美女性感视频久久| 国产乱子轮精品视频| 一区二区三区资源| 精品日本一线二线三线不卡| 色女孩综合影院| 欧美日韩电影在线| 日韩视频永久免费| 久久综合色鬼综合色| 国产人成亚洲第一网站在线播放 | 欧美久久一区二区| 欧美一区二区在线免费播放| 91视频精品在这里| 91国内精品野花午夜精品| 欧美男男青年gay1069videost| 成人性生交大片免费看视频在线| 日韩精品乱码免费| 国内国产精品久久| voyeur盗摄精品| 国产在线乱码一区二区三区| www.日韩在线| 欧美三片在线视频观看| 精品久久国产字幕高潮| 欧美日本精品一区二区三区| 欧美成va人片在线观看| 欧美激情在线一区二区| 亚洲综合在线免费观看| 美腿丝袜在线亚洲一区| 懂色中文一区二区在线播放| 欧美系列一区二区| 久久久一区二区| 亚洲一区二区三区四区在线观看 | 国产欧美精品区一区二区三区| 日韩精品一区二区三区蜜臀| 欧美三级电影一区| 精品久久国产字幕高潮| 欧美一级高清片| 亚洲精选一二三| 韩国av一区二区| 欧美三级日韩在线| 久久九九国产精品| 婷婷夜色潮精品综合在线| 亚洲福利电影网| www.成人网.com| 欧美精品一区二区在线播放| 亚洲综合在线观看视频| 国产高清成人在线| 欧美一区二区三区在线观看| 亚洲精品成人精品456| 国内精品视频666| 国产精品88av| 日韩精品一区二区三区中文不卡 | 91玉足脚交白嫩脚丫在线播放| 国产成人精品www牛牛影视| 国产成人av网站| 日韩色视频在线观看| 一区二区三区在线观看欧美| 高清视频一区二区| 精品国偷自产国产一区| 亚洲国产视频直播| 日本高清视频一区二区| 国产精品欧美精品| 国产不卡在线视频| 日韩精品一区二区三区在线观看 | 亚洲欧美日韩电影| 国产精品一区二区不卡| 欧美大片拔萝卜| 日韩和欧美的一区| 欧美午夜精品免费| 一级做a爱片久久| 99精品国产一区二区三区不卡| 欧美亚洲动漫制服丝袜| 亚洲天堂免费在线观看视频| 国产成人亚洲综合a∨猫咪| 91美女片黄在线观看91美女| 日韩一区中文字幕| 成人午夜av电影|