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

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

?? pg.c

?? 一個2.4.21版本的嵌入式linux內核
?? 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一区二区三区免费野_久草精品视频
精品国精品自拍自在线| 日韩精品一区二区在线观看| 精品一区二区久久久| 国产精品亚洲综合一区在线观看| 中文字幕一区二区三区在线不卡| 国产精品国产自产拍高清av王其| 亚洲日韩欧美一区二区在线| 亚洲欧美电影一区二区| 久草在线在线精品观看| www.在线欧美| 久久综合久久综合亚洲| 色婷婷av一区二区三区软件| 欧美极品少妇xxxxⅹ高跟鞋| 色美美综合视频| 亚洲激情男女视频| 国产精品资源站在线| 欧美人狂配大交3d怪物一区| 亚洲精品乱码久久久久久日本蜜臀| k8久久久一区二区三区| 国产欧美日韩在线看| 国产精品欧美久久久久无广告 | 久久综合九色综合97婷婷| 日韩精品一区二区三区三区免费| 国产日韩综合av| av中文字幕一区| 7777精品伊人久久久大香线蕉经典版下载 | 日本一区二区三区电影| 欧美日韩一本到| 最新久久zyz资源站| 色综合欧美在线视频区| 26uuu亚洲| 欧美日韩成人一区| 日韩一二三区视频| 精品福利一二区| 国产精品美日韩| 亚洲女厕所小便bbb| 亚洲成人综合网站| 成人自拍视频在线观看| 97久久超碰精品国产| 欧美私人免费视频| 欧美美女bb生活片| 久久久三级国产网站| 亚洲欧美在线aaa| 天天操天天色综合| 久久99久久精品| 91一区二区三区在线观看| 在线电影欧美成精品| 日本一区二区视频在线观看| 亚洲一区二区三区影院| 国产一区二区导航在线播放| 东方欧美亚洲色图在线| 久久久久久久久一| 亚洲午夜激情网站| 91福利国产精品| 国产精品色在线观看| 成人av中文字幕| 欧洲av在线精品| 欧美久久一区二区| 久久久亚洲高清| 精品无码三级在线观看视频| 日韩黄色一级片| 欧美唯美清纯偷拍| 一区二区免费看| 精品乱人伦小说| 日韩视频一区二区在线观看| 91丨porny丨户外露出| 蜜臀精品一区二区三区在线观看 | 国产一区二区在线观看视频| 亚洲午夜电影在线| 国产精品国产成人国产三级| 亚洲第一主播视频| 成人黄色小视频在线观看| 中文字幕第一页久久| 91色porny在线视频| 一区二区三区日韩| 日韩一区二区在线观看视频 | 制服丝袜一区二区三区| 亚洲色图色小说| 欧美亚洲国产bt| 玖玖九九国产精品| 国产偷v国产偷v亚洲高清| 成人av高清在线| 亚洲va天堂va国产va久| 精品国产乱码久久久久久图片| 国产乱码精品一品二品| 国产嫩草影院久久久久| 欧美精品精品一区| 丁香另类激情小说| 亚洲黄色录像片| 久久综合成人精品亚洲另类欧美 | 色噜噜狠狠色综合中国| 国产 日韩 欧美大片| 婷婷中文字幕一区三区| 亚洲人成亚洲人成在线观看图片| 中文字幕亚洲一区二区va在线| 26uuu欧美日本| 五月开心婷婷久久| 婷婷亚洲久悠悠色悠在线播放 | 99久久久精品免费观看国产蜜| 久久精品国产亚洲a| 国产综合成人久久大片91| 国产精品自在在线| www.99精品| 欧美唯美清纯偷拍| 欧美一级黄色大片| 日本一区二区高清| 亚洲视频中文字幕| 亚洲成人在线观看视频| 精品一区二区三区免费视频| 国产精品第13页| 亚洲人快播电影网| 尤物视频一区二区| 免费成人深夜小野草| 国产电影精品久久禁18| 91麻豆swag| 欧美v亚洲v综合ⅴ国产v| 亚洲国产精品激情在线观看| 欧美剧情电影在线观看完整版免费励志电影| 91视频观看视频| 在线影视一区二区三区| 国产精品卡一卡二卡三| 免费观看日韩电影| 日本一区二区三区国色天香| 一本一道久久a久久精品| 国产91精品免费| 成人综合婷婷国产精品久久蜜臀 | 亚洲人成网站在线| 337p亚洲精品色噜噜狠狠| 蜜桃视频在线观看一区| 中文字幕精品一区二区精品绿巨人 | 欧美一级日韩不卡播放免费| 亚洲成人一区在线| 久久69国产一区二区蜜臀| 91成人免费在线| 中文欧美字幕免费| 日韩专区中文字幕一区二区| 国产精品综合久久| 中文字幕一区av| 99久久精品国产麻豆演员表| 男人的天堂亚洲一区| 99re热这里只有精品免费视频| 欧美日韩三级在线| 国产精品私人自拍| 日韩不卡手机在线v区| 99riav一区二区三区| 欧美一级日韩一级| 亚洲第四色夜色| 91片黄在线观看| 久久久久久夜精品精品免费| 天堂蜜桃91精品| 91麻豆国产福利精品| 欧美国产日产图区| 国内精品伊人久久久久av影院| 7777精品伊人久久久大香线蕉完整版 | 国产午夜精品在线观看| 七七婷婷婷婷精品国产| 欧美性色aⅴ视频一区日韩精品| 中文字幕不卡在线观看| 国产一区不卡精品| 日韩小视频在线观看专区| 亚洲国产一区视频| 色国产精品一区在线观看| 日本一区二区三区电影| 国产高清久久久| 久久伊人蜜桃av一区二区| 另类欧美日韩国产在线| 91精品国产一区二区三区蜜臀 | 亚洲第一福利一区| 91黄色免费版| 夜夜操天天操亚洲| 在线观看日产精品| 亚洲曰韩产成在线| 欧美另类一区二区三区| 日韩国产在线一| 欧美一区二区私人影院日本| 日韩成人dvd| 欧美电影免费观看高清完整版在线观看 | 午夜一区二区三区视频| 在线免费观看一区| 亚洲九九爱视频| 欧美午夜精品久久久久久超碰| 亚洲在线中文字幕| 欧美一级欧美一级在线播放| 青青草97国产精品免费观看无弹窗版| 欧美一区二区成人| 韩日精品视频一区| 国产欧美精品一区| 成人福利视频在线看| 亚洲视频在线一区二区| 欧亚洲嫩模精品一区三区| 五月激情综合网| wwwwxxxxx欧美| 成人免费毛片片v| 一区二区三区高清| 91麻豆精品国产综合久久久久久| 另类人妖一区二区av| 国产精品麻豆网站| 欧美日韩国产综合一区二区| 久久精品国产99国产| 久久久久国产精品麻豆ai换脸|