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

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

?? usbehcdrhemulation.c

?? vxWorks下USB2.0中的EHCI的HCD源碼,極具有參考價值
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* usbEhcdRhEmulation.c - USB EHCI HCD Roothub Emulation */

/* Copyright 2003 Wind River Systems, Inc. */

/*
Modification history
--------------------
01d,23Jul03,Incorporated the changes after testing on MIPS.
01c,12Jul03,gpd updated status to USBHST_SUCCESS in setconfig request.
01b,26jun03,psp changing the code to WRS standards.
01a,25apr03,ram written.
*/

/*
DESCRIPTION

This contains functions which handle the requests to the Root hub

INCLUDE FILES:  usb2/usbOsal.h usb2/usbHst.h usb2/usbEhcdDataStructures.h
                usb2/usbEhcdRhEmulation.h usb2/usbEhcdHal.h usb2/usbEhcdUtil.h
                usb2/usbHcdInstr.h
*/


/*
INTERNAL
 *******************************************************************************
 * Filename         : usbEhcdRhEmulate.c
 *
 * Copyright        :
 *
 * THE COPYRIGHT IN THE CONTENTS OF THIS SOFTWARE VEST WITH WIPRO
 * LIMITED A COMPANY INCORPORATED UNDER THE LAWS OF INDIA AND HAVING
 * ITS REGISTERED OFFICE AT DODDAKANNELLI SARJAPUR ROAD  BANGALORE
 * 560 035. DISTRIBUTION OR COPYING OF THIS SOFTWARE BY
 * ANY INDIVIDUAL OR ENTITY OTHER THAN THE ADDRESSEE IS STRICTLY
 * PROHIBITED AND MAY INCUR LEGAL LIABILITY. IF YOU ARE NOT THE
 * ADDRESSEE PLEASE NOTIFY US IMMEDIATELY BY PHONE OR BY RETURN EMAIL.
 * THE ADDRESSEE IS ADVISED TO MAINTAIN THE PROPRIETARY INTERESTS OF
 * THIS COPYRIGHT AS PER APPLICABLE LAWS.
 *
 *
 * Description      :  This contains functions which handle the requests to
 *                     the Root hub.
 *
 *
 ******************************************************************************/
#include "usb2/usbOsal.h"
#include "usb2/usbHst.h"
#include "usb2/usbEhcdDataStructures.h"
#include "usb2/usbEhcdRhEmulation.h"
#include "usb2/usbEhcdHal.h"
#include "usb2/usbEhcdUtil.h"
#include "usb2/usbHcdInstr.h"

/* globals */

/* Device Descriptor value for the Root hub */
UCHAR gRHDeviceDescriptor[] = {
                                 0x12,        /* bLength */
                                 0x01,        /* Device Descriptor type */
                                 0x00, 0x02,  /* bcdUSB - USB 2.0 */
                                 0x09,        /* Hub DeviceClass */
                                 0x00,        /* bDeviceSubClass */
                                 0x01,        /* bDeviceProtocol High Speed single TT support*/
                                 0x40,        /* Max packet size is 64 */
                                 0x00, 0x00,  /* idVendor */
                                 0x00, 0x00,  /* idProduct */
                                 0x00, 0x00,  /* bcdDevice */
                                 0x00,        /* iManufacturer */
                                 0x00,        /* iProduct */
                                 0x00,        /* iSerialNumber */
                                 0x01         /* 1 configuration */
                                };

/*
 * Descriptor structure returned on a request for
 * Configuration descriptor for the Root hub.
 * This includes the Configuration descriptor, interface descriptor and
 * the endpoint descriptor
 */

