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

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

?? usbehcdrhemulation.c

?? vxWorks下USB2.0中的EHCI的HCD源碼,極具有參考價值
?? C
?? 第 1 頁 / 共 5 頁
字號:
    if (pURB->uTransferLength >= 7 + (uPortBytes * 2))
        {
        pURB->uTransferLength = 7 + (uPortBytes * 2);
        }

    /* Copy the data */

    OS_MEMCPY(pURB->pTransferBuffer, pBuffer, pURB->uTransferLength);

    /* Update the status */

    pURB->nStatus = USBHST_SUCCESS;

    /* Free memory allocated for the buffer */

    OS_FREE(pBuffer);

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

    return Status;

    }
    /* End of usbEhcdRhGetHubDescriptor() */

/***************************************************************************
*
* usbEhcdRhGetPortStatus - get the status of the port
*
* This routine gets the status of the port.
*
* RETURNS: USBHST_SUCCESS if the URB is submitted successfully.
* USBHST_INVALID_PARAMETER if the parameters are not valid.
*
* ERRNO:
*   None.
*/

USBHST_STATUS usbEhcdRhGetPortStatus
    (
    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 status of the hub port */

    UINT32 uPortStatus = 0;

    /*
     * This holds the port status which is available in the
     * root hub port status buffer
     */

    UINT32 uPortStatusAvailable = 0;

    OS_LOG_MESSAGE_LOW(EHCD,"usbEhcdRhGetPortStatus - 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,"usbEhcdRhGetPortStatus - \
                                           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 the members are valid */

    if (pSetup->wIndex >
                pHCDData->RHData.uNumDownstreamPorts)
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhGetPortStatus - \
                                           Invalid port index\n",0,0,0,0);

        pURB->nStatus = USBHST_INVALID_PARAMETER;
        return USBHST_INVALID_PARAMETER;
        }

    /*
     * The hub's port status contains 4 bytes of information, out of which
     * the hub's port status is reported in the byte offsets 0 to 1
     * and the hub's port status change in the byte offsets 2 to 3
     */

    /* Update the port status change bytes - Start */
    /*
     * Following is the interpretation of the 16 bits of port status change
     * Bit 5-15 Reserved
     * Bit 4 - Reset change
     * Bit 3 - Overcurrent indicator Change
     * Bit 2 - Suspend Change
     * Bit 1 - Port Enable/Disable change
     * Bit 0 - Connect status change
     */

    /* Update the overcurrent change bit */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                       (pSetup->wIndex)- 1,
                                       OVER_CURRENT_CHANGE);
    uPortStatus <<= 1;

    /*
     * Update the suspend change bit
     * (ie) 0 since there is no suspend-change indication in EHCI
     */

    uPortStatus |= 0;
    uPortStatus <<= 1;

    /* Store enable/disable change bit */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  PORT_ENABLE_CHANGE);
    uPortStatus <<= 1;

    /* Store connect status change */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  CONNECT_STATUS_CHANGE);
    uPortStatus <<= 1;

    /* Update the port status change bytes - End */
    /* Update the port status bytes - Start */
    /*
     * Following is the interpretation of the 16 bits of port status
     * Bit 13-15 Reserved
     * Bit 12- Port indicator displays software controller colour
     * Bit 11- Port is in Port Test Mode
     * Bit 10- High speed device is attached
     * Bit 9 - Low speed device is attached
     * Bit 8 - Port is powered on
     * Bit 5-7 Reserved
     * Bit 4 - Reset signalling asserted
     * Bit 3 - An overcurrent condition exists on the port
     * Bit 2 - Port is suspended
     * Bit 1 - Port is enabled
     * Bit 0 - Device is present on the port
     */
    /* fill next 3 bits with 0 */

    uPortStatus <<= 3;

    /* Check whether the port indicator field is set and update the status */

    if (0 != USB_EHCD_GET_FIELD_PORT(pHCDData,
                                 (pSetup->wIndex)- 1,
                                  PORT_INDICATOR_CONTROL))
        {
        uPortStatus |= 0x01;
        }
    uPortStatus <<= 1;

    /* Check whether the port test mode field is set and update the status */

    if (0 != USB_EHCD_GET_FIELD_PORT(pHCDData,
                                (pSetup->wIndex)- 1,
                                 PORT_TEST_CONTROL))
        {
        uPortStatus |= 0x01;
        }

    uPortStatus <<= 1;

    /* Check whether a high speed device is attached and update the status */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  PORT_ENABLED_DISABLED);
    uPortStatus <<= 1;

    /* This cannot be updated as low/ full speed is not supported in Root hub */

    if (USBHST_LOW_SPEED == USB_EHCD_GET_FIELD_PORT(pHCDData,
                                                (pSetup->wIndex)- 1,
                                                LINE_STATUS))
        {
        uPortStatus |= 0x01;
        }

    uPortStatus <<= 1;

    /* Check whether the port is powered on and update the status */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  PORT_POWER);
    uPortStatus <<= 1;

    /* Bits 5 to 7 are reserved */

    uPortStatus <<= 3;

    /* Read the bit indicating whether a reset is asserted. Update the status */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  PORT_RESET);
    uPortStatus <<= 1;

    /*
     * Check whether a over current is detected
     * in the port and update the status
     */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  OVER_CURRENT_ACTIVE);
    uPortStatus <<= 1;

    /* Check whether the port is suspended and update the status */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  SUSPEND);
    uPortStatus <<= 1;

    /* Check whether the port is enabled and update the status */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  PORT_ENABLED_DISABLED);
    uPortStatus <<= 1;

    /* Check whether a device is connected and update the status */

    uPortStatus |= USB_EHCD_GET_FIELD_PORT(pHCDData,
                                  (pSetup->wIndex)- 1,
                                  CURRENT_CONNECT_STATUS);

    /* Update the port status bytes - End */

    /* Copy the data which is available in the port status */

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

    /* Swap the data to LE format */

    uPortStatusAvailable = OS_UINT32_LE_TO_CPU(uPortStatusAvailable);

    /* Update the port status value */

    uPortStatus |= uPortStatusAvailable;

    /* Swap the data to CPU format */

    uPortStatus = OS_UINT32_CPU_TO_LE(uPortStatus);

    /* Copy the port status */

    OS_MEMCPY(pURB->pTransferBuffer, &uPortStatus, 4);

    /* Update the status of URB */

    pURB->nStatus = USBHST_SUCCESS;

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

    return Status;

    }
    /* End of usbEhcdRhGetPortStatus() */

