⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbdmisc.c

📁 usb2 driver for vxwokrs
💻 C
字号:
/* usbdMisc.c - user specific information *//* Copyright 2004 Wind River Systems, Inc.    This software includes software licensed to Wind River Systems, Inc.   by Wipro, Ltd. Wind River licensees may use this software according     to the terms of their Wind River license agreement(s) applicable to    this software.*//*Modification history--------------------01a,23jun03,amn Changing the code to WRS standards*/                             /*DESCRIPTIONThis File contains the various interfaces required for obtaining user specific information from USBD.INCLUDE FILES: usb2/usbdMisc.h*//*INTERNAL ******************************************************************************* * Filename         : usbdMisc.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 File contains the various interfaces required *                    for obtaining user specific information from USBD. * * ******************************************************************************//********************************* Include Files ******************************/#include "usb2/usbdMisc.h"/***************************************************************************** usbdBusCntGet - obtain the number of USB's attached to the host** This function is called by the Integration testing tool to obtain the* number of USB's attached to the host.** RETURNS: N/A** ERRNO: N/A**/UINT16 usbdBusCntGet (void)    {    /* Loop index */    UINT8 uIndex;    /* To store the bus count */    UINT16 uNumberOfBus = 0;    /* Debug message */    OS_LOG_MESSAGE_LOW(USBD,                       "Entering usbdBusCountGet() Function.\n",                       0,                       0,                       0,                       0);    /*     * To count the number of USB's on the system, sum the number of USB's     * present on each host controller driver     */    /* Scan through all the HCD's */    for (uIndex = 0; uIndex < USBD_MAX_HCD_NUM; uIndex++)        {        if (NULL != gHCDriverList[uIndex].createPipe)            {            /* Sum up the number of buses */            uNumberOfBus += gHCDriverList[uIndex].uNumberOfBus;            }    }/* End of for (uIndex ....) */    /* Debug message */    OS_LOG_MESSAGE_LOW(USBD,			"Exiting usbdBusCountGet() Function.\n",			0,			0,			0,			0);    /* Return the total number of buses */    return uNumberOfBus;    }/* End of function usbdBusCntGet() *//***************************************************************************** usbdRootNodeIDGet - obtain node id of the root hub on a Host Controller** This function is called by the Integration testing tool to* obtain the node id of the root hub on a Host Controller.** RETURNS: USBHST_SUCCESS, USBHST_INVALID_PARAMETER,* USBHST_FAILURE if unsuccessful** ERRNO: N/A*/USBHST_STATUS usbdRootNodeIDGet    (    UINT16   uBusIndex,    PUINT32 phRootHub    )    {	     /* Debug message */    OS_LOG_MESSAGE_LOW(USBD,                       "Entering usbdRootNodeIdeGet() Function.\n",                       0,                       0,                       0,                       0);	     /* Obtain the handle to the root hub */    usbdGenerateDeviceHandle(phRootHub, uBusIndex, 1);    /* Debug message */    OS_LOG_MESSAGE_LOW(USBD,                       "Exiting usbdRootNodeIdeGet() Function.\n",                       0,                        0,                       0,                       0);    return USBHST_SUCCESS;    } /***************************************************************************** usbdFrameWindowGet - obtain Frame Window and current frame number from HCD** This function is called by the Integration testing tool to* obtain the Frame Window and current frame number from HCD.** RETURNS: USBHST_SUCCESS, USBHST_INVALID_PARAMETER,* USBHST_FAILURE if unsuccessful** ERRNO: N/A*/USBHST_STATUS usbdFrameWindowGet    (    UINT32  hDevice,    PUINT16 pFrameWindow    )    {    /* Debug message */    OS_LOG_MESSAGE_LOW(USBD,                       "Entering usbdFrameWindow() Function.\n",                       0,                       0,                       0,                       0);    /* Validate the pointer */    if (NULL == pFrameWindow)        {        /* Debug message */        OS_LOG_MESSAGE_HIGH(USBD,                            "usbdFrameWindow() Failed. Invalid parameter\n",                            0,                            0,                            0,                            0);                              return USBHST_INVALID_PARAMETER;         }       *pFrameWindow = 1024;    /* Debug message */    OS_LOG_MESSAGE_LOW(USBD,                       "Exiting usbdFrameWindow() Function.\n",                       0,                       0,                       0,                       0);    return USBHST_SUCCESS;    }/* End of function usbdFrameWindowGet() *//************************ End of usbdMisc.c *************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -