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

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

?? ozerocdoff.c

?? udev是一種工具
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*  Option Zero-CD Disabler or simple turn off hack  Copyright (C) 2008  Peter Henn (support@option.com)  Note, most of the part coming from  Josua Dietze usb_modeswitch  We use this way to disable the ZeroCD device, because we have seen some  problems during the USB-SCSI device "unplug" and "SCSI disconnect", which  may result into a complete aystem freezes. Although this disabling of the  Zero-CD device is a simple SCSI rezero command, the WWAN-modem firmware  does sometimes not correctly do a "SCSI discnnection" to the USB SCSI  driver, before it just plug off from the SCSI bus and does require a  USB reenumeration with the WWAN-modem USB interfaces instead of the USB  SCSI CD-ROM device.  Unbinding the USB SCSI driver and sending the USB rezero command simple by  the usage of the libusb directly from user space solve this time critical  handling between the SCSI driver and the firmware.  History:  0.1, 2008/04/10 P.Henn       - Initial version with usage of code example from usb_modeswitch  0.2, 2008/04/14 P.Henn       - several bugfixes       - autosetup endpoint address       - ensure support for three firmware classes  0.3, 2008/04/15 P.Henn       - first optional filename compare support  0.4, 2008/06/09 P-Henn       - add log file functionality       - add harder Zero-CD device search phase, if /sys/class/usb_device         is not supported       - add search try option  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:  http://www.gnu.org/licenses/gpl.txt*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <assert.h>#include <signal.h>#include <ctype.h>#include <stdarg.h>#include <getopt.h>#include <usb.h>#include <dirent.h>#define VERSION "0.4"#define TARGET_VENDOR 0x0af0#define BUFFER_SIZE 65535// some defines lend from the /usr/include/linux/usb/ch9.h#define USB_ENDPOINT_XFERTYPE_MASK      0x03    /* in bmAttributes */#define USB_ENDPOINT_XFER_BULK          2#define USB_ENDPOINT_DIR_MASK           0x80#define USB_DIR_OUT                     0       /* to device */#define USB_DIR_IN                      0x80    /* to host */#define UDEV_POLL_PERIOD                100     /* in ms, must be > UDEV_POLL_PERIOD_MIN, should be > 55ms and <= 100ms */#define UDEV_POLL_PERIOD_MIN            10      /* in ms, should be > 5ms and <= 10ms */static struct option long_options[] ={    {"help",	       	no_argument,       NULL, 'h'},    {"device_id",	required_argument, NULL, 'i'},    {"usb_filename",	optional_argument, NULL, 'f'},    {"namelen",         optional_argument, NULL, 'n'},    {"quiet",		no_argument,       NULL, 'q'},    {"debug",           no_argument,       NULL, 'd'},    {"warn_only",       no_argument,       NULL, 'w'},    {"version",		no_argument,       NULL, 'v'},    {"test",            no_argument,       NULL, 't'},    {"log",             required_argument, NULL, 'l'},    {"searchtime",      required_argument, NULL, 's'},    {NULL, 0, NULL, 0}};int debug = 0;                   /* commandline switch print debug output */int namelength = 1;              /* commandline switch of prefered name length */struct usb_dev_handle *usb_hd;   /* global for usage in signal handler *//* Function Protortype */void release_usb_device(int);struct usb_device* search_devices(int, int, const char*);int search_message_endp(struct usb_device *);int search_response_endp(struct usb_device *);void print_usage(void);const char *strrcut(const char *, int);int strrcmp(const char *, const char *);FILE *errlog;FILE *outlog;/** * print usage * prints just the help text to sreen, for all the nice options, which may be used */void print_usage(void) {        printf ("Usage: ozerocdoff [-hqwqv] -i <DeviceID> [-f <name>] [-n <len>]\n\n");	printf (" -h, --help               this help\n");	printf (" -i, --device_id <n>      target USB device id, required option\n");	printf (" -f, --usb_filename <str> target USB file name\n");	printf (" -n, --namelen <n>        target USB file name len (default %d)\n", namelength);	printf (" -w, --warn_only          print warnings instead of errors without program abort\n");	printf (" -q, --quiet              don't show messages\n");	printf (" -t, --test               test only, nothing send\n");	printf (" -l, --log                write message into log file instead of stderr\n");	printf (" -s, --searchtime <n> ms  tries to search at least <n> ms for the Zero-CD device\n");	printf (" -d, --debug              output some debug messages\n");	printf (" -v, --version            show version string\n\n");	printf ("Examples:\n");	printf ("   ozerocdoff -i 0xc031\n");	printf ("   ozerocdoff -i 0xc031 -f usbdev5.28 -n 2\n");}int main(int argc, char **argv) {	struct usb_device *usb_dev;	int quiet = 0;            /* commandline switch be quiet, no output */	int warno = 0;            /* commandline switch do only warn and do no program abort */	int test = 0;             /* commandline switch for testing, no rezero will be send */	int count;                /* retry counter */	int ret;                  /* general return value checker */	int searchtime;           /* search time in ms to the Zero-CD device */	DIR *usb_dev_dir;         /* just for testing, if directory exists */	const char *filename="";  /* filename of this USB device */        const char *logname=(char *)NULL;/* filename of log file */	char buffer[BUFFER_SIZE];	int TargetProduct=0;      /* has not to be zero */	const char const MessageContent[]={	  0x55, 0x53, 0x42, 0x43, 0x78, 0x56, 0x34, 0x12,	  0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x01,	  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	};		int c, option_index = 0;	usb_dev_dir = opendir ("/sys/class/usb_device/");	if (usb_dev_dir != NULL) {	      closedir (usb_dev_dir);	      searchtime = 0;    /* no search time needed */	} else {	      searchtime = 800;  /* set search time to 800 ms */	}	while (1){                c = getopt_long (argc, argv, "hvwdtqi:n:f:l:s:",                        long_options, &option_index);		if (c == -1) {		        break;		}		switch (c) {		case 'i': TargetProduct = strtol(optarg, NULL, 0); break;		case 'n': namelength = strtol(optarg, NULL, 0); break;		case 'f': filename = optarg; break;		case 'l': logname = optarg; break;		case 's': searchtime = strtol(optarg, NULL, 0); break;	        case 'q': quiet=1; break;		case 'd': debug=1; break;	        case 'w': warno=1; break;	        case 't': test=1; break;		case 'v': printf("ozerocdoff version: %s\n", VERSION); exit(0);		case 'h': print_usage(); exit(0);		default:  print_usage(); exit(1);		}	}	if (  (logname == (char *)NULL)	    ||((outlog = errlog = fopen(logname, "a")) == NULL)) {	        outlog = stdout;	        errlog = stderr;	} else {	      fprintf(outlog, "\n");	      for(count=0; count < argc; count++) {	              fprintf(outlog, "%s ", argv[count]);	      }	      fprintf(outlog, "\n");	}	/* check argument */	if (TargetProduct==0) {	        fprintf(errlog, "ERROR: Device ID missing\n");		exit(1);	}	if (debug) quiet=0;	if (searchtime < 0) {	        searchtime = 0; /* search at least one time */	}       	/* general USB-Lib init stuff */	usb_init();        /* if the searchtime is < UDEV_POLL_PERIOD_MIN, we will search only once for the device node, but           we will wait that searchtime just before we do the first test!           if the searchtime is > UDEV_POLL_PERIOD, we will repeat the test and do a retest after this time           period. If the rest of the time is < UDEV_POLL_PERIOD_MIN, we will simple skip the last test,           otherwise we do a last test after the rest wait time */	if ((searchtime < UDEV_POLL_PERIOD_MIN) && (searchtime > 0)) {	        usleep(searchtime*1000);	}	for (count=searchtime, ret=1; count>=(UDEV_POLL_PERIOD_MIN - UDEV_POLL_PERIOD); count-=UDEV_POLL_PERIOD, ret++) {	        (void)usb_find_busses();		(void)usb_find_devices();		if (debug) {		        fprintf(outlog, "%d. Search Zero-CD device\n", ret);		}		/* we use currently only the given device ID from the command line to detect the device */		/* that will be bad, if we want to distingush between multiple WWAN-modems, to take care! */		usb_dev = search_devices(TARGET_VENDOR, TargetProduct, strrcut(filename, namelength));		if (usb_dev != NULL) {		        break;		} else {		        if ((count >= UDEV_POLL_PERIOD_MIN) && (count < UDEV_POLL_PERIOD)) {			      usleep(count*1000);			} else if (count > UDEV_POLL_PERIOD) {			      usleep(UDEV_POLL_PERIOD*1000);			}		}	}	if (usb_dev == NULL) {	        if(!quiet) fprintf(errlog, "ERROR: No Zero-CD device found\n");		      exit(2);		}	usb_hd = usb_open(usb_dev);	if (usb_hd == NULL) {		if(!quiet) fprintf(errlog, "ERROR: device access not possible\n");		exit(4);	}    	/* detach running default driver */	signal(SIGTERM, release_usb_device);	ret = usb_get_driver_np(usb_hd, 0, buffer, sizeof(buffer));	if (ret == 0) {	        if (debug) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美精品在线视频| 樱花草国产18久久久久| 国产欧美一二三区| 亚洲午夜精品在线| 国产成人av一区二区三区在线 | 久久精品男人的天堂| 亚洲精品视频观看| 国产一区二区三区黄视频| 欧洲精品在线观看| 国产午夜久久久久| 日韩1区2区3区| 一本久久综合亚洲鲁鲁五月天| 日韩视频一区二区三区在线播放| 国产亚洲精品免费| 免费精品视频最新在线| 欧洲亚洲国产日韩| 18成人在线视频| 国产黑丝在线一区二区三区| 91精品国产福利| 一区二区成人在线视频| 成人午夜视频在线| 国产午夜三级一区二区三| 日本欧美一区二区| 欧美日韩一区二区在线视频| 亚洲欧美激情视频在线观看一区二区三区| 久久精品国产精品青草| 91精品国产免费| 亚洲国产乱码最新视频| 91老师国产黑色丝袜在线| 国产精品私人自拍| 国产成人综合自拍| 久久久久综合网| 国产盗摄一区二区| 久久人人爽人人爽| 国产精品一二三区| 国产日韩欧美不卡在线| 国产高清成人在线| 亚洲国产精品成人综合色在线婷婷| 久草热8精品视频在线观看| 日韩写真欧美这视频| 奇米一区二区三区av| 欧美一区二视频| 麻豆精品一区二区综合av| 日韩三级av在线播放| 免费不卡在线观看| 26uuu国产在线精品一区二区| 美女免费视频一区| 久久久久久久久久美女| 国产成人综合亚洲91猫咪| 久久精品一区二区| 99久久久久久| 一区二区三区美女视频| 欧美日韩一区二区电影| 蜜臀91精品一区二区三区| 精品国产乱码久久久久久牛牛| 韩国av一区二区三区| 中文字幕不卡一区| 色屁屁一区二区| 日韩国产在线观看一区| 精品国产乱码久久久久久浪潮| 国产精品99久久久久久似苏梦涵| 国产精品久久久久久久午夜片| 99精品视频在线观看免费| 亚洲国产综合91精品麻豆| 欧美一区二区三区在线视频| 精品一区精品二区高清| 国产精品福利av| 欧美精品一二三| 国产精品1024| 亚洲一区二区欧美| 精品国产百合女同互慰| 91蜜桃网址入口| 乱一区二区av| 自拍偷拍亚洲欧美日韩| 欧美一区二区大片| 国产丶欧美丶日本不卡视频| 一区二区三区在线看| 精品久久久三级丝袜| 99精品国产热久久91蜜凸| 日韩 欧美一区二区三区| 国产精品久久久久久久久免费相片 | 日韩一区在线看| 91精品麻豆日日躁夜夜躁| 成人午夜在线播放| 蜜臀久久99精品久久久久宅男| 中文一区在线播放| 日韩女优毛片在线| 91国产丝袜在线播放| 国产精品99久久久久久久vr| 亚洲成人一区二区在线观看| 国产精品免费久久| 日韩免费在线观看| 欧美午夜影院一区| 菠萝蜜视频在线观看一区| 久久精品久久精品| 亚洲国产精品一区二区www在线 | 亚洲尤物视频在线| 国产精品剧情在线亚洲| 精品久久久久99| 欧美精品一卡两卡| 91精品1区2区| 成人精品高清在线| 国产乱码精品一区二区三区五月婷| 亚洲国产裸拍裸体视频在线观看乱了| 国产精品理论片| 久久婷婷综合激情| 日韩久久精品一区| 亚洲欧洲在线观看av| 精品噜噜噜噜久久久久久久久试看 | 日韩精品欧美成人高清一区二区| 中文字幕一区在线| 中文乱码免费一区二区| 久久欧美一区二区| 精品国产三级a在线观看| 日韩一区二区三区免费观看| 欧美亚洲国产bt| 欧美吻胸吃奶大尺度电影| 91影院在线观看| 91网站最新地址| 91在线国内视频| 91亚洲精品乱码久久久久久蜜桃| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 午夜久久电影网| 亚洲成a人片综合在线| 亚洲一二三级电影| 午夜在线成人av| 视频一区中文字幕| 蜜桃av一区二区三区电影| 麻豆成人综合网| 国产美女一区二区| 成人av免费在线| 91社区在线播放| 欧美日韩国产首页| 678五月天丁香亚洲综合网| 日韩视频免费观看高清完整版 | 成人高清视频免费观看| 成人动漫精品一区二区| 91麻豆精东视频| 欧美日韩精品是欧美日韩精品| 精品1区2区3区| 欧美videofree性高清杂交| 久久久噜噜噜久久人人看 | 91麻豆精品国产91久久久使用方法 | 国产一区二区三区高清播放| 韩国欧美国产1区| 丰满岳乱妇一区二区三区| 99国产精品久久久久久久久久 | 蜜桃视频一区二区三区在线观看| 免费成人在线网站| 成人免费看黄yyy456| 在线视频国产一区| 欧美一二三区在线观看| 国产欧美一二三区| 亚洲超碰精品一区二区| 精品一区二区三区不卡 | 91麻豆国产香蕉久久精品| 欧美理论在线播放| 欧美激情在线一区二区| 亚洲第一狼人社区| 国产a级毛片一区| 欧美日本在线视频| 国产欧美日韩三区| 日本不卡一区二区三区| 成人小视频在线| 日韩一卡二卡三卡| 日韩伦理av电影| 国内不卡的二区三区中文字幕| av亚洲精华国产精华| 欧美一区二区三区思思人| 国产精品入口麻豆九色| 青椒成人免费视频| 日本电影欧美片| 国产无遮挡一区二区三区毛片日本| 亚洲精品久久久久久国产精华液| 老司机精品视频线观看86| 99久久伊人精品| 久久久亚洲综合| 日本女人一区二区三区| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美一级高清片在线观看| 亚洲男人电影天堂| 春色校园综合激情亚洲| 日韩一区二区电影在线| 亚洲午夜私人影院| 99久久久国产精品免费蜜臀| 日韩欧美国产成人一区二区| 亚洲午夜一二三区视频| 国产成人av一区二区三区在线观看| 91精品国产乱码久久蜜臀| 亚洲一区二区四区蜜桃| 91免费视频观看| 中文字幕免费在线观看视频一区| 看国产成人h片视频| 日韩一级大片在线观看| 视频精品一区二区| 欧美精品久久一区二区三区 | 欧美大片日本大片免费观看| 亚洲国产视频一区| 欧美在线不卡视频| 一区二区三区免费观看|