亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲欧美怡红院| 成人自拍视频在线观看| 韩国成人精品a∨在线观看| 成人av网在线| 久久精品视频网| 日本在线不卡视频一二三区| 色哟哟一区二区| 国产免费成人在线视频| 美国毛片一区二区三区| 在线观看亚洲一区| 亚洲图片欧美激情| 国产福利一区在线| 欧美一二三区在线观看| 丝瓜av网站精品一区二区| 91在线精品一区二区三区| 久久久精品免费免费| 六月婷婷色综合| 7777精品伊人久久久大香线蕉经典版下载 | 制服丝袜在线91| 一区二区三区四区视频精品免费 | 日韩福利电影在线观看| 91国偷自产一区二区开放时间| 欧美国产欧美综合| 国产成人av一区二区三区在线| 日韩欧美中文字幕公布| 免费日本视频一区| 日韩欧美在线不卡| 久久精品国产久精国产| 日韩三区在线观看| 国产在线播精品第三| 久久免费视频色| 成+人+亚洲+综合天堂| 国产精品家庭影院| 日本道免费精品一区二区三区| 亚洲激情五月婷婷| 欧美午夜影院一区| 免费观看在线综合色| 日韩亚洲欧美中文三级| 美女视频黄频大全不卡视频在线播放| 欧美一区二区三区喷汁尤物| 激情五月婷婷综合网| 久久只精品国产| 99久久国产综合色|国产精品| 中文字幕中文字幕在线一区| 在线亚洲+欧美+日本专区| 日韩精品成人一区二区在线| 欧美一区二区三区在线电影| 精品系列免费在线观看| 国产蜜臀av在线一区二区三区| www.欧美亚洲| 午夜精品久久一牛影视| 欧美第一区第二区| 成人永久aaa| 夜夜嗨av一区二区三区| 91麻豆精品国产自产在线| 激情偷乱视频一区二区三区| 国产精品人妖ts系列视频| 欧美日韩一区二区三区在线看| 日韩国产在线观看| 久久久久久99久久久精品网站| 91免费版pro下载短视频| 亚洲一线二线三线视频| 精品国产乱码久久| 日本伦理一区二区| 国产精品综合一区二区| 亚洲精品高清在线| 久久婷婷国产综合国色天香| 91成人国产精品| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品国产精品国产专区不片| 91久久精品一区二区三区| 久久aⅴ国产欧美74aaa| 一区二区三区日韩精品视频| 精品日韩在线观看| 91丨porny丨国产| 久久99深爱久久99精品| 亚洲国产另类av| 国产精品成人一区二区艾草 | 亚洲人一二三区| 欧美r级在线观看| 91久久精品日日躁夜夜躁欧美| 毛片一区二区三区| 亚洲精品第一国产综合野| 久久久久久久久久久久电影| 欧美日韩激情一区二区三区| thepron国产精品| 国产麻豆精品视频| 亚洲成av人片| 亚洲免费伊人电影| 国产精品美女久久福利网站| 欧美v国产在线一区二区三区| 欧美午夜一区二区三区 | 亚洲天堂成人在线观看| 久久久欧美精品sm网站| 91精品国产免费| 欧美性猛交xxxxxx富婆| 99国产精品久久久久久久久久| 激情偷乱视频一区二区三区| 日韩精品电影在线观看| 亚洲卡通欧美制服中文| 中文字幕在线不卡一区| 国产欧美日韩卡一| 久久久精品tv| 久久久不卡网国产精品二区| 亚洲精品一区二区三区在线观看| 欧美日韩免费高清一区色橹橹| 97精品电影院| 色噜噜夜夜夜综合网| 91成人在线精品| 欧美专区亚洲专区| 欧美午夜精品理论片a级按摩| 色婷婷香蕉在线一区二区| 97久久精品人人做人人爽| 99这里都是精品| av男人天堂一区| 99久久er热在这里只有精品15| 成人黄色综合网站| 91亚洲精华国产精华精华液| 色综合久久久久网| 日本丶国产丶欧美色综合| 欧美日韩午夜影院| 欧美一级黄色大片| 久久久久久久久久久电影| 日本一区二区三区四区在线视频| 国产精品久久网站| 樱花影视一区二区| 五月综合激情日本mⅴ| 蜜桃视频一区二区三区在线观看| 国内外成人在线视频| 风间由美一区二区av101| 91日韩精品一区| 69久久夜色精品国产69蝌蚪网| 日韩天堂在线观看| 久久久三级国产网站| 亚洲色图清纯唯美| 午夜电影一区二区| 高清久久久久久| 日本道精品一区二区三区| 欧美一二三四区在线| 国产亚洲欧美一区在线观看| 亚洲丝袜精品丝袜在线| 日本午夜一区二区| 丁香天五香天堂综合| 欧美亚洲尤物久久| 久久色视频免费观看| 亚洲免费在线视频| 激情国产一区二区 | 亚洲va天堂va国产va久| 久久成人免费网| 91在线高清观看| 日韩欧美一级二级三级久久久| 国产精品网站在线| 亚洲成人一区在线| 成人精品免费视频| 欧美一级高清大全免费观看| 国产精品久久久久久久浪潮网站| 亚洲高清视频的网址| 国产成a人亚洲精| 91精品国产一区二区| 成人免费一区二区三区视频 | 午夜精彩视频在线观看不卡| 国产精品白丝jk白祙喷水网站| 欧美午夜在线一二页| 中国av一区二区三区| 免费成人在线视频观看| 91福利视频久久久久| 国产欧美精品区一区二区三区| 午夜精品久久久久久久| 一本色道亚洲精品aⅴ| 国产三级久久久| 蜜臀av性久久久久蜜臀aⅴ流畅| 91日韩一区二区三区| 国产精品三级久久久久三级| 久久成人免费电影| 日韩无一区二区| 午夜精品久久一牛影视| 在线免费观看成人短视频| 国产欧美日韩在线观看| 国内精品免费**视频| 日韩一区二区三区四区五区六区| 亚洲精品乱码久久久久久日本蜜臀 | 一本到一区二区三区| 国产精品福利一区二区| 国产美女精品在线| 日韩欧美一区二区不卡| 视频一区欧美精品| 欧美天天综合网| 亚洲成人三级小说| 欧美三级韩国三级日本一级| 一区二区三区中文字幕在线观看| 99国产精品久久久久久久久久 | 免费成人av资源网| 欧美美女bb生活片| 亚洲成a人v欧美综合天堂下载| 色综合天天综合网国产成人综合天| 中文字幕电影一区| av电影在线观看一区| 国产精品久久久久影院亚瑟| www.一区二区| 亚洲欧美激情视频在线观看一区二区三区|