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

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

?? pg.c

?? 這個linux源代碼是很全面的~基本完整了~使用c編譯的~由于時間問題我沒有親自測試~但就算用來做參考資料也是非常好的
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* 	pg.c    (c) 1998  Grant R. Guenther <grant@torque.net>			  Under the terms of the GNU General Public License.	The pg driver provides a simple character device interface for	sending ATAPI commands to a device.  With the exception of the	ATAPI reset operation, all operations are performed by a pair	of read and write operations to the appropriate /dev/pgN device.	A write operation delivers a command and any outbound data in	a single buffer.  Normally, the write will succeed unless the	device is offline or malfunctioning, or there is already another	command pending.  If the write succeeds, it should be followed	immediately by a read operation, to obtain any returned data and	status information.  A read will fail if there is no operation	in progress.	As a special case, the device can be reset with a write operation,	and in this case, no following read is expected, or permitted.	There are no ioctl() operations.  Any single operation	may transfer at most PG_MAX_DATA bytes.  Note that the driver must	copy the data through an internal buffer.  In keeping with all	current ATAPI devices, command packets are assumed to be exactly	12 bytes in length.	To permit future changes to this interface, the headers in the	read and write buffers contain a single character "magic" flag.	Currently this flag must be the character "P".	By default, the driver will autoprobe for a single parallel	port ATAPI device, but if their individual parameters are	specified, the driver can handle up to 4 devices.	To use this device, you must have the following device 	special files defined:		/dev/pg0 c 97 0		/dev/pg1 c 97 1		/dev/pg2 c 97 2		/dev/pg3 c 97 3	(You'll need to change the 97 to something else if you use	the 'major' parameter to install the driver on a different	major number.)	The behaviour of the pg driver can be altered by setting	some parameters from the insmod command line.  The following	parameters are adjustable:	    drive0      These four arguments can be arrays of       	    drive1      1-6 integers as follows:	    drive2	    drive3      <prt>,<pro>,<uni>,<mod>,<slv>,<dly>			Where,		<prt>   is the base of the parallel port address for			the corresponding drive.  (required)		<pro>   is the protocol number for the adapter that			supports this drive.  These numbers are			logged by 'paride' when the protocol modules			are initialised.  (0 if not given)		<uni>   for those adapters that support chained			devices, this is the unit selector for the			chain of devices on the given port.  It should			be zero for devices that don't support chaining.			(0 if not given)		<mod>   this can be -1 to choose the best mode, or one			of the mode numbers supported by the adapter.			(-1 if not given)		<slv>   ATAPI devices can be jumpered to master or slave.			Set this to 0 to choose the master drive, 1 to			choose the slave, -1 (the default) to choose the			first drive found.		<dly>   some parallel ports require the driver to 			go more slowly.  -1 sets a default value that			should work with the chosen protocol.  Otherwise,			set this to a small integer, the larger it is			the slower the port i/o.  In some cases, setting			this to zero will speed up the device. (default -1)	    major	You may use this parameter to overide the			default major number (97) that this driver			will use.  Be sure to change the device			name as well.	    name	This parameter is a character string that			contains the name the kernel will use for this			device (in /proc output, for instance).			(default "pg").	    verbose     This parameter controls the amount of logging			that is done by the driver.  Set it to 0 for 			quiet operation, to 1 to enable progress			messages while the driver probes for devices,			or to 2 for full debug logging.  (default 0)	If this driver is built into the kernel, you can use 	the following command line parameters, with the same values	as the corresponding module parameters listed above:	    pg.drive0	    pg.drive1	    pg.drive2	    pg.drive3	In addition, you can use the parameter pg.disable to disable	the driver entirely.*//* Changes:	1.01	GRG 1998.06.16	Bug fixes	1.02    GRG 1998.09.24  Added jumbo support*/#define PG_VERSION      "1.02"#define PG_MAJOR	97#define PG_NAME		"pg"#define PG_UNITS	4#ifndef PI_PG#define PI_PG	4#endif/* Here are things one can override from the insmod command.   Most are autoprobed by paride unless set here.  Verbose is 0   by default.*/static int	verbose = 0;static int	major = PG_MAJOR;static char	*name = PG_NAME;static int      disable = 0;static int drive0[6] = {0,0,0,-1,-1,-1};static int drive1[6] = {0,0,0,-1,-1,-1};static int drive2[6] = {0,0,0,-1,-1,-1};static int drive3[6] = {0,0,0,-1,-1,-1};static int (*drives[4])[6] = {&drive0,&drive1,&drive2,&drive3};static int pg_drive_count;#define D_PRT   0#define D_PRO   1#define D_UNI   2#define D_MOD   3#define D_SLV   4#define D_DLY   5#define DU              (*drives[unit])/* end of parameters */#include <linux/module.h>#include <linux/errno.h>#include <linux/fs.h>#include <linux/devfs_fs_kernel.h>#include <linux/kernel.h>#include <linux/delay.h>#include <linux/slab.h>#include <linux/mtio.h>#include <linux/pg.h>#include <linux/wait.h>#include <linux/smp_lock.h>#include <asm/uaccess.h>#ifndef MODULE#include "setup.h"static STT pg_stt[5] = {{"drive0",6,drive0},			{"drive1",6,drive1},			{"drive2",6,drive2},			{"drive3",6,drive3},			{"disable",1,&disable}};void pg_setup( char *str, int *ints){       generic_setup(pg_stt,5,str);}#endifMODULE_PARM(verbose,"i");MODULE_PARM(major,"i");MODULE_PARM(name,"s");MODULE_PARM(drive0,"1-6i");MODULE_PARM(drive1,"1-6i");MODULE_PARM(drive2,"1-6i");MODULE_PARM(drive3,"1-6i");#include "paride.h"#define PG_SPIN_DEL     50              /* spin delay in micro-seconds  */#define PG_SPIN         200#define PG_TMO		HZ#define PG_RESET_TMO	10*HZ#define STAT_ERR        0x01#define STAT_INDEX      0x02#define STAT_ECC        0x04#define STAT_DRQ        0x08#define STAT_SEEK       0x10#define STAT_WRERR      0x20#define STAT_READY      0x40#define STAT_BUSY       0x80#define ATAPI_IDENTIFY		0x12int pg_init(void);#ifdef MODULEvoid cleanup_module( void );#endifstatic int pg_open(struct inode *inode, struct file *file);static int pg_release (struct inode *inode, struct file *file);static ssize_t pg_read(struct file * filp, char * buf, 		       size_t count, loff_t *ppos);static ssize_t pg_write(struct file * filp, const char * buf, 			size_t count, loff_t *ppos);static int pg_detect(void);static int pg_identify (int unit, int log);#define PG_NAMELEN      8struct pg_unit {	struct pi_adapter pia;    /* interface to paride layer */	struct pi_adapter *pi;	int busy;        	  /* write done, read expected */	int start;		  /* jiffies at command start */	int dlen;		  /* transfer size requested */	int timeout;		  /* timeout requested */	int status;		  /* last sense key */	int drive;		  /* drive */	int access;               /* count of active opens ... */	int present;		  /* device present ? */	char *bufptr;	char name[PG_NAMELEN];	  /* pg0, pg1, ... */	};struct pg_unit pg[PG_UNITS];/*  'unit' must be defined in all functions - either as a local or a param */#define PG pg[unit]#define PI PG.pistatic char pg_scratch[512];            /* scratch block buffer *//* kernel glue structures */static struct file_operations pg_fops = {	owner:		THIS_MODULE,	read:		pg_read,	write:		pg_write,	open:		pg_open,	release:	pg_release,};void pg_init_units( void ){       int     unit, j;	pg_drive_count = 0;	for (unit=0;unit<PG_UNITS;unit++) {		PG.pi = & PG.pia;		PG.access = 0;		PG.busy = 0;		PG.present = 0;		PG.bufptr = NULL;		PG.drive = DU[D_SLV];		j = 0;		while ((j < PG_NAMELEN-2) && (PG.name[j]=name[j])) j++;		PG.name[j++] = '0' + unit;		PG.name[j] = 0;		if (DU[D_PRT]) pg_drive_count++;	}} static devfs_handle_t devfs_handle;int pg_init (void)      /* preliminary initialisation */{       int unit;	if (disable) return -1;	pg_init_units();	if (pg_detect()) return -1;	if (devfs_register_chrdev(major,name,&pg_fops)) {		printk("pg_init: unable to get major number %d\n",			major);		for (unit=0;unit<PG_UNITS;unit++)		  if (PG.present) pi_release(PI);		return -1;	}	devfs_handle = devfs_mk_dir (NULL, "pg", NULL);	devfs_register_series (devfs_handle, "%u", 4, DEVFS_FL_DEFAULT,			       major, 0, S_IFCHR | S_IRUSR | S_IWUSR,			       &pg_fops, NULL);	return 0;}#ifdef MODULE/* Glue for modules ... */void    cleanup_module(void);int     init_module(void){       int     err;#ifdef PARIDE_JUMBO       { extern paride_init();         paride_init();       } #endif	err = pg_init();	return err;}void    cleanup_module(void){       int unit;	devfs_unregister (devfs_handle);	devfs_unregister_chrdev(major,name);	for (unit=0;unit<PG_UNITS;unit++)	  if (PG.present) pi_release(PI);}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品三级视频| 亚洲欧美在线aaa| 国产日韩一级二级三级| 国产欧美精品一区二区色综合朱莉| 国产亚洲一区二区三区四区 | 在线看一区二区| 色哟哟在线观看一区二区三区| 国产高清无密码一区二区三区| 成人黄色免费短视频| 欧美日韩成人一区二区| 久久精品夜夜夜夜久久| 一区二区三区免费观看| 国产在线看一区| 91啦中文在线观看| 久久久精品综合| 日韩成人免费看| gogogo免费视频观看亚洲一| 日韩午夜电影av| 亚洲精选在线视频| 经典三级视频一区| 麻豆精品久久久| 欧美色精品在线视频| 亚洲日本在线视频观看| 成人晚上爱看视频| 欧美高清一级片在线观看| 久久国产精品免费| 欧美电视剧在线观看完整版| 首页国产丝袜综合| 欧美浪妇xxxx高跟鞋交| 亚洲在线视频一区| 欧美日韩另类一区| 亚洲www啪成人一区二区麻豆| 欧洲视频一区二区| 亚洲韩国一区二区三区| 欧美久久高跟鞋激| 日韩精品每日更新| 欧美变态口味重另类| 久88久久88久久久| 久久色在线视频| 国产 日韩 欧美大片| 国产免费成人在线视频| 成人午夜激情影院| 亚洲精品免费电影| 欧美视频中文字幕| 奇米影视一区二区三区| 欧美一二区视频| 国产精品综合二区| 中文字幕在线观看不卡视频| 日本大香伊一区二区三区| 一区二区三区自拍| 日韩视频在线你懂得| 国产乱人伦精品一区二区在线观看 | 国产成人福利片| 中文字幕精品一区| 一本一道综合狠狠老| 亚洲在线观看免费| 日韩午夜电影av| 成人免费观看男女羞羞视频| 亚洲精品中文在线影院| 在线成人av网站| 成人a级免费电影| 亚洲福利一二三区| 亚洲精品一区二区三区福利| 成人精品鲁一区一区二区| 亚洲国产aⅴ成人精品无吗| 日韩视频一区二区| 99精品视频一区二区三区| 视频一区中文字幕国产| 国产精品私房写真福利视频| 欧美三级在线视频| 岛国精品在线观看| 视频一区二区三区在线| 久久精品欧美一区二区三区不卡 | 国产1区2区3区精品美女| 亚洲免费观看视频| 久久亚洲精品国产精品紫薇| 91一区二区在线| 久草在线在线精品观看| 一区二区三区蜜桃网| 国产午夜久久久久| 欧美一区二区三区日韩视频| 91在线高清观看| 国产精品一卡二卡| 日本女人一区二区三区| 亚洲精品欧美激情| 国产精品网曝门| 精品日产卡一卡二卡麻豆| 欧美天天综合网| eeuss鲁片一区二区三区在线观看| 偷拍日韩校园综合在线| 亚洲欧美日韩系列| 久久久天堂av| 日韩欧美区一区二| 欧美放荡的少妇| 在线观看网站黄不卡| 波多野结衣欧美| 精品一二线国产| 日本成人在线看| 亚洲h在线观看| 一区二区免费看| 又紧又大又爽精品一区二区| 国产欧美精品日韩区二区麻豆天美| 日韩欧美一区二区三区在线| 欧美日韩成人高清| 欧美色倩网站大全免费| 91国产免费看| 欧美亚洲一区三区| 欧美午夜精品理论片a级按摩| 99re成人在线| 色哟哟精品一区| 在线亚洲+欧美+日本专区| 91蝌蚪porny九色| 91视视频在线直接观看在线看网页在线看| 国产精品一线二线三线精华| 91浏览器在线视频| 91国偷自产一区二区开放时间 | 国产视频一区二区在线| 国产日韩精品一区| 中文字幕二三区不卡| 欧美国产精品劲爆| 国产精品另类一区| 亚洲天堂2014| 亚洲精品久久久蜜桃| 亚洲一区在线播放| 日韩高清一区在线| 精品在线免费观看| 国产高清不卡一区| 成人动漫一区二区| 在线观看亚洲精品视频| 欧美精品精品一区| 337p日本欧洲亚洲大胆精品| 欧美精品一区二区三区蜜桃视频| 亚洲精品在线观| 国产精品亲子伦对白| 亚洲欧美经典视频| 青青草原综合久久大伊人精品优势 | 亚洲高清免费观看| 久久99精品久久久久久国产越南 | 久久精品欧美一区二区三区麻豆| 欧美国产精品中文字幕| 亚洲激情一二三区| 免费成人美女在线观看.| 国产高清亚洲一区| 欧美亚洲国产一区二区三区| 91精品国产色综合久久不卡蜜臀| 久久这里只有精品首页| 国产精品白丝在线| 日韩av中文字幕一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区| 国产999精品久久久久久 | av成人免费在线观看| 欧美丝袜丝交足nylons图片| 精品久久久久久久久久久久久久久久久| 国产午夜精品福利| 五月综合激情婷婷六月色窝| 激情偷乱视频一区二区三区| 成人午夜激情影院| 日韩一区二区三区四区| 亚洲欧洲av一区二区三区久久| 日欧美一区二区| 99精品视频一区二区三区| 日韩一区二区高清| 亚洲男同1069视频| 国产精品一区二区三区乱码| 欧美视频一区在线| 中文文精品字幕一区二区| 免费xxxx性欧美18vr| 91亚洲男人天堂| 久久免费的精品国产v∧| 首页国产欧美日韩丝袜| 久久人人爽爽爽人久久久| 亚洲午夜在线观看视频在线| 国产成人亚洲精品狼色在线| 91麻豆精品国产| 亚洲美女视频在线观看| 成人一区在线观看| 久久一夜天堂av一区二区三区| 亚洲一二三级电影| 成人国产视频在线观看| 久久婷婷国产综合国色天香 | 一区二区三区不卡视频在线观看| 久久国产夜色精品鲁鲁99| 欧美性感一类影片在线播放| 国产精品久久久一区麻豆最新章节| 蜜桃久久av一区| 91麻豆精品国产91久久久久久久久| 亚洲男帅同性gay1069| av一区二区三区在线| 国产欧美视频一区二区| 国内精品久久久久影院一蜜桃| 91精品国产综合久久福利软件| 一区二区免费在线播放| 一本大道久久a久久精二百| 国产精品女上位| 波多野结衣中文字幕一区| 国产精品网曝门| 91蜜桃视频在线| 亚洲欧美日韩国产综合| 欧美综合视频在线观看| 一区二区不卡在线播放 |