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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? seagate.c

?? linux 1.0 源代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* *	seagate.c Copyright (C) 1992, 1993 Drew Eckhardt  *	low level scsi driver for ST01/ST02, Future Domain TMC-885,  *	TMC-950  by * *		Drew Eckhardt  * *	<drew@colorado.edu> * * 	Note : TMC-880 boards don't work because they have two bits in  *		the status register flipped, I'll fix this "RSN" * *      This card does all the I/O via memory mapped I/O, so there is no need *      to check or snarf a region of the I/O address space. *//* * Configuration :  * To use without BIOS -DOVERRIDE=base_address -DCONTROLLER=FD or SEAGATE * -DIRQ will overide the default of 5. * Note: You can now set these options from the kernel's "command line". * The syntax is: * *     st0x=ADDRESS,IRQ                (for a Seagate controller) * or: *     tmc8xx=ADDRESS,IRQ              (for a TMC-8xx or TMC-950 controller) * eg: *     tmc8xx=0xC8000,15 * * will configure the driver for a TMC-8xx style controller using IRQ 15 * with a base address of 0xC8000. *  * -DFAST or -DFAST32 will use blind transfers where possible * * -DARBITRATE will cause the host adapter to arbitrate for the  *	bus for better SCSI-II compatability, rather than just  *	waiting for BUS FREE and then doing its thing.  Should *	let us do one command per Lun when I integrate my  *	reorganization changes into the distribution sources. * * -DSLOW_HANDSHAKE will allow compatability with broken devices that don't  *	handshake fast enough (ie, some CD ROM's) for the Seagate * 	code. * * -DSLOW_RATE=x, x some number will let you specify a default  *	transfer rate if handshaking isn't working correctly. */#include <linux/config.h>#if defined(CONFIG_SCSI_SEAGATE) || defined(CONFIG_SCSI_FD_8xx) #include <asm/io.h>#include <asm/system.h>#include <linux/signal.h>#include <linux/sched.h>#include <linux/string.h>#include "../block/blk.h"#include "scsi.h"#include "hosts.h"#include "seagate.h"#include "constants.h"#ifndef IRQ#define IRQ 5#endif#if (defined(FAST32) && !defined(FAST))#define FAST#endif#if defined(SLOW_RATE) && !defined(SLOW_HANDSHAKE)#define SLOW_HANDSHAKE#endif#if defined(SLOW_HANDSHAKE) && !defined(SLOW_RATE)#define SLOW_RATE 50#endif#if defined(LINKED)#undef LINKED		/* Linked commands are currently broken ! */#endifstatic int internal_command(unsigned char target, unsigned char lun,			    const void *cmnd,			 void *buff, int bufflen, int reselect);static int incommand;			/*						set if arbitration has finished and we are 						in some command phase.					*/static void *base_address = NULL;	/*						Where the card ROM starts,						used to calculate memory mapped						register location.					*/static volatile int abort_confirm = 0;static volatile void *st0x_cr_sr;       /*						control register write,						status register read.						256 bytes in length.						Read is status of SCSI BUS,						as per STAT masks.					*/static volatile void *st0x_dr;         /*						data register, read write						256 bytes in length.					*/static volatile int st0x_aborted=0;	/* 						set when we are aborted, ie by a time out, etc.					*/static unsigned char controller_type = 0; /* set to SEAGATE for ST0x boards or FD for TMC-8xx boards */static unsigned char irq = IRQ;			#define retcode(result) (((result) << 16) | (message << 8) | status) 			#define STATUS (*(volatile unsigned char *) st0x_cr_sr)#define CONTROL STATUS #define DATA (*(volatile unsigned char *) st0x_dr)void st0x_setup (char *str, int *ints) {    controller_type = SEAGATE;    base_address = (void *) ints[1];    irq = ints[2];}void tmc8xx_setup (char *str, int *ints) {    controller_type = FD;    base_address = (void *) ints[1];    irq = ints[2];}    #ifndef OVERRIDE		static const char *  seagate_bases[] = {	(char *) 0xc8000, (char *) 0xca000, (char *) 0xcc000,	(char *) 0xce000, (char *) 0xdc000, (char *) 0xde000};typedef struct {	char *signature ;	unsigned offset;	unsigned length;	unsigned char type;} Signature;	static const Signature signatures[] = {#ifdef CONFIG_SCSI_SEAGATE{"ST01 v1.7  (C) Copyright 1987 Seagate", 15, 37, SEAGATE},{"SCSI BIOS 2.00  (C) Copyright 1987 Seagate", 15, 40, SEAGATE},/* * The following two lines are NOT mistakes.  One detects ROM revision  * 3.0.0, the other 3.2.  Since seagate has only one type of SCSI adapter,  * and this is not going to change, the "SEAGATE" and "SCSI" together * are probably "good enough" */{"SEAGATE SCSI BIOS ",16, 17, SEAGATE},{"SEAGATE SCSI BIOS ",17, 17, SEAGATE},/* * However, future domain makes several incompatable SCSI boards, so specific * signatures must be used. */{"FUTURE DOMAIN CORP. (C) 1986-1989 V5.0C2/14/89", 5, 46, FD},{"FUTURE DOMAIN CORP. (C) 1986-1989 V6.0A7/28/89", 5, 46, FD},{"FUTURE DOMAIN CORP. (C) 1986-1990 V6.0105/31/90",5, 47, FD},{"FUTURE DOMAIN CORP. (C) 1986-1990 V6.0209/18/90",5, 47, FD},{"FUTURE DOMAIN CORP. (C) 1986-1990 V7.009/18/90", 5, 46, FD},{"FUTURE DOMAIN CORP. (C) 1992 V8.00.004/02/92",   5, 44, FD},{"FUTURE DOMAIN TMC-950",                        5, 21, FD},#endif /* CONFIG_SCSI_SEAGATE */};#define NUM_SIGNATURES (sizeof(signatures) / sizeof(Signature))#endif /* n OVERRIDE *//* * hostno stores the hostnumber, as told to us by the init routine. */static int hostno = -1;static void seagate_reconnect_intr(int);#ifdef FASTstatic int fast = 1;#endif #ifdef SLOW_HANDSHAKE/*  * Support for broken devices :  * The Seagate board has a handshaking problem.  Namely, a lack  * thereof for slow devices.  You can blast 600K/second through  * it if you are polling for each byte, more if you do a blind  * transfer.  In the first case, with a fast device, REQ will  * transition high-low or high-low-high before your loop restarts  * and you'll have no problems.  In the second case, the board  * will insert wait states for up to 13.2 usecs for REQ to  * transition low->high, and everything will work. * * However, there's nothing in the state machine that says  * you *HAVE* to see a high-low-high set of transitions before * sending the next byte, and slow things like the Trantor CD ROMS * will break because of this. *  * So, we need to slow things down, which isn't as simple as it  * seems.  We can't slow things down period, because then people * who don't recompile their kernels will shoot me for ruining  * their performance.  We need to do it on a case per case basis. * * The best for performance will be to, only for borken devices  * (this is stored on a per-target basis in the scsi_devices array) *  * Wait for a low->high transition before continuing with that  * transfer.  If we timeout, continue anyways.  We don't need  * a long timeout, because REQ should only be asserted until the  * corresponding ACK is recieved and processed. * * Note that we can't use the system timer for this, because of  * resolution, and we *really* can't use the timer chip since  * gettimeofday() and the beeper routines use that.  So, * the best thing for us to do will be to calibrate a timing * loop in the initialization code using the timer chip before * gettimeofday() can screw with it. */static int borken_calibration = 0;static void borken_init (void) {  register int count = 0, start = jiffies + 1, stop = start + 25;  while (jiffies < start);  for (;jiffies < stop; ++count);/*  * Ok, we now have a count for .25 seconds.  Convert to a  * count per second and divide by transer rate in K. */  borken_calibration =  (count * 4) / (SLOW_RATE*1024);  if (borken_calibration < 1)  	borken_calibration = 1;#if (DEBUG & DEBUG_BORKEN)  printk("scsi%d : borken calibrated to %dK/sec, %d cycles per transfer\n", 	hostno, BORKEN_RATE, borken_calibration);#endif}static inline void borken_wait(void) {  register int count;  for (count = borken_calibration; count && (STATUS & STAT_REQ);   	--count);  if (count)#if (DEBUG & DEBUG_BORKEN)   	printk("scsi%d : borken timeout\n", hostno);#else	;#endif }#endif /* def SLOW_HANDSHAKE */int seagate_st0x_detect (int hostnum)	{#ifndef OVERRIDE	int i,j;#endif static struct sigaction seagate_sigaction = {	&seagate_reconnect_intr,	0,	SA_INTERRUPT,	NULL};/* *	First, we try for the manual override. */#ifdef DEBUG 	printk("Autodetecting seagate ST0x\n");#endif		if (hostno != -1)		{		printk ("ERROR : seagate_st0x_detect() called twice.\n");		return 0;		}      /* If the user specified the controller type from the command line,         controller_type will be non-zero, so don't try and detect one */	if (!controller_type) {#ifdef OVERRIDE	base_address = (void *) OVERRIDE;/* CONTROLLER is used to override controller (SEAGATE or FD). PM: 07/01/93 */#ifdef CONTROLLER	controller_type = CONTROLLER;#else#error Please use -DCONTROLLER=SEAGATE or -DCONTROLLER=FD to override controller type#endif /* CONTROLLER */#ifdef DEBUG	printk("Base address overridden to %x, controller type is %s\n",		base_address,controller_type == SEAGATE ? "SEAGATE" : "FD");#endif #else /* OVERIDE */	/* *	To detect this card, we simply look for the signature *	from the BIOS version notice in all the possible locations *	of the ROM's.  This has a nice sideeffect of not trashing * 	any register locations that might be used by something else. * * XXX - note that we probably should be probing the address * space for the on-board RAM instead. */	for (i = 0; i < (sizeof (seagate_bases) / sizeof (char  * )); ++i)		for (j = 0; !base_address && j < NUM_SIGNATURES; ++j)		if (!memcmp ((void *) (seagate_bases[i] +		    signatures[j].offset), (void *) signatures[j].signature,		    signatures[j].length)) {			base_address = (void *) seagate_bases[i];			controller_type = signatures[j].type;		}#endif /* OVERIDE */	} /* (! controller_type) */ 	scsi_hosts[hostnum].this_id = (controller_type == SEAGATE) ? 7 : 6;	if (base_address)		{		st0x_cr_sr =(void *) (((unsigned char *) base_address) + (controller_type == SEAGATE ? 0x1a00 : 0x1c00)); 		st0x_dr = (void *) (((unsigned char *) base_address ) + (controller_type == SEAGATE ? 0x1c00 : 0x1e00));#ifdef DEBUG		printk("ST0x detected. Base address = %x, cr = %x, dr = %x\n", base_address, st0x_cr_sr, st0x_dr);#endif/* *	At all times, we will use IRQ 5.  Should also check for IRQ3 if we  * 	loose our first interrupt. */		hostno = hostnum;		if (irqaction((int) irq, &seagate_sigaction)) {			printk("scsi%d : unable to allocate IRQ%d\n",				hostno, (int) irq);			return 0;		}#ifdef SLOW_HANDSHAKE		borken_init();#endif				return 1;		}	else		{#ifdef DEBUG		printk("ST0x not detected.\n");#endif		return 0;		}	}	 const char *seagate_st0x_info(void) {      static char buffer[256];        sprintf(buffer, "scsi%d : %s at irq %d address %p options :"#ifdef ARBITRATE" ARBITRATE"#endif#ifdef SLOW_HANDSHAKE" SLOW_HANDSHAKE"#endif#ifdef FAST#ifdef FAST32" FAST32"#else" FAST"#endif#endif #ifdef LINKED" LINKED"#endif              "\n", hostno, (controller_type == SEAGATE) ? "seagate" :               "FD TMC-8xx", irq, base_address);        return buffer;}/* * These are our saved pointers for the outstanding command that is  * waiting for a reconnect */static unsigned char current_target, current_lun;static unsigned char *current_cmnd, *current_data;static int current_nobuffs;static struct scatterlist *current_buffer;static int current_bufflen;#ifdef LINKED/*  * linked_connected indicates weather or not we are currently connected to  * linked_target, linked_lun and in an INFORMATION TRANSFER phase, * using linked commands. */static int linked_connected = 0;static unsigned char linked_target, linked_lun;#endifstatic void (*done_fn)(Scsi_Cmnd *) = NULL;static Scsi_Cmnd * SCint = NULL;/* * These control whether or not disconnect / reconnect will be attempted, * or are being attempted. */#define NO_RECONNECT 	0#define RECONNECT_NOW 	1#define CAN_RECONNECT	2#ifdef LINKED/* * LINKED_RIGHT indicates that we are currently connected to the correct target * for this command, LINKED_WRONG indicates that we are connected to the wrong  * target.  Note that these imply CAN_RECONNECT. */#define LINKED_RIGHT 	3#define LINKED_WRONG	4#endif/* * This determines if we are expecting to reconnect or not. */static int should_reconnect = 0;/* * The seagate_reconnect_intr routine is called when a target reselects the  * host adapter.  This occurs on the interrupt triggered by the target  * asserting SEL. */static void seagate_reconnect_intr (int unused)	{	int temp;	Scsi_Cmnd * SCtmp;/* enable all other interrupts. */		sti();#if (DEBUG & PHASE_RESELECT)	printk("scsi%d : seagate_reconnect_intr() called\n", hostno);#endif	if (!should_reconnect)	    printk("scsi%d: unexpected interrupt.\n", hostno);	else {		 should_reconnect = 0;#if (DEBUG & PHASE_RESELECT)		printk("scsi%d : internal_command("		       "%d, %08x, %08x, %d, RECONNECT_NOW\n", hostno, 			current_target, current_data, current_bufflen);#endif			temp =  internal_command (current_target, current_lun,			current_cmnd, current_data, current_bufflen,			RECONNECT_NOW);		if (msg_byte(temp) != DISCONNECT) {			if (done_fn) {#if (DEBUG & PHASE_RESELECT)				printk("scsi%d : done_fn(%d,%08x)", hostno, 				hostno, temp);#endif				if(!SCint) panic("SCint == NULL in seagate");				SCtmp = SCint;				SCint = NULL;				SCtmp->result = temp;				done_fn (SCtmp);			} else				printk("done_fn() not defined.\n");			}		}	} /*  * The seagate_st0x_queue_command() function provides a queued interface * to the seagate SCSI driver.  Basically, it just passes control onto the * seagate_command() function, after fixing it so that the done_fn() * is set to the one passed to the function.  We have to be very careful, * because there are some commands on some devices that do not disconnect, * and if we simply call the done_fn when the command is done then another * command is started and queue_command is called again...  We end up * overflowing the kernel stack, and this tends not to be such a good idea. */static int recursion_depth = 0;int seagate_st0x_queue_command (Scsi_Cmnd * SCpnt,  void (*done)(Scsi_Cmnd *))	{	int result, reconnect;	Scsi_Cmnd * SCtmp;	done_fn = done;	current_target = SCpnt->target;	current_lun = SCpnt->lun;	(const void *) current_cmnd = SCpnt->cmnd;	current_data = (unsigned char *) SCpnt->request_buffer;	current_bufflen = SCpnt->request_bufflen;	SCint = SCpnt;	if(recursion_depth) {	  return 0;	};	recursion_depth++;	do{#ifdef LINKED/* * Set linked command bit in control field of SCSI command. */	  current_cmnd[COMMAND_SIZE(current_cmnd[0])] |= 0x01;	  if (linked_connected) {#if (DEBUG & DEBUG_LINKED) 	    printk("scsi%d : using linked commands, current I_T_L nexus is ",	      hostno);#endif	    if ((linked_target == current_target) && 	      (linked_lun == current_lun)) {#if (DEBUG & DEBUG_LINKED) 	    printk("correct\n");#endif	      reconnect = LINKED_RIGHT;	    } else {#if (DEBUG & DEBUG_LINKED) 	    printk("incorrect\n");#endif	      reconnect = LINKED_WRONG;	    }	  } else #endif /* LINKED */	    reconnect = CAN_RECONNECT;	  result = internal_command (SCint->target, SCint->lun, SCint->cmnd, SCint->request_buffer,				     SCint->request_bufflen, 				     reconnect);	  if (msg_byte(result) == DISCONNECT)  break;	  SCtmp = SCint;	  SCint = NULL;	  SCtmp->result = result;	  done_fn (SCtmp);	} while(SCint);	recursion_depth--;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区在线播放| 欧美久久久久久久久久| 一本色道a无线码一区v| 欧美日韩一级二级| 26uuu成人网一区二区三区| 国产精品夫妻自拍| 午夜欧美大尺度福利影院在线看| 久久国产三级精品| 99r精品视频| 欧美一区二区久久| 亚洲欧美一区二区视频| 免费日韩伦理电影| av色综合久久天堂av综合| 欧美精品第1页| 中文字幕不卡在线| 亚洲成人av电影在线| 国产毛片精品国产一区二区三区| 色综合久久综合网欧美综合网| 91.com在线观看| 国产精品国产三级国产aⅴ原创| 性做久久久久久| 99久久精品99国产精品| 日韩免费一区二区三区在线播放| 中文字幕一区二区视频| 蜜桃久久久久久| 在线看国产日韩| 国产人成一区二区三区影院| 午夜精品久久一牛影视| 99v久久综合狠狠综合久久| 日韩欧美的一区| 亚洲国产色一区| av一区二区不卡| 久久精品人人做人人爽97| 日精品一区二区| 91福利区一区二区三区| 国产欧美日韩卡一| 卡一卡二国产精品| 在线播放国产精品二区一二区四区| 日本一区二区电影| 国产露脸91国语对白| 欧美一级片免费看| 亚洲国产美女搞黄色| www.亚洲人| 久久精品亚洲精品国产欧美kt∨| 日韩电影一区二区三区四区| 日本高清免费不卡视频| 国产精品伦一区二区三级视频| 久草中文综合在线| 91精品国产一区二区三区蜜臀| 一区二区免费视频| 99re这里只有精品6| 国产欧美日韩不卡免费| 国产一区二区电影| 欧美sm极限捆绑bd| 免费观看成人av| 91麻豆精品国产91久久久久久| 亚洲综合自拍偷拍| 在线中文字幕一区二区| 最新不卡av在线| av色综合久久天堂av综合| 国产精品嫩草影院av蜜臀| 国内久久精品视频| 精品久久久久av影院| 久久精品国产亚洲a| 91精品国产综合久久久久| 亚洲成a人片在线观看中文| 欧美性生活影院| 亚洲欧洲日韩av| 91丨porny丨国产入口| 亚洲欧洲日韩综合一区二区| 成人亚洲精品久久久久软件| 国产日韩欧美高清| 粉嫩久久99精品久久久久久夜| 久久精品人人爽人人爽| 国产成人精品影视| 国产精品免费人成网站| 成+人+亚洲+综合天堂| 国产精品伦一区二区三级视频| 成人app软件下载大全免费| 中文字幕永久在线不卡| 成人午夜电影久久影院| 成人免费在线视频观看| 91免费版在线| 亚洲1区2区3区视频| 欧美一区二区三区视频在线观看 | 粉嫩蜜臀av国产精品网站| 国产女人水真多18毛片18精品视频| 国产精品白丝jk白祙喷水网站| 国产目拍亚洲精品99久久精品| www.成人网.com| 亚洲午夜久久久久中文字幕久| 337p亚洲精品色噜噜| 另类中文字幕网| 日本一区二区不卡视频| 91丨九色丨蝌蚪丨老版| 亚洲成人一区二区| 精品少妇一区二区三区在线视频| 国产精品一二三四| 亚洲精品你懂的| 欧美一区二区黄色| 成人精品一区二区三区四区| 一区二区三区在线观看视频| 51午夜精品国产| 国产露脸91国语对白| 亚洲欧美激情视频在线观看一区二区三区 | 这里只有精品视频在线观看| 久久精品国产秦先生| 国产精品丝袜91| 欧美视频一区在线观看| 久久国产福利国产秒拍| 国产精品成人免费| 欧美久久久久久久久中文字幕| 精品午夜久久福利影院| 亚洲欧洲制服丝袜| 日韩欧美的一区二区| 99久久久久久| 美女诱惑一区二区| 亚洲女与黑人做爰| 精品少妇一区二区三区| 色一情一乱一乱一91av| 免费高清在线一区| 亚洲精品一二三| 精品国产乱码久久久久久1区2区| 91一区在线观看| 久久9热精品视频| 亚洲黄色性网站| 精品成人一区二区三区| 色噜噜狠狠色综合中国| 国产曰批免费观看久久久| 亚洲在线视频网站| 欧美激情艳妇裸体舞| 5858s免费视频成人| 不卡的av电影| 久久精品免费观看| 亚洲第一搞黄网站| 中文字幕亚洲在| 亚洲精品在线网站| 欧美日韩免费观看一区三区| 丁香六月综合激情| 另类小说综合欧美亚洲| 亚洲精品亚洲人成人网在线播放| 久久久不卡网国产精品二区| 欧美日韩成人综合天天影院 | 亚洲欧美日韩国产另类专区| 欧美大片免费久久精品三p| 色菇凉天天综合网| 成人性生交大片免费看在线播放| 天天影视网天天综合色在线播放| 国产精品福利影院| 国产欧美日本一区二区三区| 日韩欧美成人一区二区| 精品视频全国免费看| 色综合久久久久网| 成人av免费观看| 国产精品一区二区你懂的| 日本伊人色综合网| 亚洲高清免费观看 | 欧美精品一级二级三级| 色综合欧美在线视频区| 成人h精品动漫一区二区三区| 韩国三级在线一区| 免费一级欧美片在线观看| 午夜精品久久久久久不卡8050| 亚洲免费av高清| 日韩理论片一区二区| 中文字幕一区二区三区在线播放| 久久精品人人爽人人爽| www精品美女久久久tv| 精品sm捆绑视频| 欧美大片在线观看一区| 日韩欧美123| 日韩一区二区精品葵司在线| 911精品国产一区二区在线| 欧美日韩黄色一区二区| 欧美日韩综合不卡| 欧美三级资源在线| 欧美日韩成人激情| 在线综合视频播放| 91精品欧美久久久久久动漫| 欧美男男青年gay1069videost| 欧美性色黄大片手机版| 91久久香蕉国产日韩欧美9色| 色综合天天综合在线视频| 91网站黄www| 欧美亚洲综合久久| 欧美性猛交一区二区三区精品| 91久久免费观看| 欧美日韩在线播| 91精品国产综合久久久久久久 | 精品午夜一区二区三区在线观看| 久久国产精品露脸对白| 国产乱理伦片在线观看夜一区| 国产麻豆精品theporn| 国产激情视频一区二区在线观看| 成人综合婷婷国产精品久久| 97se亚洲国产综合在线| 一本到三区不卡视频| 欧美性生活久久| 欧美一级高清片| 日本一区二区三区免费乱视频|