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

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

?? ev44b0_usb.c

?? 該程序是LINUX系統下ev44b0的USB驅動程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*------------------------------------------------------------------------ . ev44b0_usb.c . . This is a USB driver for Philips's PDIUSBD12 single-chip USB device. . . (C) Copyright 2003 . MICETEK International Inc., Shanghai China . Qin Wei <king@micetek.com.cn> . . . 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA . . . author: .  Qin Wei                     ( king@micetek.com.cn ) . History: .  01/14/03  Qin Wei ----------------------------------------------------------------------------*/#include <linux/module.h>#include <linux/types.h>#include <linux/wait.h>#include <linux/fs.h>#include <linux/sched.h>#include <linux/poll.h>#include <linux/miscdevice.h>#include <linux/init.h>#include <linux/compiler.h>#include <linux/interrupt.h>#include <asm/io.h>#include <asm/uaccess.h>#include <asm/irq.h>#include <asm/hardware.h>#include "ev44b0_usb.h"#define EV44B0II_USB_MODULE_NAME    "usb"#define USB_BULK_MAJOR    0x55static const char usb_driver_version[] =	"EV44B0II USB driver v1.0 (2003-01-09) Qinwei, MICETEK Shanghai";#define CONFIG_USBD12_BASE 0x4000000#define verbose 0#define Usb_Base_Address CONFIG_USBD12_BASEstatic char *usb_bulk_id = "ev44b0ii usb"; static volatile char USB_CONNECT_FLAG = 0;#define MAXUSBBUFFERLEN        1024static unsigned char gbuffer[MAXUSBBUFFERLEN];static unsigned char controlbuffer0[64];struct ev44b0ii_usb_priv gusb;//****************************************************************************//// This structure defines the setup packet received from the host via the// control out endpoint.  This sturcture is padded at the end to the maximum// control endpoint transfer size.////****************************************************************************typedef struct{    unsigned char bmRequestType;    unsigned char bRequest;    unsigned short wValue;    unsigned short wIndex;    unsigned short wLength;} ControlTransfer;//****************************************************************************//// The following structure contains the persistent state of the USB interface.////****************************************************************************static struct{    // The currently selected USB configuration.    unsigned long ulConfiguration;    // The buffer of data that is being sent to the control endpoint.    const unsigned char *pucControlIn;    // The number of bytes to be sent to the control endpoint.    unsigned long ulControlInCount;    // The buffer of data that is being received from the control endpoint.    ControlTransfer sControlOut;    // The buffer of data that is being sent to the bulk endpoint.    const unsigned char *pucBulkIn;    // The number of bytes to be sent to the bulk endpoint.    unsigned long ulBulkInCount;    // The buffer of data that is being received from the bulk endpoint.    unsigned char *pucBulkOut;    // The number of bytes still to be read from the bulk endpoint.    unsigned long ulBulkOutCount;    const unsigned char *pucACKIn;    unsigned long ulACKInCount;    unsigned char  *pucCommandOut;    unsigned long ulCommandOutCount;} sUSB;//****************************************************************************//// This is the configuration descriptor for the digital audio player.  See the// USB specification for the definition of this descriptor.////****************************************************************************static const unsigned char ucDeviceDescriptor[] ={    0x12,                               // bLength    0x01,                               // bDescriptorType    0x00, 0x01,                         // bcdUSB    0x00,                               // bDeviceClass    0x00,                               // bDeviceSubClass    0x00,                               // bDeviceProtocol    0x10,                               // bMaxPacketSize0    0x5e, 0x04,                         // idVendor    0x0a, 0x93,                         // idProduct    0x00, 0x01,                         // bcdDevice    0x01,                               // iManufacturer    0x02,                               // iProduct    0x00,                               // iSerial Number    0x01                                // bNumConfigurations};//****************************************************************************//// This is the configuration descriptor for the digital audio player.  See the// USB specification for the definition of this descriptor.////****************************************************************************static const unsigned char ucConfigurationDescriptor[] ={    //    // The configuration descriptor structure.    //    0x09,                               // bLength    0x02,                               // bDescriptorType    0x20,                               // wTotalLength    0x00,                               // bCorrection    0x01,                               // bNumInterfaces    0x01,                               // bConfigurationValue    0x00,                               // iConfiguration    0x40,                               // bmAttributes    0x00,                               // MaxPower    //    // The interface descriptor structure.    //    0x09,                               // bLength    0x04,                               // bDescriptorType    0x00,                               // bInterfaceNumber    0x00,                               // bAlternateSetting    0x02,                               // bNumEndpoints    0x00,                               // bInterfaceClass    0x00,                               // bInterfaceSubClass    0x00,                               // bInterfaceProtocol    0x00,                               // iInterface    //    // The endpoint descriptor structure.    //    0x07,                               // bLength    0x05,                               // bDescriptorType    0x82,                               // bEndpointAddress    0x02,                               // bmAttributes    0x40, 0x00,                         // wMaxPacketSize    0x00,                               // bInterval    //    // The endpoint descriptor structure.    //    0x07,                               // bLength    0x05,                               // bDescriptorType    0x02,                               // bEndpointAddress    0x02,                               // bmAttributes    0x40, 0x00,                         // wMaxPacketSize    0x00                                // bInterval};//****************************************************************************//// String descriptor 0 for the digital audio player.  This defines the// languages supported by the string descriptors.  See the USB specification// for the definition of this descriptor.////****************************************************************************static const unsigned char ucString0[] ={    0x04,                               // bLength    0x03,                               // bDescriptorType    0x09, 0x04                          // wLANGID[0] -> US English};//****************************************************************************//// String descriptor 1 for the digital audio player.  This defines the// manufacturer of the player.  See the USB specification for the definition// of this descriptor.////****************************************************************************static const unsigned char ucString1[] ={    0x1e,                               // bLength    0x03,                               // bDescriptorType    'M', 0x00,                          // wString[]    'i', 0x00,    'c', 0x00,    'e', 0x00,    't', 0x00,    'e', 0x00,    'k', 0x00,    ' ', 0x00,    'I', 0x00,    'N', 0x00,    'C', 0x00,    '.', 0x00,    ',', 0x00,    ' ', 0x00};//****************************************************************************//// String descriptor 1 for the digital audio player.  This defines the product// description of the player.  See the USB specification for the definition of// this descriptor.////****************************************************************************static const unsigned char ucString2[] ={    0x52,                               // bLength    0x03,                               // bDescriptorType    'M', 0x00,                          // wString[]    'i', 0x00,    'c', 0x00,    'e', 0x00,    't', 0x00,    'e', 0x00,    'k', 0x00,    ' ', 0x00,    'E', 0x00,    'v', 0x00,    '4', 0x00,    '4', 0x00,    'b', 0x00,    '0', 0x00,    '-', 0x00,    'i', 0x00,    'i', 0x00,    ' ', 0x00,    'e', 0x00,    'v', 0x00,    'a', 0x00,    'l', 0x00,    'u', 0x00,    'a', 0x00,    't', 0x00,    'i', 0x00,    'o', 0x00,    'n', 0x00,    ' ', 0x00,    'b', 0x00,    'o', 0x00,    'a', 0x00,    'r', 0x00,    'd', 0x00,    ' ', 0x00,    ' ', 0x00,    ' ', 0x00,    ' ', 0x00,    ' ', 0x00,    ' ', 0x00};//****************************************************************************//// An array of pointers to the USB standard device request handler Functions.////****************************************************************************void (* const USBStandardDeviceRequest[])(void) ={    USBGetStatus,    USBClearFeature,    USBReserved,    USBSetFeature,    USBReserved,    USBSetAddress,    USBGetDescriptor,    USBReserved,    USBGetConfiguration,    USBSetConfiguration,    USBGetInterface,    USBSetInterface,    USBReserved};#define USB_STRUCT_INITED 0x55AAA55Astatic void usb_wait_ms(unsigned int ms){	if (!in_interrupt())		{		current->state = TASK_UNINTERRUPTIBLE;		schedule_timeout(1 + ms * HZ / 1000);		}	else		{		current->state = TASK_INTERRUPTIBLE;		schedule_timeout(1 + ms * HZ / 1000);		current->state = TASK_RUNNING;		}}static unsigned char USBInitStruct(void){    if (sUSB.ulConfiguration == USB_STRUCT_INITED)        return 0;    memset(&sUSB, 0 , sizeof(sUSB));    sUSB.ulConfiguration = USB_STRUCT_INITED;        sUSB.pucControlIn = controlbuffer0;    sUSB.ulControlInCount = 0;//    sUSB.pucBulkIn = usbbuffer2;  /* The buffer that we send to host.*/    sUSB.ulBulkInCount = 0;    sUSB.pucBulkOut = gbuffer; /* The buffer that host send to us.*/    sUSB.ulBulkOutCount = MAXUSBBUFFERLEN;    sUSB.pucACKIn = controlbuffer0;    sUSB.ulACKInCount = 0;        sUSB.pucCommandOut = controlbuffer0;    sUSB.ulCommandOutCount = 0;    return 0;}//****************************************************************************//// USBReadData will read a  value from the data register of the PDIUSBD12.////****************************************************************************static unsigned char USBReadData(void){    volatile unsigned char * dataregister = (unsigned char *)(unsigned char *)(Usb_Base_Address + Usb_Data_Address);    int delay;    unsigned char datavalue;    //    // Read the value from the data register.    //    datavalue = * dataregister;    //    // Delay a bit to comply with the timing specification of the PDIUSBD12.    //    for(delay = 0; delay < 24; delay++)    {    }    //    // Return the value read.    //    return(datavalue);}//****************************************************************************//// USBReadEndpoint reads data from the specified endpoint.////****************************************************************************static unsigned long USBReadEndpoint(unsigned long ulEndpoint, unsigned char **ppucData,                unsigned long *pulLength){    unsigned long ulIdx, ulLength;    unsigned char *buffer = *ppucData;        //    // Select the appropriate endpoint.    //    USBWriteCommand(USB_COMMAND_SELECT_ENDPOINT + ulEndpoint);    //    // Is there buffer space to fill with this data or should we throw the    // data away?    //    if(*pulLength)    {        //        // Send the read buffer command.        //        USBWriteCommand(USB_COMMAND_READ_BUFFER);        //        // Throw away the reserved byte from the beginning of the buffer.        //        USBReadData();        //        // Read the length of the data buffer.        //        ulLength = USBReadData();        //        // Read the data into the receive buffer.        //        for(ulIdx = 0; (ulIdx < ulLength) && (ulIdx < *pulLength); ulIdx++)        {            *(*ppucData)++ = USBReadData();        }        //        // Decrement the count of bytes to read.        //        *pulLength -= ulIdx;        if (ulEndpoint == USB_ENDPOINT_BULK_OUT)        {               gusb.head += ulIdx;            gusb.total += ulIdx;        }        if (verbose)        {            printk("Get %ld data from USB chip.\n",ulLength);            {                u8 i;                for (i = 0; i< ulLength; i++)                {                    printk("%02x ", buffer[i]);                }               }            printk("\n");        }    }    else /* haven't space to store the data, so drop it.*/    {        if (ulEndpoint == USB_ENDPOINT_BULK_OUT)        {            //            // Send the read buffer command.            //            USBWriteCommand(USB_COMMAND_READ_BUFFER);                //            // Throw away the reserved byte from the beginning of the buffer.            //            USBReadData();                //            // Read the length of the data buffer.            //            ulLength = USBReadData();            gusb.dropped += ulLength;        }    }    //    // Send the clear buffer command so that the endpoint can receive another    // packet.    //    USBWriteCommand(USB_COMMAND_CLEAR_BUFFER);    //    // Return the size of the packet received.    //    return(ulLength);}//****************************************************************************//// USBWriteCommand will write the specified value to the command register of// the PDIUSBD12.////****************************************************************************static void USBWriteCommand(unsigned char commandvalue){    volatile unsigned char *commandregister = (unsigned char *)(Usb_Base_Address + Usb_Command_Address);    volatile int delay;    /*     * Write the value to the command register.     */    *commandregister = commandvalue;    /*     * Delay a bit to comply with the timing specification of the PDIUSBD12.     */    for(delay = 0; delay < 24; delay++)    {    }}//****************************************************************************//// USBWriteData will write the specified value to the data register of the// PDIUSBD12.////****************************************************************************static void USBWriteData(unsigned char datavalue){    volatile unsigned char *dataregister = (unsigned char *)(Usb_Base_Address + Usb_Data_Address);    volatile int delay;    //    // Write the value to the data register.    //    *dataregister = datavalue;    //    // Delay a bit to comply with the timing specification of the PDIUSBD12.    //    for(delay = 0; delay < 24; delay++)    {    }}//****************************************************************************//// USBWriteEndpoint writes data to the specified endpoint.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区不卡视频 | 欧美乱妇15p| 成人aaaa免费全部观看| 国产一区在线视频| 国内精品国产成人| 美女网站视频久久| 麻豆国产91在线播放| 麻豆国产欧美日韩综合精品二区 | 在线看不卡av| 99久久99久久精品国产片果冻| 国产suv精品一区二区三区| 国产一区欧美日韩| 成人午夜电影网站| 欧美综合亚洲图片综合区| 欧洲精品在线观看| 欧美一区在线视频| 国产日韩精品一区二区浪潮av| 国产精品久久久久久久久免费丝袜| 国产精品理论在线观看| 樱花影视一区二区| 日韩电影一区二区三区四区| 另类欧美日韩国产在线| 国产乱国产乱300精品| av一区二区三区黑人| 91久久精品日日躁夜夜躁欧美| 欧美精品vⅰdeose4hd| 26uuu亚洲| 中文字幕视频一区二区三区久| 一区二区三区国产| 久久av老司机精品网站导航| 成人国产精品免费观看动漫 | 国产乱码字幕精品高清av| www.亚洲国产| 日韩女优制服丝袜电影| 中文字幕一区二区三区视频| 亚洲高清三级视频| 国产ts人妖一区二区| 91精品欧美综合在线观看最新| 日本一区二区高清| 丝袜美腿亚洲一区| 岛国精品一区二区| 日韩小视频在线观看专区| 亚洲少妇中出一区| 国内成人精品2018免费看| 色婷婷av一区二区三区软件| 91精品国产欧美一区二区18| 亚洲天堂网中文字| 国产伦精品一区二区三区免费迷| 色美美综合视频| 国产免费成人在线视频| 日本欧美加勒比视频| 色婷婷激情一区二区三区| 国产视频不卡一区| 久久国产婷婷国产香蕉| 欧美高清一级片在线| 亚洲视频在线观看一区| 国产成人亚洲综合a∨猫咪| 欧美伦理视频网站| 亚洲免费观看视频| jizzjizzjizz欧美| 国产视频视频一区| 紧缚奴在线一区二区三区| 欧美人xxxx| 亚洲国产成人av网| 欧美亚日韩国产aⅴ精品中极品| 中文字幕不卡在线播放| 国产精品一级在线| 久久久夜色精品亚洲| 精品亚洲国产成人av制服丝袜 | 一区免费观看视频| 成人做爰69片免费看网站| 欧美精品一区二区三区视频| 美女尤物国产一区| 日韩免费在线观看| 麻豆精品一区二区三区| 日韩欧美www| 激情五月婷婷综合| 国产亚洲成av人在线观看导航| 激情五月激情综合网| 久久九九全国免费| 成人听书哪个软件好| 亚洲婷婷国产精品电影人久久| 99精品欧美一区二区三区小说| 亚洲欧美影音先锋| 在线免费观看日韩欧美| 视频一区二区三区中文字幕| 777亚洲妇女| 国产伦精品一区二区三区免费 | 欧美精选一区二区| 日韩不卡免费视频| xnxx国产精品| av在线这里只有精品| 亚洲猫色日本管| 欧美丰满嫩嫩电影| 久久精品久久精品| 国产精品久久久久影院色老大| 色综合一区二区三区| 性做久久久久久久久| 日韩亚洲欧美在线观看| 成人午夜视频在线| 亚洲最大色网站| 亚洲精品一区二区在线观看| 成人一区二区三区视频在线观看| 亚洲人午夜精品天堂一二香蕉| 欧美高清www午色夜在线视频| 精品一区二区免费视频| 亚洲欧美日韩国产一区二区三区| 在线观看av一区| 国产在线不卡一卡二卡三卡四卡| 中文字幕一区日韩精品欧美| 在线播放中文一区| 国产91在线看| 日本一区中文字幕| 中文字幕一区二区三| 日韩欧美国产三级电影视频| 成人app网站| 国产综合一区二区| 亚洲大片一区二区三区| 国产亲近乱来精品视频| 欧美精品99久久久**| av不卡在线播放| 激情伊人五月天久久综合| 亚洲香肠在线观看| 中文子幕无线码一区tr| 91精品免费观看| 一道本成人在线| 国产精品一二一区| 美女在线视频一区| 亚洲一区二区中文在线| 国产精品乱码一区二区三区软件| 91精品国产色综合久久不卡电影| 波波电影院一区二区三区| 久久99国产精品尤物| 亚洲成人精品影院| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 亚洲精品视频在线观看免费| 久久品道一品道久久精品| 欧美精品粉嫩高潮一区二区| 欧美少妇bbb| 成人精品一区二区三区四区 | 国产日韩欧美精品电影三级在线| 欧美日韩一级视频| 日本伦理一区二区| av一本久道久久综合久久鬼色| 国产成人精品一区二| 日本少妇一区二区| 日韩一区精品视频| 免费在线观看一区二区三区| 亚洲国产婷婷综合在线精品| 亚洲综合小说图片| 性欧美大战久久久久久久久| 一区二区成人在线| 亚洲在线视频免费观看| 夜夜操天天操亚洲| 一区二区高清免费观看影视大全| 亚洲色图19p| 一区二区三区不卡视频| 亚洲国产精品久久艾草纯爱| 亚洲成a人v欧美综合天堂 | 国产在线乱码一区二区三区| 国产在线视视频有精品| 国产精品1区2区3区| 国产白丝网站精品污在线入口 | 亚洲欧美成aⅴ人在线观看| 一区二区三区四区不卡在线| 亚洲自拍欧美精品| 三级欧美韩日大片在线看| 日本午夜精品视频在线观看| 久久超碰97人人做人人爱| 国产精品一区二区91| 91小视频在线观看| 一本色道久久综合亚洲aⅴ蜜桃| 欧美伊人久久久久久久久影院| 欧美日韩不卡在线| 精品国产乱码久久| 中文字幕欧美国产| 亚洲午夜视频在线| 蜜臀国产一区二区三区在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 波多野结衣一区二区三区 | 中文字幕一区二区三区四区不卡| 一区二区三区四区在线播放| 免费高清不卡av| 成人国产精品免费网站| 欧美色视频一区| 久久青草国产手机看片福利盒子 | 亚洲国产精品v| 五月婷婷另类国产| 国产成人aaa| 欧美美女一区二区| 国产精品热久久久久夜色精品三区| 一区二区国产视频| 国产精品一卡二卡在线观看| 欧美视频在线一区二区三区| 久久网站最新地址| 亚洲综合自拍偷拍| 国产一区二区精品在线观看| 欧美日韩亚洲综合在线 | 久久婷婷成人综合色| 亚洲午夜免费视频|