/***************************************************************************
*
* usbEhcdRhSetPortFeature - set the features of the port
*
* This routine sets the features of the port.
*
* RETURNS: USBHST_SUCCESS if the URB is submitted successfully.
* USBHST_INVALID_PARAMETER if the parameters are not valid.
*
* ERRNO:
*   None.
*/

USBHST_STATUS usbEhcdRhSetPortFeature
    (
    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 count value */

    UINT32 uCount = 0;

	/* WindView Instrumentation */
	USB_HCD_LOG_EVENT(
		USB_EHCI_WV_PORT_ROUTE,
		"usbEhcdRhSetPortFeature() starts",
		USB_EHCD_WV_FILTER);

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

    /* Check the validity of the parameters */

    if (NULL == pHCDData ||
        NULL == pURB ||
        NULL == pURB->pTransferSpecificData)
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhSetPortFeature - \
                                           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;

    /* Switch on the feature to be selected */

    switch(pSetup->wValue)
        {
        case USB_EHCD_RH_PORT_RESET:/* If port reset */
            {
            /* Attempt port reset only if HC is not halted */
            if(0 == USB_EHCD_GET_FIELD(pHCDData,
                                   USBSTS,
                                   HCHALTED))
                {
                /*
                 * If a low speed device is detected, change the
                 * ownership of the port to the companion host controller
                 */

                if (USBHST_LOW_SPEED == USB_EHCD_GET_FIELD_PORT(pHCDData,
                                                            (pSetup->wIndex)- 1,
                                                            LINE_STATUS))
                    {
					/* WindView Instrumentation */
					USB_HCD_LOG_EVENT(
						USB_EHCI_WV_PORT_ROUTE, 
						"SetPortFeature : Low speed device detected",
						USB_EHCD_WV_FILTER);

                    OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhSetPortFeature - \
                                                Port being handed over\n",0,0,0,0);

                    /*
                     * Release ownership of the port
                     * to the companion controller
                     */

                    USB_EHCD_SET_BIT_PORT(pHCDData,
                                      ((pSetup->wIndex) -1),
                                      PORT_OWNER);
                    }

                /* A high/Full speed device is attached */
                else
                    {
                    /*
                     * At this point, it is not known whether
                     * the connected device is a full/ high speed device.
                     * After giving a port reset, if the port is enabled,
                     * then a high speed device is connected. If it is
                     * not enabled, then a full speed device is
                     * connected.
                     */
                    /*
                     * Give a settling time for the mechanical
                     * and electrical connections
                     * Check whether there is any performance issue with this
                     * wait.
                     */

                    OS_DELAY_MS(100);

                    /* Disable the port */

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

                    /* Initiate a reset to the port */

       

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久人人做人人爽| 欧美最新大片在线看 | 国产精品中文字幕一区二区三区| 亚洲人成7777| 伊人夜夜躁av伊人久久| 最新欧美精品一区二区三区| 国产精品久久久久三级| 国产精品国模大尺度视频| 国产精品看片你懂得| 国产精品美女www爽爽爽| 国产亚洲一区二区三区在线观看 | 亚洲精品视频在线观看网站| 亚洲免费观看视频| 亚洲精品日韩综合观看成人91| 亚洲精品乱码久久久久久久久| 亚洲欧美国产毛片在线| 亚洲一区二区三区四区在线| 日韩国产精品久久久久久亚洲| 免费人成网站在线观看欧美高清| 蜜桃在线一区二区三区| 国产做a爰片久久毛片| 99综合影院在线| 欧美伊人久久大香线蕉综合69 | 成人免费视频视频| 色诱视频网站一区| 欧美一区二区三区免费在线看| 欧美xxxx老人做受| 成人欧美一区二区三区视频网页| 午夜视频一区二区| 狠狠色狠狠色综合系列| 99国产精品久久久| 欧美一级精品在线| 国产精品不卡一区| 天使萌一区二区三区免费观看| 国产乱妇无码大片在线观看| 日本韩国视频一区二区| 欧美一卡二卡三卡| 亚洲素人一区二区| 麻豆免费看一区二区三区| 99久久精品国产导航| 51精品久久久久久久蜜臀| 国产无一区二区| 热久久久久久久| 91在线精品一区二区| 日韩欧美黄色影院| 亚洲制服丝袜在线| 国产不卡在线一区| 精品日韩99亚洲| 亚洲第四色夜色| 成人国产亚洲欧美成人综合网| 91精品国产手机| 亚洲精选在线视频| 成人高清av在线| 久久亚洲综合色| 婷婷丁香激情综合| 日本黄色一区二区| 亚洲人精品午夜| 成人av在线观| 国产无人区一区二区三区| 久久精品国产久精国产| 欧美午夜在线一二页| 综合久久久久久久| 国产99精品国产| 欧美精品一区二区精品网| 日韩成人一级片| 欧美高清视频一二三区| 亚洲一卡二卡三卡四卡五卡| 99久久777色| 中文字幕一区二区三区在线观看 | 久久福利资源站| 欧美一级午夜免费电影| 婷婷六月综合亚洲| 欧美高清视频不卡网| 亚洲一区二区中文在线| 欧洲亚洲精品在线| 亚洲自拍都市欧美小说| 色婷婷亚洲精品| 亚洲精品v日韩精品| 色播五月激情综合网| 一区二区三区中文在线| 一本在线高清不卡dvd| 亚洲黄色免费网站| 欧美日韩一卡二卡| 日韩专区一卡二卡| 日韩欧美一区二区在线视频| 蜜臀av国产精品久久久久| 精品福利一二区| 成人激情综合网站| 亚洲免费大片在线观看| 欧美日韩亚洲不卡| 美国精品在线观看| 中文字幕精品在线不卡| 色婷婷av一区二区三区软件| 亚洲成人免费电影| 日韩久久精品一区| 成人精品视频一区二区三区 | 日韩国产一区二| 日韩欧美高清一区| 福利电影一区二区| 亚洲精选免费视频| 精品少妇一区二区三区在线视频| 国产一区二区电影| 亚洲人成精品久久久久久| 欧美一区二区三区在线观看视频| 久久精品99国产精品| 国产精品国产a| 欧美理论片在线| 高清不卡在线观看av| 亚洲综合色自拍一区| 精品国一区二区三区| 91麻豆免费观看| 美女视频一区二区三区| 国产精品久久一级| 3d成人h动漫网站入口| 成人中文字幕电影| 日本伊人色综合网| 综合色天天鬼久久鬼色| 精品久久一区二区| 欧美日韩中文一区| 成人性生交大片免费看在线播放| 亚洲高清中文字幕| 国产精品情趣视频| 久久嫩草精品久久久精品| 欧洲一区二区三区免费视频| 丰满白嫩尤物一区二区| 青青草精品视频| 伊人色综合久久天天| 久久九九久久九九| 日韩一区二区三区四区五区六区| 91原创在线视频| 国产iv一区二区三区| 美女脱光内衣内裤视频久久影院| 亚洲最大的成人av| 国产精品久久久久久久久免费樱桃| 91精品国产综合久久精品性色| 色香蕉成人二区免费| 国产黄色91视频| 国产一区二区三区不卡在线观看| 三级不卡在线观看| 亚洲一区二区三区四区在线 | 美女国产一区二区三区| 亚洲综合激情另类小说区| 中文字幕一区二区三区不卡| 欧美精品一区二区在线播放| 欧美老女人第四色| 欧美亚洲国产一区二区三区| 91免费看视频| 99久久久国产精品| yourporn久久国产精品| 丁香婷婷综合网| 成人高清视频在线观看| 成人激情文学综合网| 99久久精品免费看国产免费软件| 国产精品白丝jk白祙喷水网站| 国产一区二区三区日韩| 精品一区二区三区香蕉蜜桃 | 久久精品一区蜜桃臀影院| 久久日一线二线三线suv| 久久综合成人精品亚洲另类欧美| 日韩片之四级片| 久久综合视频网| 国产偷国产偷亚洲高清人白洁| 中文欧美字幕免费| 国产视频911| 亚洲色图欧洲色图| 亚洲国产精品久久不卡毛片| 亚洲1区2区3区4区| 久久99热99| 国产成人高清在线| 91性感美女视频| 欧美写真视频网站| 精品国产伦理网| 日本一区二区三区dvd视频在线| 国产精品色噜噜| 亚洲综合在线免费观看| 日韩成人午夜精品| 成人深夜福利app| 在线观看日韩国产| 精品美女一区二区三区| 国产精品久久看| 亚洲成人免费av| 国产91精品入口| 欧美精品日韩综合在线| 亚洲精品一区二区精华| 一区二区三区欧美激情| 毛片不卡一区二区| 91丨porny丨户外露出| 欧美片网站yy| 亚洲国产精品精华液ab| 五月天婷婷综合| 成人h动漫精品| 日韩欧美国产午夜精品| 亚洲视频一区在线观看| 久久99九九99精品| 色婷婷久久一区二区三区麻豆| 精品捆绑美女sm三区| 一区免费观看视频| 精品在线视频一区| 欧美在线高清视频| 国产精品嫩草影院com|