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

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

?? usbd-bi.c

?? cypress usb芯片驅動程序,該程序實現了cypress63700的3個驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*                                                 * linux/drivers/usbd/usbd-bi.c - USB Bus Interface Driver * * Copyright (c) 2000, 2001, 2002 Lineo * Copyright (c) 2001 Hewlett Packard * * By:  *      Stuart Lynne <sl@lineo.com>,  *      Tom Rushworth <tbr@lineo.com>,  *      Bruce Balden <balden@lineo.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */#include <linux/config.h>#include <linux/module.h>#include <linux/init.h>#include <linux/kernel.h>#include <linux/list.h>#include <linux/smp_lock.h>#include <linux/ctype.h>#include <linux/timer.h>#include <linux/string.h>#include <linux/netdevice.h>#include <linux/proc_fs.h>#include <asm/uaccess.h>#ifdef CONFIG_PM#include <linux/pm.h>#endif#include "../usbd.h"#include "../usbd-debug.h"#include "../usbd-func.h"#include "../usbd-bus.h"#include "../usbd-inline.h"#include "usbd-bi.h"#include "../../cy7c67200_300_common.h"#include "../../cy7c67200_300_otg.h"#include "cy7c67200_300_pcd.h"/* Module Parameters ************************************************************************* *///static char *dbg = NULL;static char *dbg = "init=0:intr=0:tick=0:usbe=0:rx=0:tx=0:dma=0:setup=0:ep0=0:udc=0:stall=0:pm=0:pur=0";MODULE_PARM(dbg, "s");/* Debug switches (module parameter "dbg=...") *********************************************** */int      dbgflg_usbdbi_init;int      dbgflg_usbdbi_intr;int      dbgflg_usbdbi_tick;int      dbgflg_usbdbi_usbe;int      dbgflg_usbdbi_rx;int      dbgflg_usbdbi_tx;int      dbgflg_usbdbi_dma_flg;int      dbgflg_usbdbi_setup;int      dbgflg_usbdbi_ep0;int      dbgflg_usbdbi_udc;int      dbgflg_usbdbi_stall;int      dbgflg_usbdbi_pm;int      dbgflg_usbdbi_pur;static debug_option dbg_table[] = {    {&dbgflg_usbdbi_init,NULL,"init","initialization and termination"},    {&dbgflg_usbdbi_intr,NULL,"intr","interrupt handling"},    {&dbgflg_usbdbi_tick,NULL,"tick","interrupt status monitoring on clock tick"},    {&dbgflg_usbdbi_usbe,NULL,"usbe","USB events"},    {&dbgflg_usbdbi_rx,NULL,"rx","USB RX (host->device) handling"},    {&dbgflg_usbdbi_tx,NULL,"tx","USB TX (device->host) handling"},    {&dbgflg_usbdbi_dma_flg,NULL,"dma","DMA handling"},    {&dbgflg_usbdbi_setup,NULL,"setup","Setup packet handling"},    {&dbgflg_usbdbi_ep0,NULL,"ep0","End Point 0 packet handling"},    {&dbgflg_usbdbi_udc,NULL,"udc","USB Device"},    {&dbgflg_usbdbi_stall,NULL,"stall","Testing"},    {&dbgflg_usbdbi_pm,NULL,"pm","Power Management"},    {&dbgflg_usbdbi_pur,NULL,"pur","USB cable Pullup Resistor"},    {NULL,NULL,NULL,NULL}};/* globals */int have_cable_irq;/* ticker */ int ticker_terminating;int ticker_timer_set;/** * kickoff_thread - start management thread */void ticker_kickoff(void);/** * killoff_thread - stop management thread */void ticker_killoff(void);#ifdef CONFIG_PMstruct pm_dev      *pm_dev;                 // power management#endif/* Bus Interface Callback Functions ********************************************************** *//** * bi_cancel_urb - cancel sending an urb * @urb: data urb to cancel * * Used by the USB Device Core to cancel an urb. */int bi_cancel_urb(struct usbd_urb *urb){    return 0;}/** * bi_endpoint_halted - check if endpoint halted * @device: device * @endpoint: endpoint to check * * Used by the USB Device Core to check endpoint halt status. */                                        int bi_endpoint_halted(struct usb_device_instance *device, int endpoint){    return 0;}/** * bi_device_feature - handle set/clear feature requests * @device: device * @endpoint: endpoint to check * @flag: set or clear * * Used by the USB Device Core to check endpoint halt status. */int bi_device_feature(struct usb_device_instance *device, int endpoint, int flag){    if (flag) {        dbg_ep0(1,"stalling endpoint");        // XXX logical to physical?        udc_stall_ep(endpoint, device);        return 0;     }    dbg_ep0(1,"reseting endpoint %d", endpoint);    udc_reset_ep(endpoint, device);    return 0;}/*  * bi_disable_endpoints - disable udc and all endpoints */static void bi_disable_endpoints(struct usb_device_instance *device){    int i;    if (device && device->bus && device->bus->endpoint_array) {        for (i = 0; i < udc_max_endpoints(); i++) {            struct usb_endpoint_instance *endpoint;            if ((endpoint = device->bus->endpoint_array + i)) {                usbd_flush_ep(endpoint);            }        }    }}/* bi_config - commission bus interface driver */static int bi_config(struct usb_device_instance *device){    int i;    struct usb_interface_descriptor *interface;    struct usb_endpoint_descriptor *endpoint_descriptor;    int found_tx = 0;    int found_rx = 0;    dbg_init(1,"checking config: config: %d interface: %d alternate: %d",             device->configuration, device->interface, device->alternate);    bi_disable_endpoints(device);    // audit configuration for compatibility    if (!(interface = usbd_device_interface_descriptor(device,                     0, device->configuration, device->interface, device->alternate)))     {        dbg_init(0,"cannot fetch interface descriptor c:%d i:%d a:%d",                 device->configuration, device->interface, device->alternate);        return -EINVAL;    }    dbg_init(2, "endpoints: %d", interface->bNumEndpoints);        // iterate across all endpoints for this configuration and verify they are valid     for (i = 0; i < interface->bNumEndpoints; i++) {        int transfersize;        int physical_endpoint;        int logical_endpoint;        //dbg_init(0, "fetching endpoint %d", i);        if (!(endpoint_descriptor = usbd_device_endpoint_descriptor_index(device, 0,                 device->configuration, device->interface, device->alternate, i)))         {            dbg_init(0, "cannot fetch endpoint descriptor: %d", i);            continue;        }        // XXX check this        transfersize = usbd_device_endpoint_transfersize(device, 0,                 device->configuration, device->interface, device->alternate, i);        logical_endpoint = endpoint_descriptor->bEndpointAddress;                if (!(physical_endpoint = udc_check_ep(logical_endpoint,                                                endpoint_descriptor->wMaxPacketSize,                                               device))) {            dbg_init(2, "endpoint[%d]: l: %02x p: %02x transferSize: %d packetSize: %02x INVALID",                     i, logical_endpoint, physical_endpoint,                    transfersize, endpoint_descriptor->wMaxPacketSize);            dbg_init(2, "invalid endpoint: %d %d", logical_endpoint, physical_endpoint);            return -EINVAL;        }        else {            struct usb_endpoint_instance *endpoint = device->bus->endpoint_array + physical_endpoint;            dbg_init(2, "endpoint[%d]: l: %02x p: %02x transferSize: %d packetSize: %02x FOUND",                      i, logical_endpoint, physical_endpoint,                     transfersize, endpoint_descriptor->wMaxPacketSize);            dbg_init(2,"epd->bEndpointAddress=%d",                     endpoint_descriptor->bEndpointAddress);            endpoint->endpoint_address = endpoint_descriptor->bEndpointAddress;            if (endpoint_descriptor->wMaxPacketSize > 64) {                dbg_init(0,"incompatible with endpoint size: %x",                         endpoint_descriptor->wMaxPacketSize);                return -EINVAL;            }            if (endpoint_descriptor->bEndpointAddress & IN) {                found_tx++;                endpoint->tx_attributes = endpoint_descriptor->bmAttributes;                endpoint->tx_transferSize = transfersize&0xfff;                endpoint->tx_packetSize = endpoint_descriptor->wMaxPacketSize;                endpoint->last = 0;                endpoint->tx_urb = NULL;            }            else {                found_rx++;                endpoint->rcv_attributes = endpoint_descriptor->bmAttributes;                endpoint->rcv_transferSize = transfersize&0xfff;                endpoint->rcv_packetSize = endpoint_descriptor->wMaxPacketSize;                endpoint->rcv_urb = NULL;            }        }    }    if (device->status == USBD_OK) {        for (i = 1; i < device->bus->driver->max_endpoints; i++) {            struct usb_endpoint_instance *endpoint = device->bus->endpoint_array + i;            // udc_setup_ep(device, i, endpoint->endpoint_address?  endpoint : NULL);            udc_setup_ep(device, i, endpoint);        }    }    return 0;}/** * bi_device_event - handle generic bus event * @device: device pointer * @event: interrupt event * * Called by usb core layer to inform bus of an event. */int bi_device_event(struct usb_device_instance *device, usb_device_event_t event, int data) {    sie_info * sie_data;    cy_priv_t * cy_priv;    otg_t * otg;        sie_data = (sie_info *) device->bus->privdata;    cy_priv = (cy_priv_t *) sie_data->cy_priv;    otg = (otg_t *) cy_priv->otg;    //printk(KERN_DEBUG "bi_device_event: event: %d\n", event);    if (!device) {        return 0;    }    switch (event) {    case DEVICE_UNKNOWN:        break;    case DEVICE_INIT:        break;    case DEVICE_CREATE:         // XXX should this stuff be in DEVICE_INIT?        bi_config(device);        // enable udc, enable interrupts, enable connect        udc_enable(device);        udc_all_interrupts(device);        udc_connect();         break;    case DEVICE_HUB_CONFIGURED:        break;    case DEVICE_RESET:        device->address = 0;        udc_set_address(device->address, device);        udc_reset_ep(0, device);        udc_all_interrupts(device); // XXX        break;    case DEVICE_ADDRESS_ASSIGNED:        udc_set_address(device->address, device);        device->status = USBD_OK;        break;    case DEVICE_CONFIGURED:        bi_config(device);        break;    case DEVICE_DE_CONFIGURED:        udc_reset_ep(1, device);                udc_reset_ep(2, device);                udc_reset_ep(3, device);        break;                      case DEVICE_SET_INTERFACE:        bi_config(device);        break;    case DEVICE_SET_FEATURE:        break;    case DEVICE_CLEAR_FEATURE:        break;    case DEVICE_BUS_INACTIVE:        // disable suspend interrupt        udc_suspended_interrupts(device);        // XXX check on linkup and sl11        // if we are no longer connected then force a reset        if (!udc_connected()) {            usbd_device_event_irq(device, DEVICE_RESET, 0);        }        break;    case DEVICE_BUS_ACTIVITY:        // enable suspend interrupt        udc_all_interrupts(device);        break;    case DEVICE_POWER_INTERRUPTION:        break;    case DEVICE_HUB_RESET:        break;    case DEVICE_DESTROY:        udc_disconnect();        bi_disable_endpoints(device);        udc_disable_interrupts(device);        udc_disable();        break;    case DEVICE_BUS_REQUEST:        otg->b_bus_req = TRUE;        update_otg_state(otg);        break;            case DEVICE_BUS_RELEASE:        otg->b_bus_req = FALSE;        update_otg_state(otg);        break;            case DEVICE_RCV_URB_RECYCLED:        udc_rcv_urb_recycled();        break;    case DEVICE_ACCEPT_HNP:        otg->b_hnp_en = TRUE;        update_otg_state(otg);    break;        case DEVICE_REQUEST_SRP:        //otg->srp_start_flag = TRUE;        otg->b_bus_req = TRUE;        otg->b_se0_srp = TRUE;        update_otg_state(otg);    break;    case DEVICE_FUNCTION_PRIVATE:        break;    }        return 0;}/** * bi_send_urb - start transmit * @urb: */int bi_send_urb(struct usbd_urb *urb){    unsigned long flags;    dbg_tx(4, "urb: %p", urb);    local_irq_save(flags);    if (urb && urb->endpoint && !urb->endpoint->tx_urb) {        dbg_tx(2, "urb: %p endpoint: %x", urb, urb->endpoint->endpoint_address);        usbd_tx_complete_irq(urb->endpoint, 0);        udc_start_in_irq(urb->endpoint, urb->device);    }    local_irq_restore(flags);        // Shouldn't need to make this atomic, all we need is a change indicator    urb->device->usbd_rxtx_timestamp = jiffies;    return 0;}#ifdef CONFIG_PMstatic int bi_pm_event(struct pm_dev *pm_dev, pm_request_t request, void *unused);#endifstruct usb_bus_operations bi_ops = {    send_urb: bi_send_urb,    cancel_urb: bi_cancel_urb,    endpoint_halted: bi_endpoint_halted,    device_feature: bi_device_feature,    device_event: bi_device_event,};struct usb_bus_driver bi_driver = {    name: "",    max_endpoints: 0,    ops: &bi_ops,    this_module: THIS_MODULE,};struct usb_bus_driver * bi_retrieve_bus_driver(){    return(&bi_driver);}/* Bus Interface Received Data *************************************************************** */struct usb_device_instance *device_array[MAX_DEVICES];/* Bus Interface Support Functions *********************************************************** *//** * udc_cable_event - called from cradle interrupt handler */void udc_cable_event(void)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲香肠在线观看| 欧美aaa在线| 蜜臀久久99精品久久久久宅男| 色综合久久久久久久| 欧美精品一区在线观看| 午夜电影一区二区三区| 制服丝袜成人动漫| 亚洲国产精品天堂| 日本一区二区三区电影| 高清不卡在线观看av| 久久丝袜美腿综合| 国产成人午夜精品影院观看视频| 久久久久亚洲蜜桃| 国产不卡在线一区| 久久疯狂做爰流白浆xx| 国产午夜精品美女毛片视频| 99久久精品久久久久久清纯| 日韩理论片中文av| 色婷婷久久一区二区三区麻豆| 久久精品国产**网站演员| 亚洲一区二区三区精品在线| 8v天堂国产在线一区二区| 91蜜桃在线免费视频| 亚洲成人久久影院| 国产午夜精品一区二区三区视频| 日韩精品在线一区| 福利一区福利二区| 国产麻豆欧美日韩一区| 亚洲国产激情av| 欧美色综合网站| 美女免费视频一区| 麻豆久久久久久久| 青青草伊人久久| 日韩精品成人一区二区在线| 国产亚洲va综合人人澡精品| 久久五月婷婷丁香社区| 日韩精品一区二区三区四区视频| 欧美一级午夜免费电影| 不卡视频在线看| 日韩国产欧美一区二区三区| 欧美激情综合在线| 国产欧美日韩精品a在线观看| 久久午夜国产精品| 欧美国产精品中文字幕| 一区免费观看视频| 日韩一区二区免费高清| 97精品久久久久中文字幕| 91蝌蚪国产九色| 在线视频你懂得一区| 国产一区999| 丁香五精品蜜臀久久久久99网站 | 九一九一国产精品| 日韩码欧中文字| 亚洲免费观看高清| 久久久国产精品午夜一区ai换脸| 久久青草欧美一区二区三区| 国产人成亚洲第一网站在线播放 | 555夜色666亚洲国产免| 91精品国产综合久久久蜜臀粉嫩 | 日韩小视频在线观看专区| 精品三级在线观看| 欧美军同video69gay| 99久久免费精品| 欧美网站一区二区| 欧美一级日韩不卡播放免费| 久久亚洲精品国产精品紫薇| 久久精品人人做| 亚洲视频一区在线| 青娱乐精品在线视频| 国产成人一级电影| 在线亚洲人成电影网站色www| 风间由美性色一区二区三区| 一本大道av伊人久久综合| 欧美日韩久久不卡| 欧美浪妇xxxx高跟鞋交| 国产亚洲欧美色| 亚洲综合无码一区二区| 国产一区中文字幕| 色94色欧美sute亚洲线路一久| 5月丁香婷婷综合| 国产精品嫩草影院com| 国产精品日日摸夜夜摸av| 亚洲一二三四久久| 国产伦理精品不卡| 欧美综合一区二区| 国产婷婷色一区二区三区在线| 亚洲观看高清完整版在线观看 | 亚洲蜜臀av乱码久久精品| 日韩高清一区在线| av一区二区不卡| 在线观看成人小视频| 精品国产髙清在线看国产毛片| 国产精品第五页| 亚洲精品一二三| 一区二区三区视频在线看| 亚洲精品免费看| 国内精品视频一区二区三区八戒| 国产美女精品在线| 欧美日韩国产三级| 亚洲欧洲综合另类| 国产大陆a不卡| 日韩午夜在线观看视频| 亚洲精品乱码久久久久久黑人| 国产精一品亚洲二区在线视频| 国产馆精品极品| 在线播放中文一区| 一区二区三区国产精华| 成人免费不卡视频| 欧美综合一区二区| 自拍偷在线精品自拍偷无码专区| 国产在线精品一区在线观看麻豆| 欧美日韩精品一区二区在线播放| 亚洲视频免费在线| 国产成人精品免费在线| 久久免费的精品国产v∧| 美女在线视频一区| 在线综合亚洲欧美在线视频| 一区二区三区四区不卡在线| 成人性视频网站| 国产日韩欧美一区二区三区乱码 | 久久精品国产99久久6| 欧美日本乱大交xxxxx| 亚洲第一av色| 在线免费观看日韩欧美| 亚洲欧美成人一区二区三区| 99久精品国产| 亚洲乱码中文字幕综合| 色综合中文字幕国产| 欧美日韩一区久久| 国产香蕉久久精品综合网| 国精产品一区一区三区mba视频| 欧美一级视频精品观看| 捆绑变态av一区二区三区| 欧美电影免费观看高清完整版在线 | 欧美色男人天堂| 一区二区三区在线观看欧美 | 欧美日韩一级大片网址| 亚洲精品国产视频| 91麻豆自制传媒国产之光| 亚洲婷婷国产精品电影人久久| av在线这里只有精品| 亚洲欧美日韩国产综合| 色素色在线综合| 亚洲一区成人在线| 欧美妇女性影城| 麻豆91精品视频| 久久久精品天堂| 成人国产在线观看| 亚洲精品成人悠悠色影视| 欧美性猛交xxxx乱大交退制版| 亚洲国产中文字幕| 日韩亚洲欧美成人一区| 国产精品自拍一区| 中文字幕亚洲精品在线观看| 在线影视一区二区三区| 天天综合天天综合色| 精品国产乱码久久久久久影片| 国产精品一二一区| 亚洲日本中文字幕区| 欧美精品自拍偷拍动漫精品| 看电视剧不卡顿的网站| 国产精品久线在线观看| 欧美私人免费视频| 日本在线播放一区二区三区| 久久中文娱乐网| 一本大道综合伊人精品热热| 天堂成人免费av电影一区| 精品美女一区二区| av在线不卡免费看| 日韩国产欧美在线视频| 欧美韩国一区二区| 欧美亚洲禁片免费| 国产福利一区二区三区视频在线| 18欧美亚洲精品| 欧美一级一区二区| 97精品久久久午夜一区二区三区| 日本不卡的三区四区五区| 国产日韩精品一区二区三区在线| 91官网在线观看| 国产美女娇喘av呻吟久久| 一区二区视频免费在线观看| 日韩欧美黄色影院| 91免费视频网| 国产精品伊人色| 亚洲国产精品尤物yw在线观看| 国产亚洲成av人在线观看导航| 欧美亚洲综合另类| 国产精一品亚洲二区在线视频| 亚洲第一狼人社区| 国产精品久久久久一区| 精品乱人伦小说| 欧美在线免费观看视频| 国产露脸91国语对白| 石原莉奈一区二区三区在线观看| 国产欧美日本一区视频| 日韩三级中文字幕| 欧美三级韩国三级日本一级| 成人午夜大片免费观看| 另类小说综合欧美亚洲| 亚洲图片欧美视频|