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

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

?? pg.c

?? microwindows移植到S3C44B0的源碼
?? 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一区二区三区免费野_久草精品视频
依依成人精品视频| 亚洲国产精品久久久久秋霞影院| 奇米精品一区二区三区四区| 亚洲影视在线播放| 丝袜美腿成人在线| 日本v片在线高清不卡在线观看| 国产精品久久久久久久岛一牛影视 | 国产乱子伦视频一区二区三区| 欧美成人伊人久久综合网| 粉嫩欧美一区二区三区高清影视| 亚洲免费观看高清| 在线不卡a资源高清| 欧美三区在线观看| 午夜伦欧美伦电影理论片| 免费美女久久99| 国产精品丝袜黑色高跟| 色偷偷一区二区三区| 日韩高清在线观看| 国产精品美女一区二区在线观看| 欧美日韩一区二区三区高清| 国产a精品视频| 午夜日韩在线观看| 中文字幕欧美日韩一区| 欧美日韩精品是欧美日韩精品| 国产成人免费视| 日本视频一区二区三区| 亚洲综合图片区| 一区二区成人在线观看| 久久久电影一区二区三区| 制服丝袜成人动漫| 日韩一区二区在线观看视频| 8x8x8国产精品| 亚洲精品在线观| 亚洲国产成人在线| 中文字幕日韩欧美一区二区三区| 日韩视频免费直播| 国产精品女人毛片| 亚洲一区二区四区蜜桃| 日本亚洲视频在线| 大尺度一区二区| 欧美在线一区二区三区| 日韩女优电影在线观看| 精品国产精品一区二区夜夜嗨| 精品成人私密视频| 久久99国产精品免费网站| 中文字幕成人网| 亚洲成人一二三| 色综合久久66| 8v天堂国产在线一区二区| 亚洲裸体xxx| 成人激情午夜影院| 国产日韩欧美不卡在线| 午夜av区久久| 亚洲成人资源在线| 国产成人综合在线| 欧美日韩一区三区四区| 国产精品传媒入口麻豆| 欧美aa在线视频| 欧美性一二三区| 亚洲欧美福利一区二区| 精品一区二区三区在线观看国产| 欧美日韩五月天| 亚洲综合偷拍欧美一区色| 亚洲国产日韩一级| 日本高清免费不卡视频| 欧美大片一区二区| 亚洲一区二区成人在线观看| eeuss鲁一区二区三区| 91精品中文字幕一区二区三区| 亚洲午夜在线观看视频在线| 色婷婷av久久久久久久| 亚洲精品欧美激情| 色综合色综合色综合| 18欧美乱大交hd1984| 成人免费看视频| 伊人色综合久久天天| 精品福利一二区| 一本到不卡精品视频在线观看 | 欧美日韩国产色站一区二区三区| 蜜桃久久久久久久| 国产精品超碰97尤物18| 91麻豆精品国产综合久久久久久| 国产精品一区二区三区四区| 中文字幕在线观看一区| 在线观看免费一区| 蜜臀久久99精品久久久久宅男 | 欧美人伦禁忌dvd放荡欲情| 高清成人在线观看| 久久国产精品第一页| 亚洲欧洲色图综合| 欧美日韩一级大片网址| 国产不卡高清在线观看视频| 日韩精品欧美精品| 17c精品麻豆一区二区免费| 日韩精品一区二区三区视频在线观看| 在线免费一区三区| 91精品欧美久久久久久动漫| 成人三级在线视频| 国产乱码精品一区二区三区五月婷| 亚洲一区二区三区中文字幕| 欧美性大战久久久| 国产一区二区主播在线| 亚洲国产精品一区二区久久 | 欧美国产激情一区二区三区蜜月 | 成人一区二区三区中文字幕| 亚洲成人av电影在线| 26uuu另类欧美亚洲曰本| 成人高清在线视频| 免费视频最近日韩| 三级久久三级久久| 一区二区在线观看不卡| 中文字幕佐山爱一区二区免费| 精品福利一区二区三区| 欧美日韩国产精品自在自线| 国产一区二区美女诱惑| 狠狠色狠狠色合久久伊人| 欧美体内she精视频| 国产婷婷精品av在线| 国产欧美日韩综合精品一区二区| 国产精品网曝门| 亚洲另类春色校园小说| 亚洲综合一区在线| 尤物视频一区二区| 天天影视网天天综合色在线播放 | 欧美国产精品劲爆| 在线播放欧美女士性生活| 在线播放/欧美激情| 色综合网站在线| 99久久精品国产毛片| 成人午夜电影网站| 美女脱光内衣内裤视频久久影院| 亚洲电影一区二区三区| 亚洲国产欧美在线| 婷婷一区二区三区| 亚洲人123区| 一区二区三区在线播放| 亚洲欧美国产三级| 午夜精品在线看| 精品一区二区三区在线观看| 久久99在线观看| 懂色av一区二区夜夜嗨| 99精品一区二区三区| 91成人在线免费观看| 欧美一区二区三区在线观看 | 亚洲成人av电影在线| 久久国产欧美日韩精品| 国产成人亚洲综合a∨猫咪| 99re热视频这里只精品| 欧美日韩黄色一区二区| 精品久久久久久久久久久久久久久久久| 日韩免费电影一区| 亚洲日本在线观看| 久久se这里有精品| av高清不卡在线| 日韩欧美国产不卡| 综合久久久久久| 国内偷窥港台综合视频在线播放| 成人h精品动漫一区二区三区| 欧美色图激情小说| 欧美经典一区二区| 青青国产91久久久久久| 91福利社在线观看| 日本一区二区三区国色天香| 日韩精品乱码免费| 一本到高清视频免费精品| 久久蜜桃av一区二区天堂| 日本亚洲三级在线| 国产ts人妖一区二区| 欧美人狂配大交3d怪物一区| 国产精品女人毛片| 国内精品视频666| 在线免费观看日韩欧美| 亚洲日本va午夜在线电影| 国产宾馆实践打屁股91| 日本一区二区综合亚洲| 粉嫩欧美一区二区三区高清影视 | 国产在线播放一区二区三区| 日韩欧美专区在线| 麻豆一区二区三| 久久久国际精品| 波多野结衣中文一区| 亚洲精品乱码久久久久久日本蜜臀| 99久久久久久| 天堂久久久久va久久久久| 日韩一区二区三| 91亚洲精品久久久蜜桃| 亚洲激情在线激情| 欧美天天综合网| 精品一区二区在线看| 国产精品拍天天在线| 欧美图区在线视频| 国产乱淫av一区二区三区| 亚洲伦理在线免费看| 欧美一区二区三区在线| 国产精品538一区二区在线| 亚洲美女偷拍久久| 日韩一级视频免费观看在线| 成人动漫一区二区三区| 日韩激情中文字幕| 亚洲欧洲日韩在线|