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

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

?? pd.c

?? 是關于linux2.5.1的完全源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*         pd.c    (c) 1997-8  Grant R. Guenther <grant@torque.net>                            Under the terms of the GNU General Public License.        This is the high-level driver for parallel port IDE hard        drives based on chips supported by the paride module.	By default, the driver will autoprobe for a single parallel	port IDE drive, but if their individual parameters are        specified, the driver can handle up to 4 drives.        The behaviour of the pd 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-8 integers as follows:	    drive2	    drive3	<prt>,<pro>,<uni>,<mod>,<geo>,<sby>,<dly>,<slv>			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)		<geo>   this defaults to 0 to indicate that the driver			should use the CHS geometry provided by the drive			itself.  If set to 1, the driver will provide			a logical geometry with 64 heads and 32 sectors			per track, to be consistent with most SCSI		        drivers.  (0 if not given)		<sby>   set this to zero to disable the power saving			standby mode, if needed.  (1 if not given)		<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)		<slv>   IDE disks 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.			            major       You may use this parameter to overide the                        default major number (45) 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 "pd")	    cluster	The driver will attempt to aggregate requests			for adjacent blocks into larger multi-block			clusters.  The maximum cluster size (in 512			byte sectors) is set with this parameter.			(default 64)	    verbose	This parameter controls the amount of logging			that the driver will do.  Set it to 0 for 			normal operation, 1 to see autoprobe progress			messages, or 2 to see additional debugging			output.  (default 0)            nice        This parameter controls the driver's use of                        idle CPU time, at the expense of some speed.        If this driver is built into the kernel, you can use kernel        the following command line parameters, with the same values        as the corresponding module parameters listed above:            pd.drive0            pd.drive1            pd.drive2            pd.drive3            pd.cluster            pd.nice        In addition, you can use the parameter pd.disable to disable        the driver entirely. *//* Changes:	1.01	GRG 1997.01.24	Restored pd_reset()				Added eject ioctl	1.02    GRG 1998.05.06  SMP spinlock changes, 				Added slave support	1.03    GRG 1998.06.16  Eliminate an Ugh.	1.04	GRG 1998.08.15  Extra debugging, use HZ in loop timing	1.05    GRG 1998.09.24  Added jumbo support*/#define PD_VERSION      "1.05"#define PD_MAJOR	45#define PD_NAME		"pd"#define PD_UNITS	4/* Here are things one can override from the insmod command.   Most are autoprobed by paride unless set here.  Verbose is off   by default.*/static int	verbose = 0;static int	major = PD_MAJOR;static char	*name = PD_NAME;static int	cluster = 64;	static int      nice = 0;static int      disable = 0;static int drive0[8] = {0,0,0,-1,0,1,-1,-1};static int drive1[8] = {0,0,0,-1,0,1,-1,-1};static int drive2[8] = {0,0,0,-1,0,1,-1,-1};static int drive3[8] = {0,0,0,-1,0,1,-1,-1};static int (*drives[4])[8] = {&drive0,&drive1,&drive2,&drive3};static int pd_drive_count;#define D_PRT	0#define D_PRO   1#define D_UNI	2#define D_MOD	3#define D_GEO	4#define D_SBY	5#define D_DLY	6#define D_SLV   7#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/genhd.h>#include <linux/hdreg.h>#include <linux/cdrom.h>	/* for the eject ioctl */#include <linux/spinlock.h>#include <asm/uaccess.h>static spinlock_t pd_lock = SPIN_LOCK_UNLOCKED;#ifndef MODULE#include "setup.h"static STT pd_stt[7] = {{"drive0",8,drive0},		        {"drive1",8,drive1},		        {"drive2",8,drive2},		        {"drive3",8,drive3},			{"disable",1,&disable},		        {"cluster",1,&cluster},		        {"nice",1,&nice}};void pd_setup( char *str, int *ints){	generic_setup(pd_stt,7,str);}#endifMODULE_PARM(verbose,"i");MODULE_PARM(major,"i");MODULE_PARM(name,"s");MODULE_PARM(cluster,"i");MODULE_PARM(nice,"i");MODULE_PARM(drive0,"1-8i");MODULE_PARM(drive1,"1-8i");MODULE_PARM(drive2,"1-8i");MODULE_PARM(drive3,"1-8i");#include "paride.h"#define PD_BITS    4/* set up defines for blk.h,  why don't all drivers do it this way ? */#define MAJOR_NR   major#define DEVICE_NAME "PD"#define DEVICE_REQUEST do_pd_request#define DEVICE_NR(device) (minor(device)>>PD_BITS)#define DEVICE_ON(device)#define DEVICE_OFF(device)#include <linux/blk.h>#include <linux/blkpg.h>#include "pseudo.h"#define PD_PARTNS  	(1<<PD_BITS)#define PD_DEVS		PD_PARTNS*PD_UNITS/* numbers for "SCSI" geometry */#define PD_LOG_HEADS    64#define PD_LOG_SECTS    32#define PD_ID_OFF       54#define PD_ID_LEN       14#define PD_MAX_RETRIES  5#define PD_TMO          800             /* interrupt timeout in jiffies */#define PD_SPIN_DEL     50              /* spin delay in micro-seconds  */#define PD_SPIN         (1000000*PD_TMO)/(HZ*PD_SPIN_DEL)  #define STAT_ERR        0x00001#define STAT_INDEX      0x00002#define STAT_ECC        0x00004#define STAT_DRQ        0x00008#define STAT_SEEK       0x00010#define STAT_WRERR      0x00020#define STAT_READY      0x00040#define STAT_BUSY       0x00080#define ERR_AMNF        0x00100#define ERR_TK0NF       0x00200#define ERR_ABRT        0x00400#define ERR_MCR         0x00800#define ERR_IDNF        0x01000#define ERR_MC          0x02000#define ERR_UNC         0x04000#define ERR_TMO         0x10000#define IDE_READ        	0x20#define IDE_WRITE       	0x30#define IDE_READ_VRFY		0x40#define IDE_INIT_DEV_PARMS	0x91#define IDE_STANDBY     	0x96#define IDE_ACKCHANGE   	0xdb#define IDE_DOORLOCK    	0xde#define IDE_DOORUNLOCK  	0xdf#define IDE_IDENTIFY    	0xec#define IDE_EJECT		0xedint pd_init(void);void pd_setup(char * str, int * ints);#ifdef MODULEvoid cleanup_module( void );#endifstatic int pd_open(struct inode *inode, struct file *file);static void do_pd_request(request_queue_t * q);static int pd_ioctl(struct inode *inode,struct file *file,                    unsigned int cmd, unsigned long arg);static int pd_release (struct inode *inode, struct file *file);static int pd_revalidate(kdev_t dev);static int pd_detect(void);static void do_pd_read(void);static void do_pd_read_start(void);static void do_pd_write(void);static void do_pd_write_start(void);static void do_pd_read_drq( void );static void do_pd_write_done( void );static int pd_identify (int unit);static void pd_media_check(int unit);static void pd_doorlock(int unit, int func);static int pd_check_media(kdev_t dev);static void pd_eject( int unit);static struct hd_struct pd_hd[PD_DEVS];static int pd_sizes[PD_DEVS];static int pd_blocksizes[PD_DEVS];#define PD_NAMELEN	8struct pd_unit {	struct pi_adapter pia;		/* interface to paride layer */	struct pi_adapter *pi;	int access;               	/* count of active opens ... */	int capacity;             	/* Size of this volume in sectors */	int heads;                	/* physical geometry */	int sectors;	int cylinders;	int drive;			/* master=0 slave=1 */	int changed;			/* Have we seen a disk change ? */	int removable;			/* removable media device  ?  */	int standby;	int alt_geom;	int present;	char name[PD_NAMELEN];		/* pda, pdb, etc ... */	};struct pd_unit pd[PD_UNITS];/*  'unit' must be defined in all functions - either as a local or a param */#define PD pd[unit]#define PI PD.pistatic int pd_valid = 1;		/* serialise partition checks */static char pd_scratch[512];            /* scratch block buffer *//* the variables below are used mainly in the I/O request engine, which   processes only one request at a time.*/static int pd_retries = 0;              /* i/o error retry count */static int pd_busy = 0;                 /* request being processed ? */static int pd_block;                    /* address of next requested block */static int pd_count;                    /* number of blocks still to do */static int pd_run;			/* sectors in current cluster */static int pd_cmd;			/* current command READ/WRITE */static int pd_unit;			/* unit of current request */static int pd_dev;			/* minor of current request */static char * pd_buf;                   /* buffer for request in progress */static DECLARE_WAIT_QUEUE_HEAD(pd_wait_open);static char *pd_errs[17] = { "ERR","INDEX","ECC","DRQ","SEEK","WRERR",                             "READY","BUSY","AMNF","TK0NF","ABRT","MCR",                             "IDNF","MC","UNC","???","TMO"};/* kernel glue structures */extern struct block_device_operations pd_fops;static struct gendisk pd_gendisk = {	major:		PD_MAJOR,	major_name:	PD_NAME,	minor_shift:	PD_BITS,	part:		pd_hd,	sizes:		pd_sizes,	fops:		&pd_fops,};static struct block_device_operations pd_fops = {	owner:			THIS_MODULE,        open:			pd_open,        release:		pd_release,        ioctl:			pd_ioctl,        check_media_change:	pd_check_media,        revalidate:		pd_revalidate};void pd_init_units( void ){	int	unit, j;	pd_drive_count = 0;	for (unit=0;unit<PD_UNITS;unit++) {		PD.pi = & PD.pia;		PD.access = 0;		PD.changed = 1;		PD.capacity = 0;		PD.drive = DU[D_SLV];		PD.present = 0;		j = 0;		while ((j < PD_NAMELEN-2) && (PD.name[j]=name[j])) j++;		PD.name[j++] = 'a' + unit;		PD.name[j] = 0;		PD.alt_geom = DU[D_GEO];		PD.standby = DU[D_SBY];		if (DU[D_PRT]) pd_drive_count++;	}}int pd_init (void){       int i;	request_queue_t * q; 	if (disable) return -1;        if (devfs_register_blkdev(MAJOR_NR,name,&pd_fops)) {                printk("%s: unable to get major number %d\n",                        name,major);                return -1;        }	q = BLK_DEFAULT_QUEUE(MAJOR_NR);	blk_init_queue(q, DEVICE_REQUEST, &pd_lock);	blk_queue_max_sectors(q, cluster);        	pd_gendisk.major = major;	pd_gendisk.major_name = name;	add_gendisk(&pd_gendisk);	for(i=0;i<PD_DEVS;i++) pd_blocksizes[i] = 1024;	blksize_size[MAJOR_NR] = pd_blocksizes;	printk("%s: %s version %s, major %d, cluster %d, nice %d\n",		name,name,PD_VERSION,major,cluster,nice);	pd_init_units();	pd_valid = 0;	pd_gendisk.nr_real = pd_detect();	pd_valid = 1;#ifdef MODULE        if (!pd_gendisk.nr_real) {		cleanup_module();		return -1;	}#endif        return 0;}static int pd_open (struct inode *inode, struct file *file){       int unit = DEVICE_NR(inode->i_rdev);        if ((unit >= PD_UNITS) || (!PD.present)) return -ENODEV;	wait_event (pd_wait_open, pd_valid);        PD.access++;        if (PD.removable) {		pd_media_check(unit);		pd_doorlock(unit,IDE_DOORLOCK);	}        return 0;}static int pd_ioctl(struct inode *inode,struct file *file,                    unsigned int cmd, unsigned long arg){	struct hd_geometry *geo = (struct hd_geometry *) arg;	int err, unit;	if (!inode || kdev_none(inode->i_rdev))		return -EINVAL;	unit = DEVICE_NR(inode->i_rdev);	if (!PD.present)		return -ENODEV;	switch (cmd) {	    case CDROMEJECT:		if (PD.access == 1) pd_eject(unit);		return 0;	    case HDIO_GETGEO:		if (!geo) return -EINVAL;		err = verify_area(VERIFY_WRITE,geo,sizeof(*geo));		if (err) return err;		if (PD.alt_geom) {		    put_user(PD.capacity/(PD_LOG_HEADS*PD_LOG_SECTS), 		    		(short *) &geo->cylinders);		    put_user(PD_LOG_HEADS, (char *) &geo->heads);		    put_user(PD_LOG_SECTS, (char *) &geo->sectors);		} else {		    put_user(PD.cylinders, (short *) &geo->cylinders);		    put_user(PD.heads, (char *) &geo->heads);		    put_user(PD.sectors, (char *) &geo->sectors);		}		put_user(get_start_sect(inode->i_rdev), (long *)&geo->start);		return 0;	    case BLKRRPART:		if (!capable(CAP_SYS_ADMIN))			return -EACCES;		return pd_revalidate(inode->i_rdev);	    case BLKGETSIZE:	    case BLKGETSIZE64:	    case BLKROSET:	    case BLKROGET:	    case BLKFLSBUF:	    case BLKPG:		return blk_ioctl(inode->i_bdev, cmd, arg);	    default:		return -EINVAL;	}}static int pd_release (struct inode *inode, struct file *file){       kdev_t devp;	int	unit;        devp = inode->i_rdev;	unit = DEVICE_NR(devp);	if ((unit >= PD_UNITS) || (PD.access <= 0)) 		return -EINVAL;	PD.access--;        if (!PD.access && PD.removable)		pd_doorlock(unit,IDE_DOORUNLOCK);	return 0;}static int pd_check_media( kdev_t dev){       int r, unit;	unit = DEVICE_NR(dev);	if ((unit >= PD_UNITS) || (!PD.present)) return -ENODEV;        if (!PD.removable) return 0;	pd_media_check(unit);	r = PD.changed;	PD.changed = 0;	return r;}static int pd_revalidate(kdev_t dev){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级视频在线观看| www国产成人| 日韩欧美国产一区二区三区| 国产亚洲女人久久久久毛片| 亚洲女子a中天字幕| 久久精品国产久精国产爱| av一本久道久久综合久久鬼色| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 在线国产电影不卡| 久久久久久99久久久精品网站| 亚洲午夜在线视频| 成人av网址在线| 精品国产一区二区亚洲人成毛片| 亚洲激情av在线| 国产精品99久久久久久久vr| 欧美精品日韩一本| 亚洲精品中文在线影院| 成人黄色在线网站| 久久人人超碰精品| 奇米888四色在线精品| 在线看国产一区二区| 国产精品久久久一本精品| 激情国产一区二区| 欧美一区在线视频| 亚洲成人av福利| 欧美性生活影院| 亚洲天堂久久久久久久| 丁香婷婷综合色啪| 亚洲精品在线免费播放| 蜜桃精品在线观看| 777色狠狠一区二区三区| 一区二区三区在线视频观看58| 成人丝袜高跟foot| 国产精品福利av| 99热精品国产| 中文字幕视频一区| av不卡在线播放| 亚洲精品ww久久久久久p站| 91色porny蝌蚪| 国产精品久久免费看| 成人午夜视频在线观看| 国产拍欧美日韩视频二区| 国产成人免费av在线| 国产欧美精品一区| caoporen国产精品视频| 国产精品九色蝌蚪自拍| 91在线观看污| 丝袜亚洲另类欧美综合| 欧美一区二区视频观看视频| 久99久精品视频免费观看| 欧美videos中文字幕| 国产老肥熟一区二区三区| 中文字幕乱码亚洲精品一区| 成人av免费在线| 一区二区三区免费| 制服丝袜av成人在线看| 国产一区二区三区日韩| 国产精品美女久久福利网站| 日韩一区二区三区四区五区六区 | 久久精品999| 欧美激情一区二区在线| 色综合久久中文字幕| 亚洲一区av在线| 精品国产在天天线2019| 色偷偷久久人人79超碰人人澡 | 国产精品久久三| 欧美视频在线不卡| 久久99九九99精品| 亚洲特黄一级片| 欧美一区二区精美| 成人av动漫在线| 首页欧美精品中文字幕| 国产日本欧美一区二区| 欧美色图片你懂的| 国产激情一区二区三区| 一级精品视频在线观看宜春院| 欧美成人aa大片| 日本精品视频一区二区| 国产精品小仙女| 亚洲国产精品天堂| 国产精品三级av在线播放| 欧美精品久久天天躁| 国产成人鲁色资源国产91色综 | 在线看国产一区| 国产一区二区三区最好精华液| 奇米色777欧美一区二区| 国产精品视频你懂的| 91精品国产综合久久久蜜臀粉嫩 | 日韩激情中文字幕| 亚洲图片激情小说| 久久久.com| 精品少妇一区二区三区免费观看| 91麻豆产精品久久久久久| 国内精品不卡在线| 日本美女一区二区三区| 亚洲欧美另类图片小说| 26uuu色噜噜精品一区二区| 欧美午夜视频网站| 91在线小视频| 成人一二三区视频| 久久国产精品72免费观看| 午夜伦理一区二区| 亚洲免费伊人电影| 国产精品麻豆网站| 久久久不卡网国产精品二区| 欧美一级国产精品| 欧美日韩免费视频| 精品视频一区三区九区| av电影天堂一区二区在线观看| 国产老女人精品毛片久久| 狠狠色丁香婷综合久久| 激情小说亚洲一区| 久久不见久久见中文字幕免费| 亚洲国产综合视频在线观看| 欧美国产日韩a欧美在线观看 | 欧美日韩免费不卡视频一区二区三区 | 国产婷婷一区二区| 久久免费午夜影院| 精品国产一区二区三区不卡 | 日韩专区欧美专区| 日韩影视精彩在线| 日韩国产欧美在线观看| 日本不卡一二三| 精品无人码麻豆乱码1区2区| 精品亚洲成a人| 国产一区欧美日韩| 国产超碰在线一区| www.99精品| 欧洲精品中文字幕| 欧美日本在线观看| 日韩三级.com| 精品对白一区国产伦| 欧美激情一区二区三区不卡 | 日韩精品久久理论片| 日本成人在线电影网| 精品一区二区国语对白| 成人三级伦理片| 色婷婷综合五月| 欧美日韩dvd在线观看| 日韩精品在线网站| 欧美极品美女视频| 亚洲国产一区二区三区| 秋霞电影一区二区| 顶级嫩模精品视频在线看| 在线观看一区二区精品视频| 欧美一区二区三区啪啪| 久久久综合激的五月天| 亚洲欧美区自拍先锋| 婷婷一区二区三区| 韩国欧美一区二区| 91麻豆123| xnxx国产精品| 亚洲免费av高清| 久草这里只有精品视频| 色菇凉天天综合网| 亚洲精品在线观| 亚洲国产精品久久人人爱蜜臀| 激情都市一区二区| 欧美无砖专区一中文字| 国产日韩视频一区二区三区| 亚洲国产日韩一区二区| 国产精品综合网| 欧美色综合影院| 国产亚洲成av人在线观看导航 | 欧美日韩在线三级| 久久精品夜色噜噜亚洲a∨| 亚洲愉拍自拍另类高清精品| 国产一区二区91| 5月丁香婷婷综合| 亚洲色图欧美在线| 精品写真视频在线观看 | 午夜av一区二区| 成人白浆超碰人人人人| 久久综合九色综合久久久精品综合| 亚洲欧美日韩一区二区三区在线观看| 麻豆精品久久久| 欧美在线制服丝袜| 国产精品色婷婷| 国产盗摄视频一区二区三区| 91精品婷婷国产综合久久性色| 亚洲人成电影网站色mp4| 国产91精品入口| 精品剧情在线观看| 日韩国产高清在线| 欧美日韩一区二区欧美激情| 1000精品久久久久久久久| 国产精品亚洲а∨天堂免在线| 在线观看91av| 亚洲妇熟xx妇色黄| 欧美专区亚洲专区| 亚洲欧美一区二区三区国产精品 | 久久先锋影音av鲁色资源网| 日韩专区欧美专区| 欧美一卡在线观看| 日本视频中文字幕一区二区三区| 欧美性猛片aaaaaaa做受| 亚洲女女做受ⅹxx高潮| 91年精品国产| 又紧又大又爽精品一区二区| 色素色在线综合|