UCHAR gRHConfigDescriptor[] = {
                                /* Configuration descriptor */
                                0x09,        /* bLength */
                                0x02,        /*
                                              * Configuration descriptor
                                              * type
                                              */
                                0x19, 0x00,  /* wTotalLength */
                                0x01,        /* 1 interface */
                                0x01,		 /* bConfigurationValue */
                                0x00,        /* iConfiguration */
                                0xE0,        /* bmAttributes */
                                0x00,        /* bMaxPower */

                                /* Interface Descriptor */
                                0x09,        /* bLength */
                                0x04,        /*
                                              * Interface Descriptor
                                              * type
                                              */
                                0x00,        /* bInterfaceNumber */
                                0x00,        /* bAlternateSetting */
                                0x01,        /* bNumEndpoints */
                                0x09,        /* bInterfaceClass */
                                0x00,        /* bInterfaceSubClass */
                                0x00,        /* bInterfaceProtocol */
                                0x00,        /* iInterface */

                                /* Endpoint Descriptor */
                                0x07,        /* bLength */
                                0x05,        /*
                                              * Endpoint Descriptor
                                              * Type
                                              */
                                0x81,         /* bEndpointAddress */
                                0x03,         /* bmAttributes */
                                0x08,   0x00, /* wMaxPacketSize */
                                0x0C          /* bInterval - 255 ms*/
                              };


/* Function to process a control transfer request */

USBHST_STATUS
usbEhcdRhProcessControlRequest(pUSB_EHCD_DATA pHCDData,
        	           	     pUSBHST_URB	pURB);

/* Function to process an interrupt transfer request */
USBHST_STATUS
usbEhcdRhProcessInterruptRequest(pUSB_EHCD_DATA pHCDData,
        	           	       pUSBHST_URB	pURB);

/* Function to process a standard request */
USBHST_STATUS
usbEhcdRhProcessStandardRequest(pUSB_EHCD_DATA pHCDData,
        	           	      pUSBHST_URB	pURB);

/* Function to process a class specific request */
USBHST_STATUS
usbEhcdRhProcessClassSpecificRequest(pUSB_EHCD_DATA pHCDData,
        	           	           pUSBHST_URB	pURB);

USBHST_STATUS usbEhcdRhClearPortFeature(pUSB_EHCD_DATA   pHCDData,
                                             pUSBHST_URB	 pURB);

USBHST_STATUS usbEhcdRhGetHubDescriptor(pUSB_EHCD_DATA   pHCDData,
                                            pUSBHST_URB	 pURB);

USBHST_STATUS usbEhcdRhGetPortStatus(pUSB_EHCD_DATA   pHCDData,
                                         pUSBHST_URB  pURB);

USBHST_STATUS usbEhcdRhSetPortFeature(pUSB_EHCD_DATA   pHCDData,
                                          pUSBHST_URB  pURB);


/***************************************************************************
*
* usbEhcdRhCreatePipe - creates a pipe specific to an endpoint.
*
* This routine creates a pipe specific to an endpoint.
*
* RETURNS: USBHST_SUCCESS if the pipe was created successfully.
* USBHST_INVALID_PARAMETER if the parameters are not valid.
* USBHST_INSUFFICIENT_MEMORY if the memory allocation for the pipe failed.
*
* ERRNO:
*   None.
*/

