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

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

?? seagate.c

?? <Linux1.0核心游記>電子書+書后源碼+Linux1.0源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* *	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--;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产高清成人在线| 日本v片在线高清不卡在线观看| 国产福利一区二区三区视频在线| 欧美精品一区二区三区蜜臀| 麻豆国产一区二区| 国产日韩欧美一区二区三区乱码 | 久久午夜国产精品| 国产ts人妖一区二区| 亚洲视频在线一区观看| 在线看一区二区| 麻豆中文一区二区| 国产精品免费人成网站| 一本在线高清不卡dvd| 午夜精品123| 国产色产综合产在线视频| 99热这里都是精品| 男人的j进女人的j一区| 中文字幕欧美区| 欧美日韩一区二区三区在线| 六月丁香婷婷久久| 亚洲视频免费观看| 欧美成人女星排名| 色哟哟国产精品免费观看| 男女性色大片免费观看一区二区 | 一区二区三区在线播| 欧美日韩成人在线| 成人黄动漫网站免费app| 午夜精品久久久久久久99樱桃| 精品福利在线导航| 色婷婷亚洲一区二区三区| 国内国产精品久久| 亚洲国产精品影院| 中文av一区特黄| 在线不卡一区二区| 99v久久综合狠狠综合久久| 久久精品国产成人一区二区三区| 亚洲欧美日韩国产手机在线 | 日韩久久精品一区| 91年精品国产| 日韩一级大片在线观看| 精品国产乱码久久久久久久| 日韩一区二区视频在线观看| 亚洲国产视频一区| 国产精品视频九色porn| 欧美一区二区三区免费大片| 91在线免费播放| 国产一区不卡视频| 日韩—二三区免费观看av| 亚洲天堂av一区| 中文字幕精品一区二区三区精品| 欧美一区二区成人| 欧美日韩视频在线一区二区| 一本到不卡免费一区二区| 粉嫩av一区二区三区在线播放| 久久精品国产第一区二区三区| 午夜成人在线视频| 樱花草国产18久久久久| 国产精品久久久久影院老司| 国产午夜精品久久| 欧美精品一区二区三区久久久| 欧美精品在欧美一区二区少妇| 色综合久久久久综合| av动漫一区二区| 成人网男人的天堂| 国产一区不卡在线| 国产大陆a不卡| 国产一区三区三区| 国产一区二区免费看| 久久av资源网| 国产米奇在线777精品观看| 国产在线观看免费一区| 国产麻豆9l精品三级站| 国产成人自拍高清视频在线免费播放| 精品一区二区三区视频| 国产一二精品视频| 成人自拍视频在线| www.亚洲国产| 91小视频在线免费看| 成人av电影在线| 色综合久久久久久久久| 在线观看精品一区| 欧美日韩免费一区二区三区| 欧美无乱码久久久免费午夜一区| 欧美午夜精品电影| 欧美一区午夜精品| 久久久久久久久久久99999| 欧美激情在线免费观看| 亚洲欧美另类久久久精品| 亚洲一区二区欧美日韩| 无码av免费一区二区三区试看| 日韩电影在线一区二区三区| 极品瑜伽女神91| 成人在线综合网站| 91国产成人在线| 日韩欧美一卡二卡| 久久久www免费人成精品| 综合激情网...| 午夜国产不卡在线观看视频| 精油按摩中文字幕久久| 成人蜜臀av电影| 欧美日韩一二区| 精品久久久久久无| 亚洲欧美另类图片小说| 青草av.久久免费一区| 国产91精品一区二区麻豆网站| 色婷婷国产精品| 欧美va日韩va| 亚洲欧美综合在线精品| 天堂一区二区在线| 国产成人丝袜美腿| 欧美天堂一区二区三区| 久久久久久综合| 一区二区三区在线观看视频| 久草中文综合在线| 色丁香久综合在线久综合在线观看| 日韩一区二区在线看| 最新欧美精品一区二区三区| 天堂久久久久va久久久久| 成人看片黄a免费看在线| 欧美群妇大交群的观看方式| 中文成人av在线| 免费久久精品视频| 91福利小视频| 久久久国产一区二区三区四区小说 | 奇米影视一区二区三区| 成人午夜电影小说| 欧美电视剧在线观看完整版| 亚洲天堂精品在线观看| 精品一区二区三区香蕉蜜桃 | 欧美这里有精品| 中文成人综合网| 美国一区二区三区在线播放| 在线亚洲精品福利网址导航| 日本一区二区三区免费乱视频 | 国产日韩欧美不卡| 日韩和欧美一区二区三区| 一本大道久久a久久精二百| 国产亚洲欧美日韩俺去了| 日韩精品乱码av一区二区| 91欧美一区二区| 日本一二三四高清不卡| 久久99热99| 777午夜精品免费视频| 亚洲精品成人天堂一二三| 成人av中文字幕| 久久综合色鬼综合色| 日韩国产成人精品| 欧美日韩在线电影| 亚洲一区二区成人在线观看| caoporm超碰国产精品| 久久久亚洲精品石原莉奈| 青青草精品视频| 在线播放一区二区三区| 亚洲综合久久久久| 欧美亚洲另类激情小说| 亚洲美女免费视频| 91美女视频网站| **欧美大码日韩| 99久久精品一区| 亚洲欧美综合色| 91蜜桃免费观看视频| 亚洲欧美偷拍三级| 91高清视频在线| 亚洲一二三专区| 欧美午夜精品电影| 偷拍与自拍一区| 日韩一本二本av| 精品一区免费av| 久久夜色精品国产噜噜av| 国产一区不卡精品| 中文字幕不卡在线| 91香蕉视频在线| 亚洲一区二区在线播放相泽| 欧美日韩小视频| 美女www一区二区| 久久精品一二三| 成人午夜在线视频| 亚洲精品午夜久久久| 欧美日产在线观看| 久久成人18免费观看| 亚洲免费大片在线观看| 99久久免费视频.com| 亚洲国产日韩a在线播放| 正在播放一区二区| 精一区二区三区| 日本一区二区成人在线| 色av成人天堂桃色av| 日韩中文字幕亚洲一区二区va在线 | 一区2区3区在线看| 欧美一区二区精品| 国产成人99久久亚洲综合精品| 国产欧美日产一区| 91在线你懂得| 日本va欧美va精品| 国产欧美一区二区三区鸳鸯浴| 色综合亚洲欧洲| 久久精品二区亚洲w码| 国产精品色婷婷| 91精品国产全国免费观看| 国产成人在线视频网站|