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

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

?? usb.c

?? 有關ARM開發板上的IXP400網絡驅動程序的源碼以。
?? C
?? 第 1 頁 / 共 5 頁
字號:
/** * @file usb.c * * @author Intel Corporation * @date 30-OCT-2001 * @brief This file contains the implementation of the IXP400 USB Driver * * Design Notes: *  - DMA handling logic (not actual code) is embedded but #ifdef-ed *    on IX_USB_DMA in the code; remove before releasing *  - don't use the start-of-frame event as this puts the device into *    a non-functioning state * *  * @par * IXP400 SW Release version 2.1 *  * -- Copyright Notice -- *  * @par * Copyright (c) 2001-2005, Intel Corporation. * All rights reserved. *  * @par * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. Neither the name of the Intel Corporation nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. *  *  * @par * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *  *  * @par * -- End of Copyright Notice -- *//** * @addtogroup API * @{ */#include "IxOsal.h"#include "IxFeatureCtrl.h"#ifdef __HWEMU__#define PRIVATE#endif /* __HWEMU__ */#include "usb.h"#include "usbdeviceparam.h"#include "usbprivate.h"#include "usbprivatedata.h"#include "usbmacros.h"static USBDeviceContext *ixUSBGlobalContext;static BOOL ixUSBBulkNakThrottling = FALSE;#include "usb_util.c"#ifndef IX_USB_HAS_DUMMY_MBLK/* Pool definitions */#define NUM_MBLKS (2000)#define BLK_SIZE  (2048)UINT32 ixUSBPoolCounter = NUM_MBLKS;/* Treshold under which the pool is considered depleted * The treshold number represents the number of packets still available * for CONTROL transactions; BULK OUT transactions will be replied with * NAK packets until more buffers become available * * NOTE: this is used only if the device is initialized  * with the ENABLE_BULK_NAK_THROTTLE flag; ignored otherwise, in which case * pool depletion will result in an ASSERT(0) fatal error */#define POOL_THRESHOLD (10) static  IX_OSAL_MBUF_POOL *pNetPool;#endif /* IX_USB_HAS_DUMMY_MBLK *//**  Endpoint interrupt sources on UISR0 and UISR1 */static int UDCEPInterrupt[] ={/* UISR0 */    /* EP_0 */  (0x1 << 0),    /* EP_1 */  (0x1 << 1),    /* EP_2 */  (0x1 << 2),    /* EP_3 */  (0x1 << 3),    /* EP_4 */  (0x1 << 4),    /* EP_5 */  (0x1 << 5),    /* EP_6 */  (0x1 << 6),    /* EP_7 */  (0x1 << 7),/* UISR1 */    /* EP_8 */  (0x1 << 0),    /* EP_9 */  (0x1 << 1),    /* EP_10 */ (0x1 << 2),    /* EP_11 */ (0x1 << 3),    /* EP_12 */ (0x1 << 4),    /* EP_13 */ (0x1 << 5),    /* EP_14 */ (0x1 << 6),    /* EP_15 */ (0x1 << 7)};static EPInterruptHandler EPInterruptHandlerTable[] ={    /* EP_0 */ ixUSBEP0InterruptHandler,    /* EP_1 */ ixUSBINInterruptHandler,    /* EP_2 */ ixUSBOUTInterruptHandler,    /* EP_3 */ ixUSBINInterruptHandler,    /* EP_4 */ ixUSBOUTInterruptHandler,    /* EP_5 */ ixUSBINInterruptHandler,    /* EP_6 */ ixUSBINInterruptHandler,    /* EP_7 */ ixUSBOUTInterruptHandler,    /* EP_8 */ ixUSBINInterruptHandler,    /* EP_9 */ ixUSBOUTInterruptHandler,    /* EP_10 */ ixUSBINInterruptHandler,    /* EP_11 */ ixUSBINInterruptHandler,    /* EP_12 */ ixUSBOUTInterruptHandler,    /* EP_13 */ ixUSBINInterruptHandler,    /* EP_14 */ ixUSBOUTInterruptHandler,    /* EP_15 */ ixUSBINInterruptHandler,};static int epPriority[]= {0, 5, 10, 15, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14};static IxOsalMutex usbBufferSubmitMutex[16];static UINT32 dataSendAllowed = TRUE;static UINT32 cwInitiated = 0, cwCompleted = 0, cwFailed = 0;static UINT32 crInitiated = 0, crCompleted = 0, crFailed = 0;static UINT32 cnInitiated = 0, cnFailed = 0;/** * Interrupt control registers' virtual addresses */static UINT32 ixUSBIrqCtrlRegVirtAddr = 0;PUBLIC IX_STATUSixUSBDriverInit(USBDevice *device){    USBDeviceContext *context;    UDCRegisters *registers;    UINT32 epIndex;    static UINT32 lastDeviceIndex = 0;    if (device == NULL)    {        return IX_FAIL;    }    /* If not IXP42X A0 stepping, proceed to check for existence of usb component */     if ((IX_FEATURE_CTRL_SILICON_TYPE_A0 !=         (ixFeatureCtrlProductIdRead() & IX_FEATURE_CTRL_SILICON_STEPPING_MASK))        || (IX_FEATURE_CTRL_DEVICE_TYPE_IXP42X != ixFeatureCtrlDeviceRead ()))    {        /* Check for USB device being present before proceeding*/        if (ixFeatureCtrlComponentCheck(IX_FEATURECTRL_USB)==	        IX_FEATURE_CTRL_COMPONENT_DISABLED)        {	    IX_USB_TRACE("Warning: the USB component you specified "                "does not exist\n", 0, 0, 0, 0, 0, 0);        }    }        context                = CONTEXT(device);    ixUSBGlobalContext     = context;    ixUSBBulkNakThrottling = ((device->flags & ENABLE_BULK_NAK_THROTTLE) != 0);    /* check redundant init */    if (context->checkPattern == USB_DEVICE_CONTEXT_CHECK_PATTERN)    {        RETURN_REDUNDANT(device);    }        /* Compile-time assert size of context                      */    /* This will give a "duplicate case" error if not satisfied */    /* If so, change your USBDevice::deviceContext size to what */    /* sizeof(USBDeviceContext) reports - or more               */    IX_USB_CT_ASSERT(sizeof(device->deviceContext) >= sizeof(USBDeviceContext));        /* I/O map UDC base address */    device->baseIOAddress = (UINT32) IX_OSAL_MEM_MAP(IX_OSAL_IXP400_USB_PHYS_BASE, IX_OSAL_IXP400_USB_MAP_SIZE);        if (device->baseIOAddress == 0)    {        ixOsalLog (IX_OSAL_LOG_LVL_FATAL,		   IX_OSAL_LOG_DEV_STDERR,		   "USB: cannot map controller I/O address 0x%08X",                    IX_OSAL_IXP400_USB_PHYS_BASE, 0, 0, 0, 0, 0);            return IX_FAIL;    }        /* I/O map Interrupt Control Register base address */    ixUSBIrqCtrlRegVirtAddr = (UINT32) IX_OSAL_MEM_MAP(IX_OSAL_IXP400_INTC_PHYS_BASE, 4);    if (ixUSBIrqCtrlRegVirtAddr == 0)    {        ixOsalLog (IX_OSAL_LOG_LVL_FATAL,                   IX_OSAL_LOG_DEV_STDERR,                   "USB: cannot map interrupt controller I/O address 0x%08X",                   IX_OSAL_IXP400_INTC_PHYS_BASE, 0, 0, 0, 0, 0);      return IX_FAIL;    }    /* init USBDeviceContext structure */    ixOsalMemSet(context, 0, sizeof(USBDeviceContext));    /* add a check pattern to verify the context later */    context->checkPattern = USB_DEVICE_CONTEXT_CHECK_PATTERN;    /* device is initially disabled */    context->enabled = FALSE;    /* set UDC registers to base I/O address */    registers          = (UDCRegisters *)(device->baseIOAddress);    context->registers = registers;        /* init EP0ControlData structure */    context->ep0ControlData.currentToken = UNKNOWN_TOKEN;    context->ep0ControlData.transferType = UNKNOWN_TRANSFER;    context->ep0ControlData.state        = IDLE;    /* init event processing */    context->eventProcessor.eventCallback   = ixUSBNullEventCallback;    context->eventProcessor.eventMap        = USB_DEVICE_EVENTS;    context->eventProcessor.setupCallback   = ixUSBNullSetupCallback;    context->eventProcessor.receiveCallback = ixUSBNullReceiveCallback;    /* init per-endpoint EPStatusData structures */    ixOsalMemSet(context->epStatusData, 0, sizeof(context->epStatusData));    /* Populate EPStatusData structures */    for (epIndex = ENDPOINT_0 ; epIndex < NUM_ENDPOINTS ; epIndex++)    {        EPStatusData *epData = &context->epStatusData[epIndex];        /* link parent USBDevice */        epData->device = device;        /* set endpoint properties */        epData->endpointNumber   = epIndex;        epData->direction        = EP_DIRECTION(EPDescriptorTable[epIndex]);        epData->type             = EP_TYPE(EPDescriptorTable[epIndex]);        epData->transferAllowed = TRUE;#ifdef IX_USB_DMA        epData->dmaEnabled     = EPDMAEnabledTable[epIndex];#endif /* IX_USB_DMA */        /* setup buffer queue */        ixUSBQueueInit(epData);        if (epData->type == USB_CONTROL)        {            epData->fifoSize = CONTROL_FIFO_SIZE;        }        else if (epData->type == USB_BULK)        {            epData->fifoSize = BULK_FIFO_SIZE;#ifdef IX_USB_DMA            epData->dmaSize  = BULK_DMA_SIZE;#endif /* IX_USB_DMA */        }        else if (epData->type == USB_ISOCHRONOUS)        {            epData->fifoSize = ISOCHRONOUS_FIFO_SIZE;#ifdef IX_USB_DMA            epData->dmaSize  = ISOCHRONOUS_DMA_SIZE;#endif /* IX_USB_DMA */        }        else if (epData->type == USB_INTERRUPT)        {            epData->fifoSize = INTERRUPT_FIFO_SIZE;        }        /*         * Warning: this switch block applies         * only to the standard IXP4XX UDC         * endpoint configuration.         * Changes in EPDescriptorTable[] should         * be reflected here.         */        switch (epIndex)        {            case ENDPOINT_0:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_CONTROL | USB_IN_OUT));                epData->UDCCS = &registers->UDCCS0;                epData->UDDR  = &registers->UDDR0;                epData->UBCR  = NULL;                break;            case ENDPOINT_1:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_BULK | USB_IN));                epData->UDCCS = &registers->UDCCS1;                epData->UDDR  = &registers->UDDR1;                epData->UBCR  = NULL;                break;            case ENDPOINT_2:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_BULK | USB_OUT));                epData->UDCCS = &registers->UDCCS2;                epData->UDDR  = &registers->UDDR2;                epData->UBCR  = &registers->UBCR2;                break;            case ENDPOINT_3:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_ISOCHRONOUS | USB_IN));                epData->UDCCS = &registers->UDCCS3;                epData->UDDR  = &registers->UDDR3;                epData->UBCR  = NULL;                break;            case ENDPOINT_4:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_ISOCHRONOUS | USB_OUT));                epData->UDCCS = &registers->UDCCS4;                epData->UDDR  = &registers->UDDR4;                epData->UBCR  = &registers->UBCR4;                break;            case ENDPOINT_5:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_INTERRUPT | USB_IN));                epData->UDCCS = &registers->UDCCS5;                epData->UDDR  = &registers->UDDR5;                epData->UBCR  = NULL;                break;            case ENDPOINT_6:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_BULK | USB_IN));                epData->UDCCS = &registers->UDCCS6;                epData->UDDR  = &registers->UDDR6;                epData->UBCR  = NULL;                break;            case ENDPOINT_7:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_BULK | USB_OUT));                epData->UDCCS = &registers->UDCCS7;                epData->UDDR  = &registers->UDDR7;                epData->UBCR  = &registers->UBCR7;                break;            case ENDPOINT_8:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_ISOCHRONOUS | USB_IN));                epData->UDCCS = &registers->UDCCS8;                epData->UDDR  = &registers->UDDR8;                epData->UBCR  = NULL;                break;            case ENDPOINT_9:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_ISOCHRONOUS | USB_OUT));                epData->UDCCS = &registers->UDCCS9;                epData->UDDR  = &registers->UDDR9;                epData->UBCR  = &registers->UBCR9;                break;            case ENDPOINT_10:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_INTERRUPT | USB_IN));                epData->UDCCS = &registers->UDCCS10;                epData->UDDR  = &registers->UDDR10;                epData->UBCR  = NULL;                break;            case ENDPOINT_11:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_BULK | USB_IN));                epData->UDCCS = &registers->UDCCS11;                epData->UDDR  = &registers->UDDR11;                epData->UBCR  = NULL;                break;            case ENDPOINT_12:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_BULK | USB_OUT));                epData->UDCCS = &registers->UDCCS12;                epData->UDDR  = &registers->UDDR12;                epData->UBCR  = &registers->UBCR12;                break;            case ENDPOINT_13:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_ISOCHRONOUS | USB_IN));                epData->UDCCS = &registers->UDCCS13;                epData->UDDR  = &registers->UDDR13;                epData->UBCR  = NULL;                break;            case ENDPOINT_14:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_ISOCHRONOUS | USB_OUT));                epData->UDCCS = &registers->UDCCS14;                epData->UDDR  = &registers->UDDR14;                epData->UBCR  = &registers->UBCR14;                break;            case ENDPOINT_15:                IX_USB_ASSERT((epData->direction | epData->type) == (USB_INTERRUPT | USB_IN));                epData->UDCCS = &registers->UDCCS15;                epData->UDDR  = &registers->UDDR15;                epData->UBCR  = NULL;                break;            default:                /* it shouldn't get here */                IX_USB_ASSERT(FALSE);        }        IX_USB_VERBOSE_INIT_TRACE("epData[%p:%d]: %d\t%d\t%d\n",(UINT32)epData, epIndex, epData->type, epData->direction, epData->fifoSize, 0);    }    /* clear UDC interrupts */    /* clear endpoints 0..7 */    REG_SET(&registers->USIR0, UDC_CLEAR_ALL_INT);    /* clear endpoint 8..15 */    REG_SET(&registers->USIR1, UDC_CLEAR_ALL_INT);    /* clear RESET, RESUME, SUSPEND */    REG_SET(&registers->UDCCR, (UDC_UDCCR_RESIR | UDC_UDCCR_SUSIR | UDC_UDCCR_RSTIR));        /* clear Start-Of-Frame */    REG_SET(&registers->UFNHR, UDC_UFNHR_SIR);    /* set UDC interrupt masks (all the events but SOF are enabled) */    /* enable suspend/resume interrupt by zeroing the mask bit */    REG_SET(&registers->UDCCR, ((REG_GET(&registers->UDCCR)) & ~UDC_UDCCR_SRM));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美伊人久久久久久久久影院| 国产精品高潮久久久久无| 亚洲不卡av一区二区三区| 91在线视频播放地址| 国产精品欧美一区二区三区| 豆国产96在线|亚洲| 日本一区二区三区在线观看| 国产成人av一区| 成人免费视频在线观看| 色哟哟一区二区在线观看| 亚洲乱码国产乱码精品精小说| 99久久精品国产导航| 粉嫩久久99精品久久久久久夜 | 另类成人小视频在线| 精品久久国产97色综合| 国产精品原创巨作av| 国产精品视频yy9299一区| www.综合网.com| 亚洲高清视频在线| 日韩三级电影网址| 国产.精品.日韩.另类.中文.在线.播放| 国产欧美日本一区二区三区| 色综合久久中文综合久久牛| 性欧美大战久久久久久久久| 欧美精品一区二区久久婷婷| 波多野结衣精品在线| 亚洲综合激情另类小说区| 日韩免费视频一区| 成人小视频在线| 视频一区免费在线观看| 久久久精品欧美丰满| 91豆麻精品91久久久久久| 日韩高清不卡一区二区三区| 日本一区二区三区高清不卡| 欧美伊人久久大香线蕉综合69 | 高清beeg欧美| 亚洲永久精品国产| 久久精品一区四区| 欧美日韩在线播放一区| 国产精品亚洲成人| 亚洲成人av一区二区三区| 日本一区二区三级电影在线观看| 欧美日韩在线播放三区| 99视频一区二区| 精品一区二区三区蜜桃| 亚洲一卡二卡三卡四卡无卡久久| 亚洲精品一区二区三区99| 91福利在线播放| 99久久久精品免费观看国产蜜| 美脚の诱脚舐め脚责91 | 成人性生交大片免费看中文| 图片区小说区区亚洲影院| 国产性天天综合网| 91精品国产欧美一区二区| 99久久精品费精品国产一区二区| 精品一区二区三区久久| 午夜精品福利一区二区三区av| 国产精品热久久久久夜色精品三区 | 91性感美女视频| 国产在线观看免费一区| 亚洲国产精品久久人人爱| 国产片一区二区三区| 日韩欧美精品三级| 欧美精品v日韩精品v韩国精品v| 成人av在线一区二区| 麻豆传媒一区二区三区| 午夜一区二区三区在线观看| 亚洲日本在线观看| 国产精品国产三级国产三级人妇 | 国产欧美一区二区精品忘忧草| 欧美精品一二三| 日本大香伊一区二区三区| 北岛玲一区二区三区四区| 韩国午夜理伦三级不卡影院| 免费在线观看日韩欧美| 亚洲成人在线免费| 亚洲午夜久久久久久久久电影院| 亚洲人妖av一区二区| 欧美国产成人精品| 中文字幕精品综合| 中文字幕av一区二区三区高| 欧美激情在线免费观看| 中文字幕二三区不卡| 国产精品乱人伦中文| 国产欧美日韩卡一| 中文字幕字幕中文在线中不卡视频| 国产精品久久久久婷婷| 亚洲婷婷国产精品电影人久久| 亚洲人成人一区二区在线观看| 亚洲欧美综合色| 亚洲宅男天堂在线观看无病毒| 亚洲午夜在线电影| 视频在线观看国产精品| 久久99久久久欧美国产| 国产麻豆欧美日韩一区| av一区二区三区在线| 日本二三区不卡| 制服丝袜亚洲播放| 26uuu精品一区二区在线观看| 国产性做久久久久久| ...av二区三区久久精品| 亚洲国产视频直播| 久久成人麻豆午夜电影| 国产成人激情av| 在线一区二区视频| 日韩一区二区中文字幕| 国产午夜亚洲精品午夜鲁丝片 | 亚洲自拍偷拍麻豆| 日本欧美肥老太交大片| 精品一区二区三区免费视频| 成人h精品动漫一区二区三区| 日本韩国精品在线| 日韩欧美在线影院| 欧美国产精品v| 亚洲尤物视频在线| 韩国欧美一区二区| jizz一区二区| 欧美日韩一区在线观看| 精品国产a毛片| 亚洲最新视频在线播放| 久久99国产乱子伦精品免费| av电影在线观看完整版一区二区| 欧美色精品在线视频| 久久日一线二线三线suv| 亚洲精品视频免费观看| 免费看日韩精品| 99re热视频精品| 欧美va亚洲va国产综合| 国内精品第一页| 色老汉av一区二区三区| 日韩三级.com| 亚洲精品ww久久久久久p站| 美腿丝袜亚洲一区| 91亚洲永久精品| 国产亚洲综合在线| 视频在线观看91| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩午夜在线观看视频| 亚洲精品中文字幕乱码三区 | 国产成人av电影在线| 欧美日韩精品一区二区三区蜜桃 | 日韩精品一区二区三区中文不卡 | 精品美女被调教视频大全网站| 亚洲视频在线观看三级| 国产乱码精品一品二品| 欧美视频日韩视频| 日韩一区在线播放| 国产福利一区二区| 欧美v亚洲v综合ⅴ国产v| 一二三四社区欧美黄| 成人黄页在线观看| 久久午夜免费电影| 久久精品国内一区二区三区| 欧美日韩成人综合天天影院 | 欧美性色黄大片| 亚洲精品免费一二三区| 春色校园综合激情亚洲| 欧美精品一区二区在线播放| 美女一区二区视频| 91精品国产综合久久福利软件| 亚洲激情五月婷婷| 色综合色综合色综合色综合色综合| 国产人妖乱国产精品人妖| 国产精品一区久久久久| xf在线a精品一区二区视频网站| 蜜臂av日日欢夜夜爽一区| 日韩一级欧美一级| 免费成人美女在线观看.| 欧美乱妇15p| 日韩激情一二三区| 欧美一区二区三区免费大片 | 久久精品水蜜桃av综合天堂| 一本大道av伊人久久综合| 国产精品综合网| 久久综合色一综合色88| 精品一区二区久久| 精品国产sm最大网站| 国产在线播精品第三| 欧美精品一区二区精品网| 国产真实乱偷精品视频免| 国产亚洲欧美日韩俺去了| 国产a级毛片一区| 中文字幕佐山爱一区二区免费| 在线看一区二区| 日本中文字幕一区二区视频 | 亚洲免费电影在线| 日本国产一区二区| 日本色综合中文字幕| 精品国产一二三区| 国产经典欧美精品| 亚洲青青青在线视频| 欧美日韩视频在线第一区| 麻豆专区一区二区三区四区五区| 亚洲精品一区二区三区福利 | 国产精品中文有码| 亚洲色欲色欲www| 91麻豆精品国产无毒不卡在线观看| 麻豆国产欧美一区二区三区| 久久精品一二三| 在线影院国内精品|