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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? usbsample.c

?? LINUX設(shè)備驅(qū)動2源代碼
?? C
字號:
/* * This sample driver implements USB protocol decoding for both an USB * keyboard and an USB mouse. You can test it using either device, provided * they are not already managed by the official drivers. If you want * to only experiment with one device, pass the nokbd=1 or the * no_mouse=1 option to the command line of insmod */#ifndef __KERNEL__#  define __KERNEL__#endif#ifndef MODULE#  define MODULE#endif#include <linux/config.h>#include <linux/module.h>/* No USB with 2.0, make an explicit error and avoid strange ones */#if LINUX_VERSION_CODE < 0x020200#  error "This module needs kmod, so it won't run with 2.0"#else#include <linux/kernel.h>#include <linux/malloc.h>#include <linux/init.h>#include <linux/usb.h>/* * Note: <linux/usb.h> in 2.2 includes <linux/kcomp.h> that breaks * our sysdep.h . You can't disable kcomp.h from entering the game, * so "sysdep.h" can't be included here. If you write a backward-portable * driver with both USB and something-else support, you need to separate * the USB stuff in order not to rely on sysdep.h in USB-related  files */#if 0  #include "sysdep.h"#else  #include "usb-sysdep.h"#endif/* * We need a local data structure, as it must be allocated for each new * mouse device plugged in the USB bus */struct sample_device {    unsigned char data[8];   /* enough for keyboard and mouse protocols */    char *name;              /* either "kdb" or "mouse" */    struct urb urb;          /* USB Request block, to get USB data*/    int maxp;                /* packet len */    char output[80];         /* used for printk at irq time */};/* * Handler for data sent in by the device. The function is called by * the USB kernel subsystem whenever a device spits out new data */static void sample_irq(struct urb *urb){    struct sample_device *sample = urb->context;    char *pos = sample->output;    int i;    if (urb->status != USB_ST_NOERROR) return;    pos += sprintf(pos, "usbsample: data from %-8s =",		   sample->name);    for (i=0; i<sample->maxp; i++) {	pos += sprintf(pos, " %02x", sample->data[i]);    }    printk(KERN_INFO "%s\n", sample->output);}/* * These two callbacks are invoked when an USB device is detached or attached * to the bus */static void sample_disconnect(struct usb_device *udev, void *clientdata){    /* the clientdata is the sample_device we passed originally */    struct sample_device *sample = clientdata;    /* remove the URB, remove the input device, free memory */    usb_unlink_urb(&sample->urb);    kfree(sample);    printk(KERN_INFO "sample: USB %s disconnected\n", sample->name);    /*     * here you might MOD_DEC_USE_COUNT, but only if you increment     * the count in sample_probe() below     */    return;}static void *sample_probe(struct usb_device *udev, unsigned int ifnum,			  const struct usb_device_id *id){    /*     * The probe procedure is pretty standard. Device matching has already     * been performed based on the id_table structure (defined later)     */    struct usb_interface *iface;    struct usb_interface_descriptor *interface;    struct usb_endpoint_descriptor *endpoint;    struct sample_device *sample;    printk(KERN_INFO "usbsample: probe called for %s device\n",	   (char *)id->driver_info /* "mouse" or "keyboard" */ );    iface = &udev->actconfig->interface[ifnum];    interface = &iface->altsetting[iface->act_altsetting];    if (interface->bNumEndpoints != 1) return NULL;    endpoint = interface->endpoint + 0;    if (!(endpoint->bEndpointAddress & 0x80)) return NULL;    if ((endpoint->bmAttributes & 3) != 3) return NULL;    usb_set_protocol(udev, interface->bInterfaceNumber, 0);    usb_set_idle(udev, interface->bInterfaceNumber, 0, 0);    /* allocate and zero a new data structure for the new device */    sample = kmalloc(sizeof(struct sample_device), GFP_KERNEL);    if (!sample) return NULL; /* failure */    memset(sample, 0, sizeof(*sample));    sample->name = (char *)id->driver_info;    /* fill the URB data structure using the FILL_INT_URB macro */    {	int pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);	int maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));		if (maxp > 8) maxp = 8; sample->maxp = maxp; /* remember for later */	FILL_INT_URB(&sample->urb, udev, pipe, sample->data, maxp,		      sample_irq, sample, endpoint->bInterval);    }    /* register the URB within the USB subsystem */    if (usb_submit_urb(&sample->urb)) {	kfree(sample);	return NULL;    }    /* announce yourself */    printk(KERN_INFO "usbsample: probe successful for %s (maxp is %i)\n",	   sample->name, sample->maxp);    /*     * here you might MOD_INC_USE_COUNT; if you do, you'll need to unplug     * the device or the devices before being able to unload the module     */    /* and return the new structure */    return sample;}/* * The id_table, lists all devices that can be handled by this driver. * The three numbers are class, subclass, protocol. <linux/usb.h> has * more details about interface mathces and vendor/device matches. * This feature is not there in version 2.2, see below, sample_probe_22() * for details. Here we use a fake usb_device_id structure defined in  * ./usb-sysdep.h */static struct usb_device_id sample_id_table [] = {    {	USB_INTERFACE_INFO(3, 1, 1),	driver_info: (unsigned long)"keyboard"    },    {	USB_INTERFACE_INFO(3, 1, 2),	driver_info: (unsigned long)"mouse"    },    {	0, /* no more matches */    }};/* * The callbacks are registered within the USB subsystem using the * usb_driver data structure */#ifdef LINUX_24static struct usb_driver sample_usb_driver = {        name:        "sample",        probe:       sample_probe,        disconnect:  sample_disconnect,        id_table:    sample_id_table,};#else /* 2.2 *//* * With version 2.2, there is no device_id support: the probe function * is called for every device being plugged, and it must select whether * the device is going to be handled or not. Here we extract the identification * phase (based on class/subclass/protocol in this case) and rely on * sample_probe() above for the interesting part of the game. Note * that a 2.4 driver can use this approach as well, by not defining an * id table (and achieving a 2.2 and 2.4 source with less ifdef). We think * the id_table way is much cleaner, so we chose to exploit it where available */static void *sample_probe_22(struct usb_device *udev, unsigned int ifnum){    struct usb_device_id *id;    struct usb_interface_descriptor *interface;    printk(KERN_INFO "sample_probe_22 called\n");    if (udev->descriptor.bNumConfigurations != 1) return NULL;    interface = udev->config[0].interface[ifnum].altsetting;    for (id = sample_id_table; id->driver_info; id++) {        if (interface->bInterfaceClass !=    id->class)    continue;        if (interface->bInterfaceSubClass != id->subclass) continue;        if (interface->bInterfaceProtocol != id->protocol) continue;	break; /* found */    }    if (!id->driver_info)	return NULL; /* not ours */    return sample_probe(udev, ifnum, id);}static struct usb_driver sample_usb_driver = {        name:        "sample",        probe:       sample_probe_22,        disconnect:  sample_disconnect,	/* no id_table field here */};#endif /* 2.2 *//* * Functions called at module load and unload time: only register and * unregister the USB callbacks */int sample_init(void){    /* just register it, returns 0 or error code */    return usb_register(&sample_usb_driver);}void sample_exit(void){    usb_deregister(&sample_usb_driver);}module_init(sample_init);module_exit(sample_exit);#endif /* no 2.0 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久尤物电影视频在线观看| 国产丶欧美丶日本不卡视频| 久久精品国产成人一区二区三区| 黄色小说综合网站| 成人一道本在线| 色综合久久久久| 日韩欧美激情四射| 国产精品国产三级国产aⅴ入口| 亚洲自拍偷拍网站| 激情文学综合丁香| 色欧美乱欧美15图片| 日韩三级.com| 成人欧美一区二区三区黑人麻豆| 首页综合国产亚洲丝袜| 国产91清纯白嫩初高中在线观看| 欧美性感一类影片在线播放| 久久综合色8888| 亚洲影院久久精品| 国产91精品入口| 欧美日韩高清一区二区三区| 亚洲国产精品av| 美日韩一区二区三区| 成人av小说网| 欧美日本乱大交xxxxx| 久久国产欧美日韩精品| 色婷婷精品大在线视频| 久久亚洲精精品中文字幕早川悠里| 亚洲老妇xxxxxx| 极品尤物av久久免费看| 欧美视频一区在线观看| 中文字幕av在线一区二区三区| 天堂蜜桃一区二区三区| 99久久婷婷国产精品综合| 精品久久一区二区三区| 亚洲成人中文在线| 波多野结衣在线aⅴ中文字幕不卡| 91精品国产91热久久久做人人| 欧美激情在线一区二区| 九九精品视频在线看| 欧美理论片在线| 亚洲手机成人高清视频| 国产麻豆成人传媒免费观看| 6080日韩午夜伦伦午夜伦| 亚洲欧洲制服丝袜| 从欧美一区二区三区| 日韩精品一区二区三区中文不卡| 亚洲综合色视频| 91免费版在线看| 国产日产亚洲精品系列| 卡一卡二国产精品| 欧美美女一区二区在线观看| 亚洲自拍偷拍图区| 一本一道久久a久久精品| 国产欧美一区二区精品忘忧草| 精久久久久久久久久久| 日韩三级视频中文字幕| 日本欧美加勒比视频| 欧美色综合天天久久综合精品| 最新久久zyz资源站| 成人激情视频网站| 中文av一区二区| 国产91精品免费| 国产三级一区二区三区| 国产精品18久久久久久久网站| 久久久影院官网| 久久精工是国产品牌吗| 日韩欧美中文字幕一区| 蜜乳av一区二区| 日韩欧美在线网站| 久久99精品国产91久久来源| 精品久久五月天| 国产一区二区影院| 国产亚洲va综合人人澡精品 | 色猫猫国产区一区二在线视频| 欧美国产禁国产网站cc| 成人性视频免费网站| 亚洲国产精品av| 99久久综合精品| 亚洲人成小说网站色在线| 亚洲观看高清完整版在线观看| 欧美在线制服丝袜| 亚洲综合免费观看高清完整版在线| 在线观看日韩高清av| 亚洲午夜在线电影| 欧美一区午夜视频在线观看| 琪琪一区二区三区| 日韩女优av电影| 国产高清精品网站| 亚洲欧洲精品一区二区三区不卡| 色综合色狠狠天天综合色| 亚洲综合成人在线视频| 欧美二区乱c少妇| 精品一区二区影视| 国产精品三级电影| 在线观看国产91| 午夜视频一区在线观看| 精品久久久久久久久久久久包黑料| 国内精品国产三级国产a久久| 中文字幕精品综合| 91福利在线免费观看| 日韩成人免费在线| 2017欧美狠狠色| 99久久久免费精品国产一区二区| 亚洲国产精品一区二区久久| 欧美一级艳片视频免费观看| 国产成人免费视| 亚洲美女淫视频| 欧美理论片在线| 国产一区二区三区国产| 亚洲精品欧美综合四区| 91精品国产综合久久小美女| 国产成人免费在线视频| 悠悠色在线精品| 日韩免费电影网站| 91麻豆123| 青青草国产成人99久久| 国产农村妇女精品| 在线不卡欧美精品一区二区三区| 国产欧美日本一区二区三区| 五月婷婷激情综合网| 亚洲欧洲在线观看av| 国产在线乱码一区二区三区| 欧美日韩一区二区三区高清| 美女久久久精品| 中文字幕在线一区免费| 欧美一区二区三区不卡| 成人黄色在线看| 男人的j进女人的j一区| 亚洲欧美怡红院| 精品久久久三级丝袜| 欧洲一区二区三区在线| 国产一区二区精品在线观看| 国产精品污污网站在线观看| 精品视频资源站| 成人午夜在线免费| 日韩电影免费在线观看网站| 日本伊人精品一区二区三区观看方式| 丝袜亚洲另类丝袜在线| 国产无遮挡一区二区三区毛片日本| 欧美日韩一区中文字幕| 成人午夜激情视频| 麻豆91小视频| 亚洲第一会所有码转帖| 欧美激情在线免费观看| 精品免费99久久| 欧美日韩亚洲丝袜制服| 色伊人久久综合中文字幕| 国产精品66部| 狠狠色狠狠色综合| 日韩高清国产一区在线| 成人免费在线观看入口| 国产免费成人在线视频| 制服丝袜成人动漫| 色天使久久综合网天天| 国产成人av一区二区三区在线观看| 日韩激情视频在线观看| 亚洲一区二区三区四区在线观看 | 日韩国产一二三区| 亚洲另类在线视频| 国产精品久久久久久久裸模| 精品国精品国产尤物美女| 91精品国产综合久久久久久久| 欧美三级在线播放| 欧美色窝79yyyycom| 色综合久久88色综合天天免费| av一二三不卡影片| 国产91精品免费| 国产丶欧美丶日本不卡视频| 国产精品夜夜爽| 国产精品自在在线| 国产综合一区二区| 九色porny丨国产精品| 另类专区欧美蜜桃臀第一页| 奇米四色…亚洲| 久久国产精品免费| 蜜桃精品在线观看| 蜜臀av一级做a爰片久久| 亚洲va在线va天堂| 亚洲亚洲精品在线观看| 一区二区三区不卡在线观看| 亚洲欧美电影一区二区| 国产精品黄色在线观看| 综合色中文字幕| 亚洲另类春色国产| 亚洲靠逼com| 欧美日韩国产美女| 久久久国产精品麻豆| 精品国产精品网麻豆系列| 日韩精品一区国产麻豆| 欧美一区二区视频免费观看| 4438x成人网最大色成网站| 欧美精品在线一区二区三区| 欧美一区二区观看视频| 精品国产第一区二区三区观看体验| 日韩三级在线免费观看| 久久久精品tv| 精品少妇一区二区三区视频免付费 | 91小视频免费观看| 91在线国产福利| 91免费视频观看|