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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pd.c

?? microwindows移植到S3C44B0的源碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*         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>#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];static int pd_maxsectors[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 int pd_poffs;			/* partition offset of current minor */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,	max_p:		PD_PARTNS,	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);        read_ahead[MAJOR_NR] = 8;       /* 8 sector (4kB) read ahead */        	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;	for(i=0;i<PD_DEVS;i++) pd_maxsectors[i] = cluster;	max_sectors[MAJOR_NR] = pd_maxsectors;	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 dev, err, unit;        if ((!inode) || (!inode->i_rdev)) return -EINVAL;        dev = MINOR(inode->i_rdev);	unit = DEVICE_NR(inode->i_rdev);        if (dev >= PD_DEVS) return -EINVAL;	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(pd_hd[dev].start_sect,(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 BLKRASET:	    case BLKRAGET:	    case BLKFLSBUF:	    case BLKPG:		return blk_ioctl(inode->i_rdev, 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){       int p, unit, minor;        long flags;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区永久视频免费观看| 亚洲欧洲精品一区二区精品久久久| 国v精品久久久网| 亚洲自拍另类综合| 欧美激情综合在线| 日韩一区二区三区在线观看| 日本二三区不卡| 国产大片一区二区| 美女网站视频久久| 亚洲国产美女搞黄色| 国产精品久久久久影院亚瑟| 欧美tk丨vk视频| 这里只有精品99re| 欧美主播一区二区三区| av在线综合网| 国产a视频精品免费观看| 美女爽到高潮91| 日精品一区二区三区| 亚洲综合一区二区| 亚洲欧美色综合| 中文字幕日韩一区| 国产精品久久久久一区二区三区| 2014亚洲片线观看视频免费| 欧美成人激情免费网| 欧美精品一二三四| 欧美精选一区二区| 欧美日韩色综合| 欧美日韩国产精品自在自线| 欧美亚洲综合一区| 在线一区二区三区做爰视频网站| 91麻豆福利精品推荐| 成人永久免费视频| 成人网在线免费视频| 成人永久aaa| www.日本不卡| 日韩电影在线一区二区三区| 奇米影视7777精品一区二区| 秋霞影院一区二区| 久久精工是国产品牌吗| 久久99国产精品成人| 精品亚洲欧美一区| 国产一区二区三区蝌蚪| 国产盗摄一区二区| 91网页版在线| 欧美性一二三区| 欧美一区二区在线视频| 欧美成人午夜电影| 欧美极品xxx| 亚洲老妇xxxxxx| 香蕉久久夜色精品国产使用方法 | 欧美一级二级三级蜜桃| 日韩欧美一二区| 久久精品亚洲精品国产欧美kt∨| 久久久久久久久久久久久女国产乱 | 亚洲已满18点击进入久久| 亚洲韩国一区二区三区| 日本亚洲免费观看| 国产精品99久久久| 色婷婷久久99综合精品jk白丝| 欧美视频一区二区| 精品奇米国产一区二区三区| 中文字幕欧美日本乱码一线二线| 最新不卡av在线| 五月婷婷久久丁香| 国产一区二区成人久久免费影院 | 日韩二区三区在线观看| 国产麻豆视频精品| 色美美综合视频| 欧美一区二区三区成人| 国产亚洲美州欧州综合国| 一区二区在线观看av| 久久精品国产亚洲高清剧情介绍 | 亚洲成av人影院在线观看网| 久久精品av麻豆的观看方式| 99热精品一区二区| 欧美高清视频www夜色资源网| 久久久久久久久99精品| 亚洲在线一区二区三区| 久久aⅴ国产欧美74aaa| 91香蕉视频黄| 欧美精品一区二区三区在线播放| 日韩一区在线看| 精品一区二区三区蜜桃| 一本高清dvd不卡在线观看| 日韩一区二区三区电影在线观看 | 91蜜桃在线免费视频| 欧美一级黄色片| 亚洲视频一区二区在线| 韩国v欧美v日本v亚洲v| 欧美在线看片a免费观看| www亚洲一区| 午夜精品影院在线观看| 99r精品视频| 国产亚洲一区二区三区| 制服丝袜亚洲网站| 欧美精品色综合| 欧美国产国产综合| 免费av成人在线| 91久久精品一区二区三| 久久久.com| 奇米色777欧美一区二区| 色婷婷久久99综合精品jk白丝| 久久久夜色精品亚洲| 日韩高清一区二区| 欧美亚洲丝袜传媒另类| 国产精品久久久99| 国产精品1区2区| 精品久久一二三区| 日韩成人dvd| 欧美少妇一区二区| 亚洲精品高清视频在线观看| 成av人片一区二区| 久久精品免费在线观看| 国内精品嫩模私拍在线| 日韩欧美一级二级三级| 免费一级片91| 欧美一区二区成人6969| 亚洲国产cao| 欧美日韩一区视频| 亚洲精品v日韩精品| 色综合久久综合中文综合网| 国产精品国产馆在线真实露脸 | 亚洲一区在线观看网站| 成人精品国产免费网站| 国产亚洲婷婷免费| 国产一区二区三区综合| 精品久久久久久久一区二区蜜臀| 日本视频一区二区三区| 欧美一区二区视频在线观看2020| 午夜精品在线视频一区| 欧美肥胖老妇做爰| 日韩在线a电影| 91精品久久久久久久99蜜桃| 爽好多水快深点欧美视频| 欧美日韩精品系列| 午夜精品久久久久影视| 91精品国产色综合久久久蜜香臀| 天堂一区二区在线免费观看| 欧美一区二区成人6969| 激情小说亚洲一区| 久久久亚洲综合| 99视频在线观看一区三区| 亚洲天堂中文字幕| 欧美专区日韩专区| 天堂久久久久va久久久久| 日韩欧美国产精品一区| 国内不卡的二区三区中文字幕| 国产日产欧美一区| 91香蕉视频mp4| 午夜精品久久久久久久久久久 | 9191久久久久久久久久久| 裸体一区二区三区| 久久香蕉国产线看观看99| 成人av在线一区二区三区| 亚洲卡通欧美制服中文| 在线播放日韩导航| 国内精品在线播放| 一区在线播放视频| 欧美日韩mp4| 国产乱码精品一区二区三| 国产精品国产三级国产aⅴ无密码| 91成人网在线| 久国产精品韩国三级视频| 国产精品久久久久7777按摩| 欧美日高清视频| 国产乱国产乱300精品| 亚洲人成影院在线观看| 欧美精品在线一区二区| 国产成人午夜99999| 亚洲精品视频一区| 日韩女优av电影| 99re视频这里只有精品| 美国欧美日韩国产在线播放| 中文字幕制服丝袜成人av| 欧美情侣在线播放| 成人激情校园春色| 天天综合天天做天天综合| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美一区二区三区婷婷月色| 成人黄色电影在线| 青青青爽久久午夜综合久久午夜| 中文字幕第一区第二区| 欧美日韩另类一区| 成人激情小说乱人伦| 免费在线欧美视频| 亚洲免费成人av| 亚洲精品一区二区三区福利| 欧美系列在线观看| 成人国产在线观看| 久久精品国产999大香线蕉| 一区二区三区四区激情| 久久免费看少妇高潮| 91精品国产91久久久久久最新毛片 | 国产成人在线视频播放| 五月婷婷激情综合| 亚洲日本一区二区| 久久网站热最新地址| 88在线观看91蜜桃国自产| 91视视频在线观看入口直接观看www| 七七婷婷婷婷精品国产|