USBHST_STATUS usbEhcdRhCreatePipe
    (
    pUSB_EHCD_DATA pHCDData,           /* Ptr to HCD block           */
    UINT8   uDeviceAddress,            /* Device Address             */
    UINT8   uDeviceSpeed,              /* Device Speed               */
    UCHAR  *pEndpointDescriptor,       /* Ptr to EndPoint Descriptor */
    UINT32 *puPipeHandle               /* Ptr to pipe handle         */
    )
    {

    /* To hold the status of the function call */

    USBHST_STATUS Status = USBHST_FAILURE;

    /* Pointer to the Endpoint Descriptor */

    pUSBHST_ENDPOINT_DESCRIPTOR pEndpointDesc = NULL;

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

    /* Check the validity of the parameters */

    if ((NULL == pHCDData) ||
        (USB_EHCD_MAX_DEVICE_ADDRESS < uDeviceAddress) ||
        (NULL == pEndpointDescriptor) ||
        (NULL == puPipeHandle) ||
        (USBHST_HIGH_SPEED != uDeviceSpeed))
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhCreatePipe - parameters are not valid\n",0,0,0,0);
        return USBHST_INVALID_PARAMETER;
        }

    /* Extract the endpoint descriptor */

    pEndpointDesc = (pUSBHST_ENDPOINT_DESCRIPTOR)pEndpointDescriptor;

    /* Switch based on the endpoint type */

    switch(pEndpointDesc->bmAttributes & USB_EHCD_ENDPOINT_TYPE_MASK)
        {
    	case USBHST_CONTROL_TRANSFER:/* Control endpoint */
    	    {
    	    /* If the endpoint number is not 0, it is an error */

    	    if (0 != (pEndpointDesc->bEndpointAddress &
                USB_EHCD_ENDPOINT_NUMBER_MASK))
                {
                return USBHST_INVALID_REQUEST;
                }
            else
                {

                /* Allocate memory for the control endpoint */

                pHCDData->RHData.pControlPipe =
                                (pUSB_EHCD_PIPE)OS_MALLOC(sizeof(USB_EHCD_PIPE));

                /* Check if memory allocation is successful */

                if (NULL == pHCDData->RHData.pControlPipe)
                    {
                    OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhCreatePipe - Memory not\
                                         allocated for control pipe\n",0,0,0,0);

                    return USBHST_INSUFFICIENT_MEMORY;
                    }

                /* Initialize the memory allocated */

                USB_EHCD_PIPE_INITIALIZE(pHCDData->RHData.pControlPipe);

                /* Populate the fields of the control pipe - Start */

                /* Copy the endpoint address */

                pHCDData->RHData.pControlPipe->uEndpointAddress =
                                            pEndpointDesc->bEndpointAddress;

                /* Copy the address */

                pHCDData->RHData.pControlPipe->uAddress = uDeviceAddress;

                /* Update the speed */

                pHCDData->RHData.pControlPipe->uSpeed = USBHST_HIGH_SPEED;

                /* Update the endpoint type */

                pHCDData->RHData.pControlPipe->uEndpointType =
                                                USBHST_CONTROL_TRANSFER;

                /* Populate the fields of the control pipe - End */

                /* Update the pipe handle information */

                *(puPipeHandle) = (UINT32)pHCDData->RHData.pControlPipe;

                Status = USBHST_SUCCESS;
                }
    		break;
    	    }
    	case USBHST_INTERRUPT_TRANSFER:/* Interrupt endpoint */
    	    {

            /* Allocate memory for the interrupt endpoint */

            pHCDData->RHData.pInterruptPipe =
                            (pUSB_EHCD_PIPE)OS_MALLOC(sizeof(USB_EHCD_PIPE));

            /* Check if memory allocation is successful */

            if (NULL == pHCDData->RHData.pInterruptPipe)
                {
                OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRhCreatePipe - Memory not\
                                     allocated for interrupt pipe\n",0,0,0,0);

                return USBHST_INSUFFICIENT_MEMORY;
                }

            /* Initialize the memory allocated */

            USB_EHCD_PIPE_INITIALIZE(pHCDData->RHData.pInterruptPipe);

            /* Populate the fields of the interrupt pipe - Start */

            /* Copy the endpoint address */

            pHCDData->RHData.pInterruptPipe->uEndpointAddress =
                                        pEndpointDesc->bEndpointAddress;

            /* Copy the address */

            pHCDData->RHData.pInterruptPipe->uAddress = uDeviceAddress;

            /* Update the speed */

            pHCDData->RHData.pInterruptPipe->uSpeed = USBHST_HIGH_SPEED;

            /* Update the endpoint type */

            pHCDData->RHData.pInterruptPipe->uEndpointType =
                                            USBHST_INTERRUPT_TRANSFER;

            /* Populate the fields of the interrupt pipe - End */

            /* Update the pipe handle information */

            *(puPipeHandle) = (UINT32)pHCDData->RHData.pInterruptPipe;

    		Status = USBHST_SUCCESS;
    		break;
    	    }
    	default:
    	    {
    	    Status = USBHST_INVALID_REQUEST;
    	    }
    }
    /* End of switch */

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

    return Status;

    }
    /* End of function usbEhcdRhCreatePipe() */

/***************************************************************************
*
* usbEhcdRHDeletePipe - deltes a pipe specific to an endpoint.
*
* This routine deletes a pipe specific to an endpoint.
*
* RETURNS: USBHST_SUCCESS if the pipe was deleted successfully.
* USBHST_INVALID_PARAMETER if the parameters are not valid.
*
* ERRNO:
*   None.
*/

