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

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

?? pcd.c

?? Linux內核源代碼 為壓縮文件 是<<Linux內核>>一書中的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* 	pcd.c	(c) 1997-8  Grant R. Guenther <grant@torque.net>		            Under the terms of the GNU public license.	This is a high-level driver for parallel port ATAPI CD-ROM        drives based on chips supported by the paride module.        By default, the driver will autoprobe for a single parallel        port ATAPI CD-ROM drive, but if their individual parameters are        specified, the driver can handle up to 4 drives.        The behaviour of the pcd 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 CD-ROMs 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 (46) 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 "pcd")            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:	    pcd.drive0	    pcd.drive1	    pcd.drive2	    pcd.drive3	    pcd.nice        In addition, you can use the parameter pcd.disable to disable        the driver entirely.*//* Changes:	1.01	GRG 1998.01.24	Added test unit ready support	1.02    GRG 1998.05.06  Changes to pcd_completion, ready_wait,				and loosen interpretation of ATAPI			        standard for clearing error status.				Use spinlocks. Eliminate sti().	1.03    GRG 1998.06.16  Eliminated an Ugh	1.04	GRG 1998.08.15  Added extra debugging, improvements to				pcd_completion, use HZ in loop timing	1.05	GRG 1998.08.16	Conformed to "Uniform CD-ROM" standard	1.06    GRG 1998.08.19  Added audio ioctl support	1.07    GRG 1998.09.24  Increased reset timeout, added jumbo support*/#define	PCD_VERSION	"1.07"#define PCD_MAJOR	46#define PCD_NAME	"pcd"#define PCD_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 = PCD_MAJOR;static char     *name = PCD_NAME;static int      nice = 0;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 pcd_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/kernel.h>#include <linux/delay.h>#include <linux/cdrom.h>#include <linux/spinlock.h>#include <asm/uaccess.h>#ifndef MODULE#include "setup.h"static STT pcd_stt[6] = {{"drive0",6,drive0},                         {"drive1",6,drive1},                         {"drive2",6,drive2},                         {"drive3",6,drive3},			 {"disable",1,&disable},                         {"nice",1,&nice}};void pcd_setup( char *str, int *ints){       generic_setup(pcd_stt,6,str);}#endifMODULE_PARM(verbose,"i");MODULE_PARM(major,"i");MODULE_PARM(name,"s");MODULE_PARM(nice,"i");MODULE_PARM(drive0,"1-6i");MODULE_PARM(drive1,"1-6i");MODULE_PARM(drive2,"1-6i");MODULE_PARM(drive3,"1-6i");#include "paride.h"/* set up defines for blk.h,  why don't all drivers do it this way ? */#define MAJOR_NR	major#define DEVICE_NAME "PCD"#define DEVICE_REQUEST do_pcd_request#define DEVICE_NR(device) (MINOR(device))#define DEVICE_ON(device)#define DEVICE_OFF(device)#include <linux/blk.h>#include "pseudo.h"#define PCD_RETRIES	     5#define PCD_TMO		   800		/* timeout in jiffies */#define PCD_DELAY           50          /* spin delay in uS */#define PCD_READY_TMO	    20		/* in seconds */#define PCD_RESET_TMO	   100		/* in tenths of a second */#define PCD_SPIN	(1000000*PCD_TMO)/(HZ*PCD_DELAY)#define IDE_ERR		0x01#define IDE_DRQ         0x08#define IDE_READY       0x40#define IDE_BUSY        0x80int pcd_init(void);void cleanup_module( void );static int pcd_open(struct cdrom_device_info *cdi, int purpose);static void pcd_release(struct cdrom_device_info *cdi);static int pcd_drive_status(struct cdrom_device_info *cdi, int slot_nr);static int pcd_media_changed(struct cdrom_device_info *cdi, int slot_nr);static int pcd_tray_move(struct cdrom_device_info *cdi, int position);static int pcd_lock_door(struct cdrom_device_info *cdi, int lock);static int pcd_drive_reset(struct cdrom_device_info *cdi);static int pcd_get_mcn (struct cdrom_device_info *cdi, struct cdrom_mcn *mcn);static int pcd_audio_ioctl(struct cdrom_device_info *cdi,				unsigned int cmd, void *arg);static int pcd_packet(struct cdrom_device_info *cdi,				struct cdrom_generic_command *cgc);static int 	pcd_detect(void);static void 	pcd_probe_capabilities(void);static void     do_pcd_read_drq(void);static void 	do_pcd_request(request_queue_t * q);static void 	do_pcd_read(void);static int pcd_blocksizes[PCD_UNITS];struct pcd_unit {	struct pi_adapter pia;		/* interface to paride layer */	struct pi_adapter *pi;	int drive;			/* master/slave */	int last_sense;			/* result of last request sense */	int changed;			/* media change seen */	int present;			/* does this unit exist ? */	char *name;			/* pcd0, pcd1, etc */	struct cdrom_device_info info;	/* uniform cdrom interface */	};struct pcd_unit pcd[PCD_UNITS];/*  'unit' must be defined in all functions - either as a local or a param */#define PCD pcd[unit]#define PI PCD.pistatic char pcd_scratch[64];static char pcd_buffer[2048];           /* raw block buffer */static int pcd_bufblk = -1;             /* block in buffer, in CD units,                                           -1 for nothing there. See also					   pd_unit.					 *//* the variables below are used mainly in the I/O request engine, which   processes only one request at a time.*/static int pcd_unit = -1;		/* unit of current request & bufblk */static int pcd_retries;			/* retries on current request */static int pcd_busy = 0;		/* request being processed ? */static int pcd_sector;			/* address of next requested sector */static int pcd_count;			/* number of blocks still to do */static char * pcd_buf;			/* buffer for request in progress */static int pcd_warned = 0;		/* Have we logged a phase warning ? *//* kernel glue structures */static struct cdrom_device_ops pcd_dops = {	pcd_open,	pcd_release,	pcd_drive_status,	pcd_media_changed,	pcd_tray_move,	pcd_lock_door,	0,			/* select speed */	0,			/* select disk  */	0, 			/* get last session */	pcd_get_mcn,	pcd_drive_reset,	pcd_audio_ioctl,	0,			/* dev_ioctl */	CDC_CLOSE_TRAY	   |	CDC_OPEN_TRAY	   |	CDC_LOCK	   |	CDC_MCN		   |	CDC_MEDIA_CHANGED  |	CDC_RESET	   |	CDC_PLAY_AUDIO	   |	CDC_GENERIC_PACKET |	CDC_CD_R	   |	CDC_CD_RW,	0,	pcd_packet,};static void pcd_init_units( void ){       int     unit, j;        pcd_drive_count = 0;        for (unit=0;unit<PCD_UNITS;unit++) {                PCD.pi = & PCD.pia;                PCD.present = 0;		PCD.last_sense = 0;		PCD.changed = 1;                PCD.drive = DU[D_SLV];                if (DU[D_PRT]) pcd_drive_count++;                 j = 0;                while ((j < (sizeof(PCD.info.name)-2)) && 		       (PCD.info.name[j]=name[j])) j++;                PCD.info.name[j++] = '0' + unit;                PCD.info.name[j] = 0;		PCD.name = &PCD.info.name[0];		PCD.info.ops = &pcd_dops;		PCD.info.handle = NULL;		PCD.info.dev = MKDEV(major,unit);		PCD.info.speed = 0;		PCD.info.capacity = 1;		PCD.info.mask = 0;        }}int pcd_init (void)	/* preliminary initialisation */{       int 	i, unit;	if (disable) return -1;	pcd_init_units();	if (pcd_detect()) return -1;	/* get the atapi capabilities page */	pcd_probe_capabilities();	if (register_blkdev(MAJOR_NR,name,&cdrom_fops)) {		printk("pcd: unable to get major number %d\n",MAJOR_NR);		return -1;	}	for (unit=0;unit<PCD_UNITS;unit++)		if (PCD.present) register_cdrom(&PCD.info);	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);	read_ahead[MAJOR_NR] = 8;	/* 8 sector (4kB) read ahead */	for (i=0;i<PCD_UNITS;i++) pcd_blocksizes[i] = 1024;        blksize_size[MAJOR_NR] = pcd_blocksizes;	return 0;}static int pcd_open(struct cdrom_device_info *cdi, int purpose){	int unit = DEVICE_NR(cdi->dev);	if  ((unit >= PCD_UNITS) || (!PCD.present)) return -ENODEV;	MOD_INC_USE_COUNT;	return 0;}static void pcd_release(struct cdrom_device_info *cdi){	MOD_DEC_USE_COUNT;}#ifdef MODULE/* Glue for modules ... */int	init_module(void){	int	err;#ifdef PARIDE_JUMBO       { extern paride_init();         paride_init();       } #endif	err = pcd_init();	return err;}void	cleanup_module(void){	int unit;	        for (unit=0;unit<PCD_UNITS;unit++)            if (PCD.present) {		pi_release(PI);		unregister_cdrom(&PCD.info);	   }	unregister_blkdev(MAJOR_NR,name);}#endif#define WR(c,r,v)       pi_write_regr(PI,c,r,v)#define RR(c,r)         (pi_read_regr(PI,c,r))static int pcd_wait( int unit, int go, int stop, char * fun, char * msg ){	int j, r, e, s, p;	j = 0;	while ((((r=RR(1,6))&go)||(stop&&(!(r&stop))))&&(j++<PCD_SPIN))		udelay(PCD_DELAY);	if ((r&(IDE_ERR&stop))||(j>=PCD_SPIN)) {	   s = RR(0,7);	   e = RR(0,1);	   p = RR(0,2);       	   if (j >= PCD_SPIN) e |= 0x100;           if (fun) printk("%s: %s %s: alt=0x%x stat=0x%x err=0x%x"			   " loop=%d phase=%d\n",			    PCD.name,fun,msg,r,s,e,j,p);	   return (s<<8)+r;	}	return 0;}static int pcd_command( int unit, char * cmd, int dlen, char * fun ){	pi_connect(PI);        WR(0,6,0xa0 + 0x10*PCD.drive);	if (pcd_wait(unit,IDE_BUSY|IDE_DRQ,0,fun,"before command")) {		pi_disconnect(PI);		return -1;	}        WR(0,4,dlen % 256);        WR(0,5,dlen / 256);        WR(0,7,0xa0);          /* ATAPI packet command */        if (pcd_wait(unit,IDE_BUSY,IDE_DRQ,fun,"command DRQ")) {		pi_disconnect(PI);		return -1;	}        if (RR(0,2) != 1) {           printk("%s: %s: command phase error\n",PCD.name,fun);	   pi_disconnect(PI);           return -1;        }	pi_write_block(PI,cmd,12);	return 0;}static int pcd_completion( int unit, char * buf,  char * fun ){	int r, d, p, n, k, j;	r = -1; k = 0; j = 0;	if (!pcd_wait(unit,IDE_BUSY,IDE_DRQ|IDE_READY|IDE_ERR,						fun,"completion")) {	    r = 0;	    while (RR(0,7)&IDE_DRQ) {	        d = (RR(0,4)+256*RR(0,5));	        n = ((d+3)&0xfffc);	        p = RR(0,2)&3;	        if ((p == 2) && (n > 0) && (j == 0)) {		    pi_read_block(PI,buf,n);	            if (verbose > 1) 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区在线观看| 成人app在线观看| 久久国内精品视频| 国产不卡在线一区| 欧美在线小视频| 欧美一区二区三区免费大片| 久久久久久久久久久电影| 7777精品伊人久久久大香线蕉超级流畅| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚洲人成在线播放网站岛国| 亚洲日本在线天堂| 男女男精品网站| 国产三级一区二区三区| 亚洲视频一区在线观看| 亚洲成av人片一区二区| 欧美一级搡bbbb搡bbbb| 国产一区91精品张津瑜| 91丨九色丨黑人外教| 国产乱人伦偷精品视频不卡 | 美国精品在线观看| 日本系列欧美系列| 97久久精品人人爽人人爽蜜臀 | av欧美精品.com| 色老汉一区二区三区| 婷婷丁香久久五月婷婷| 久久亚洲捆绑美女| 欧洲另类一二三四区| 天堂一区二区在线免费观看| 不卡一卡二卡三乱码免费网站| 日韩免费高清电影| 成人av网站在线观看| 国产精品乱码妇女bbbb| 精品一区二区三区在线观看| 国产视频一区二区三区在线观看| 亚洲综合自拍偷拍| av激情亚洲男人天堂| 精品婷婷伊人一区三区三| 中文在线免费一区三区高中清不卡| 狠狠色丁香婷综合久久| 欧美精品日日鲁夜夜添| 韩国精品在线观看| 悠悠色在线精品| 欧美精品一区二区不卡| 99久久精品国产网站| 亚洲日穴在线视频| 日韩三级伦理片妻子的秘密按摩| 成人成人成人在线视频| 亚洲一区在线视频| 欧美精品丝袜久久久中文字幕| 夜夜精品浪潮av一区二区三区| 亚洲6080在线| 亚洲精品一区二区三区在线观看| 岛国一区二区三区| 色哟哟一区二区三区| 日韩免费高清视频| 日本成人中文字幕| 日韩一区二区电影网| 久久超级碰视频| 日韩视频在线永久播放| 美女网站视频久久| 26uuu精品一区二区在线观看| 国产米奇在线777精品观看| 久久网站热最新地址| 国产成人一级电影| 亚洲国产精品高清| 日本欧美肥老太交大片| 欧美草草影院在线视频| 亚洲影院在线观看| 91精品国产日韩91久久久久久| 看片网站欧美日韩| 国产欧美日韩亚州综合 | 成人午夜精品一区二区三区| 精品国产伦一区二区三区免费| 韩国v欧美v日本v亚洲v| 国产欧美一区二区精品性色超碰 | 亚洲综合另类小说| 欧美一区二区三区日韩视频| 黑人精品欧美一区二区蜜桃| 久久久久99精品国产片| 日韩高清在线不卡| 国产乱国产乱300精品| 午夜精品在线看| 天天亚洲美女在线视频| 亚洲高清视频在线| 日本美女一区二区三区视频| 国产精品99久久久久久似苏梦涵| www.成人在线| 欧美日高清视频| 中文字幕视频一区| 欧美三电影在线| eeuss影院一区二区三区| 亚洲午夜精品在线| 国产精品久久久久久户外露出 | 九一九一国产精品| 国产精品日韩精品欧美在线| 欧美色窝79yyyycom| 成人黄色av网站在线| 午夜精品福利久久久| 国产三级三级三级精品8ⅰ区| 在线看国产一区二区| 成人国产精品免费网站| 视频一区视频二区在线观看| 久久综合狠狠综合| 日韩欧美一区二区久久婷婷| 成年人午夜久久久| 国产剧情在线观看一区二区| 午夜影院久久久| 国产精品国产自产拍高清av | 在线不卡欧美精品一区二区三区| 国产高清成人在线| 亚洲国产精品久久一线不卡| 一区二区三区日韩| 久久久久99精品国产片| 欧美一区二区三区免费大片| 欧美综合久久久| 9久草视频在线视频精品| 日本在线播放一区二区三区| 亚洲午夜精品在线| 亚洲人精品一区| 久久午夜电影网| 欧美va亚洲va国产综合| 777奇米四色成人影色区| 678五月天丁香亚洲综合网| 欧美色网站导航| 91精品久久久久久蜜臀| 欧美日韩精品一区二区三区蜜桃| 99精品在线观看视频| 91在线视频免费91| 成人免费毛片片v| 日本乱码高清不卡字幕| 本田岬高潮一区二区三区| 国产91综合网| 91福利在线观看| 99久久精品国产一区| 波多野结衣在线aⅴ中文字幕不卡| 一本久久a久久免费精品不卡| 成人app在线| 成人免费视频caoporn| 国产一区二区久久| 久久99久久精品| 久久 天天综合| 久久电影网站中文字幕 | 精品一区二区三区的国产在线播放| 日本亚洲天堂网| 亚洲妇熟xx妇色黄| 国产欧美日韩综合| 亚洲一区精品在线| 欧美aa在线视频| 国产成人精品影视| 91免费观看视频| 欧美日韩免费视频| 久久久久亚洲综合| 中文字幕亚洲不卡| 1024精品合集| 日韩中文字幕亚洲一区二区va在线| 欧美aaaaa成人免费观看视频| 日韩精品电影在线| 国产成人亚洲综合a∨婷婷图片| 成人免费av网站| 日韩情涩欧美日韩视频| 久久色在线视频| 国产欧美一区二区精品性色超碰| 一区二区国产盗摄色噜噜| 日韩av不卡一区二区| 波多野结衣一区二区三区| 欧美色图天堂网| 日韩网站在线看片你懂的| 综合在线观看色| 日本成人在线网站| 91欧美一区二区| 欧美电影精品一区二区| 欧美理论电影在线| 成人免费视频在线观看| 日韩av一区二区三区四区| av动漫一区二区| 欧美成人猛片aaaaaaa| 国产片一区二区| 毛片一区二区三区| 91丨九色porny丨蝌蚪| 在线精品视频免费播放| 欧美日韩免费电影| 久久久久国产精品人| 玉足女爽爽91| 欧美不卡一区二区三区四区| 国产精品久99| 国产综合久久久久久鬼色| 欧美一区二区三区日韩视频| 亚洲综合色成人| 91社区在线播放| 国产精品丝袜91| 国产成人免费视频一区| 国产偷国产偷亚洲高清人白洁| 奇米影视一区二区三区小说| 欧美日韩一二三| 亚洲一二三四在线| 欧美色涩在线第一页| 亚洲图片欧美色图| 欧美疯狂性受xxxxx喷水图片| 视频一区二区不卡| 亚洲欧美一区二区在线观看|