USBHST_STATUS usbEhcdRHDeletePipe
    (
    pUSB_EHCD_DATA pHCDData,           /* Ptr to HCD block             */
    UINT32         uPipeHandle         /* Pipe Handle Identifier       */
    )
    {
    /* To hold the pointer to the pipe */

    pUSB_EHCD_PIPE  pHCDPipe = NULL;

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

    /* Check the validity of the parameters */

    if ((NULL == pHCDData) ||
        (0 == uPipeHandle))
        {
        OS_LOG_MESSAGE_HIGH(EHCD,"usbEhcdRHDeletePipe - Parameters not valid\n",0,0,0,0);
        return USBHST_INVALID_PARAMETER;
        }

    /* Extract the USB_EHCD_PIPE pointer */

    pHCDPipe = (pUSB_EHCD_PIPE)uPipeHandle;

    /* Check if it is a control pipe delete request */

    if (pHCDPipe == pHCDData->RHData.pControlPipe)
        {
        OS_FREE(pHCDData->RHData.pControlPipe);
        pHCDData->RHData.pControlPipe = NULL;
        }

    /* Check if it is an interrupt pipe delete request */

    else if (pHCDPipe == pHCDData->RHData.pInterruptPipe)
        {

        /* Pointer to the request information */

        pUSB_EHCD_REQUEST_INFO pRequestInfo = NULL;

        /* Pointer to the temporary request information */

        pUSB_EHCD_REQUEST_INFO pTempRequestInfo = NULL;

        /* Exclusively access the list */

        OS_WAIT_FOR_EVENT(pHCDData->RequestSynchEventID, OS_WAIT_INFINITE);

        /* Set the flag indicating that the pipe is deleted */

        pHCDPipe->PipeDeletedFlag = TRUE;

        /* Release the exclusive access */

        OS_RELEASE_EVENT(pHCDData->RequestSynchEventID);

        /* Remove the requests queued for the endpoint */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情视频一区二区三区欧美| 色先锋资源久久综合| 岛国一区二区在线观看| 欧美午夜精品久久久久久超碰| 日韩精品一区二区三区蜜臀 | 一本到高清视频免费精品| 欧美一区二区三区四区久久| 亚洲欧美激情在线| 国产精品一线二线三线| 7777精品伊人久久久大香线蕉| 国产精品久久国产精麻豆99网站| 精品一区二区国语对白| 欧美精品在线观看播放| 亚洲欧美日韩精品久久久久| 国产乱色国产精品免费视频| 91精品视频网| 亚洲午夜精品17c| k8久久久一区二区三区| 久久久一区二区三区捆绑**| 免费观看在线色综合| 欧美日韩和欧美的一区二区| 亚洲欧美日韩一区二区| 99久久精品国产毛片| 国产三级三级三级精品8ⅰ区| 日本va欧美va欧美va精品| 欧美视频在线观看一区二区| 亚洲理论在线观看| jlzzjlzz亚洲日本少妇| 国产亚洲一区二区三区| 精品亚洲成a人在线观看| 91精品国模一区二区三区| 亚洲综合久久久久| 91久久精品一区二区| 亚洲激情第一区| 欧美亚洲国产一卡| 亚洲二区视频在线| 欧美人伦禁忌dvd放荡欲情| 婷婷激情综合网| 欧美一区二区二区| 精品无人码麻豆乱码1区2区| 久久综合久久鬼色| 粉嫩绯色av一区二区在线观看 | 成人在线一区二区三区| 欧美国产精品一区| 91在线免费播放| 亚洲黄色录像片| 91 com成人网| 久草在线在线精品观看| 精品国产一区二区三区久久久蜜月 | 国产精品嫩草久久久久| 国内精品嫩模私拍在线| 精品久久久久久久久久久久包黑料 | 91精品国产欧美日韩| 午夜日韩在线观看| 欧美一区二区精美| 精品在线观看免费| 国产性做久久久久久| 国产毛片一区二区| 国产精品无人区| 色一区在线观看| 一区二区三区四区乱视频| 色综合久久久久久久久| 亚洲一区欧美一区| 欧美一区二区三区四区在线观看| 奇米777欧美一区二区| 久久色在线视频| 国产一区二区三区久久悠悠色av| 国产日韩av一区| 91视频.com| 日韩精品久久久久久| 精品sm捆绑视频| 91首页免费视频| 亚洲福利视频一区二区| 678五月天丁香亚洲综合网| 国产中文字幕精品| 国产精品福利影院| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 夜夜精品浪潮av一区二区三区| 欧美精品丝袜中出| 国产精品一区在线观看乱码| 日韩一区欧美小说| 欧美精品高清视频| 国精产品一区一区三区mba桃花| 欧美韩国日本综合| 欧美在线|欧美| 另类综合日韩欧美亚洲| 一区二区在线观看视频| 日韩一区二区在线免费观看| 成人免费va视频| 丝袜美腿亚洲综合| 久久精品视频一区二区三区| 日本高清不卡在线观看| 蜜桃av噜噜一区二区三区小说| 国产亚洲一区二区三区四区| 欧美欧美午夜aⅴ在线观看| 国产成人av电影在线| 婷婷综合另类小说色区| 国产午夜精品一区二区三区嫩草| 欧美特级限制片免费在线观看| 国产精品一区免费在线观看| 天堂成人国产精品一区| 国产精品美女久久久久aⅴ国产馆| 91麻豆精品国产自产在线| 成人午夜视频福利| 久久激情五月激情| 亚洲国产精品久久久男人的天堂| 久久精品在线观看| 91精品国模一区二区三区| 成人黄色大片在线观看| 美女视频黄久久| 一区二区三区在线观看国产| 欧美激情中文不卡| 日韩女优av电影在线观看| 91国偷自产一区二区三区成为亚洲经典| 看电影不卡的网站| 日韩av高清在线观看| 一区二区三区四区不卡在线 | 欧美一级日韩不卡播放免费| 91在线视频免费91| 国产suv精品一区二区883| 久久精品国产亚洲高清剧情介绍| 亚洲精品综合在线| 欧美激情中文不卡| 精品久久久久久久久久久久久久久 | 国产在线精品一区二区不卡了| 五月天网站亚洲| 一区二区三区在线视频观看58| 夜夜嗨av一区二区三区中文字幕| 亚洲丝袜美腿综合| 中文字幕一区免费在线观看| 国产精品免费观看视频| 中文字幕av在线一区二区三区| 久久久不卡网国产精品一区| 久久综合成人精品亚洲另类欧美| 日韩欧美的一区二区| 日韩女优制服丝袜电影| 日韩欧美亚洲国产另类| 日韩一级视频免费观看在线| 欧美一区二区三区影视| 日韩精品影音先锋| 日韩一区二区精品在线观看| 国产午夜亚洲精品羞羞网站| 中文字幕不卡在线播放| 最新国产成人在线观看| 亚洲欧美日韩成人高清在线一区| 亚洲色图清纯唯美| 亚洲成av人片一区二区| 青青草国产成人99久久| 国产一本一道久久香蕉| 丁香婷婷深情五月亚洲| fc2成人免费人成在线观看播放| 99精品欧美一区二区三区综合在线| 欧美中文字幕不卡| 日韩午夜在线播放| 国产无一区二区| 亚洲美女在线国产| 偷拍一区二区三区| 国产资源在线一区| 一本久久精品一区二区 | 国产成人精品三级麻豆| 成人国产精品免费观看视频| 99精品热视频| 日韩美女视频在线| 亚洲精品综合在线| 麻豆精品一区二区综合av| 国产不卡视频在线观看| 色欧美88888久久久久久影院| 欧美精品日韩综合在线| 久久久精品2019中文字幕之3| 国产精品黄色在线观看| 日本中文一区二区三区| 成人精品免费视频| 欧美色中文字幕| 日本一区二区三区四区在线视频| 一区二区三区在线视频观看58| 五月激情六月综合| 91免费版在线| 日韩精品在线看片z| 亚洲欧美福利一区二区| 久久国产精品露脸对白| 色国产综合视频| 精品国产免费人成在线观看| 亚洲精品国产无天堂网2021| 精品一区二区三区蜜桃| 在线观看中文字幕不卡| 国产亚洲精品bt天堂精选| 亚洲国产aⅴ成人精品无吗| 懂色av一区二区三区蜜臀| 欧美日韩中文精品| 国产精品的网站| 国产一区二区福利| 欧美福利视频导航| 亚洲欧美日韩国产成人精品影院| 亚洲一区二区三区不卡国产欧美| 蜜臀av一级做a爰片久久| 色欲综合视频天天天| 欧美激情在线观看视频免费| 亚洲电影一级片| 色88888久久久久久影院野外| 久久精品一区二区三区不卡牛牛|