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

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

?? scsi.c

?? linux0.99源代碼用于研究linux操作系統
?? C
?? 第 1 頁 / 共 3 頁
字號:
      } else {	if (req) {	  memcpy(&SCpnt->request, req, sizeof(struct request));	  req->dev = -1;	  *reqp = req->next;	} else {	  SCpnt->request.dev = 0xffff; /* Busy */	};	sti();	break;      };  };  SCpnt->use_sg = 0;  /* Reset the scatter-gather flag */  return SCpnt;}/*	This is inline because we have stack problemes if we recurse to deeply.*/			 inline void internal_cmnd (Scsi_Cmnd * SCpnt)	{	int temp, host;#ifdef DEBUG_DELAY		int clock;#endif	host = SCpnt->host;	if ((host < 0) ||  (host > max_scsi_hosts))		panic ("Host number in internal_cmnd() is out of range.\n");/*	We will wait MIN_RESET_DELAY clock ticks after the last reset so 	we can avoid the drive not being ready.*/ temp = last_reset[host];while (jiffies < temp);update_timeout(SCpnt, SCpnt->timeout_per_command);/*	We will use a queued command if possible, otherwise we will emulate the	queing and calling of completion function ourselves. */#ifdef DEBUG	printk("internal_cmnd (host = %d, target = %d, command = %08x, buffer =  %08x, \n"		"bufflen = %d, done = %08x)\n", SCpnt->host, SCpnt->target, SCpnt->cmnd, SCpnt->buffer, SCpnt->bufflen, SCpnt->done);#endif        if (scsi_hosts[host].can_queue)		{#ifdef DEBUG	printk("queuecommand : routine at %08x\n", 		scsi_hosts[host].queuecommand);#endif                scsi_hosts[host].queuecommand (SCpnt, scsi_done);		}	else		{#ifdef DEBUG	printk("command() :  routine at %08x\n", scsi_hosts[host].command);#endif		temp=scsi_hosts[host].command (SCpnt);	        SCpnt->result = temp;#ifdef DEBUG_DELAY	clock = jiffies + 400;	while (jiffies < clock);	printk("done(host = %d, result = %04x) : routine at %08x\n", host, temp, done);#endif	        scsi_done(SCpnt);		}	#ifdef DEBUG	printk("leaving internal_cmnd()\n");#endif	}	static void scsi_request_sense (Scsi_Cmnd * SCpnt)	{	cli();	SCpnt->flags |= WAS_SENSE;	update_timeout(SCpnt, SENSE_TIMEOUT);	sti();		memcpy ((void *) SCpnt->cmnd , (void *) generic_sense,		sizeof(generic_sense));	SCpnt->cmnd[1] = SCpnt->lun << 5;		SCpnt->cmnd[4] = sizeof(SCpnt->sense_buffer);	SCpnt->request_buffer = &SCpnt->sense_buffer;	SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);	internal_cmnd (SCpnt);	}/*	scsi_do_cmd sends all the commands out to the low-level driver.  It 	handles the specifics required for each low level driver - ie queued 	or non queud.  It also prevents conflicts when different high level 	drivers go for the same host at the same time.*/void scsi_do_cmd (Scsi_Cmnd * SCpnt, const void *cmnd , 		  void *buffer, unsigned bufflen, void (*done)(Scsi_Cmnd *),		  int timeout, int retries 		   )        {	int host = SCpnt->host;#ifdef DEBUG	{	int i;		int target = SCpnt->target;	printk ("scsi_do_cmd (host = %d, target = %d, buffer =%08x, "		"bufflen = %d, done = %08x, timeout = %d, retries = %d)\n"		"command : " , host, target, buffer, bufflen, done, timeout, retries);	for (i = 0; i < 10; ++i)		printk ("%02x  ", ((unsigned char *) cmnd)[i]); 	printk("\n");      };#endif		if ((host < 0) || (host  >= max_scsi_hosts) || !scsi_hosts[host].present)		{		printk ("Invalid or not present host number. %d\n", host);		panic("");		}	/*	We must prevent reentrancy to the lowlevel host driver.  This prevents 	it - we enter a loop until the host we want to talk to is not busy.   	Race conditions are prevented, as interrupts are disabled inbetween the	time we check for the host being not busy, and the time we mark it busy	ourselves.*/	while (1==1){	  cli();	  if (scsi_hosts[host].can_queue	      && host_busy[host] >= scsi_hosts[host].can_queue)	    {	      sti();	      SCSI_SLEEP(&host_wait[host], 			 (host_busy[host] >= scsi_hosts[host].can_queue));	    } else {	      host_busy[host]++;	      sti();	      break;	    };      };/*	Our own function scsi_done (which marks the host as not busy, disables 	the timeout counter, etc) will be called by us or by the 	scsi_hosts[host].queuecommand() function needs to also call	the completion function for the high level driver.*/	memcpy ((void *) SCpnt->data_cmnd , (void *) cmnd, 10);#if 0	SCpnt->host = host;	SCpnt->target = target;	SCpnt->lun = (SCpnt->data_cmnd[1] >> 5);#endif	SCpnt->bufflen = bufflen;	SCpnt->buffer = buffer;	SCpnt->flags=0;	SCpnt->retries=0;	SCpnt->allowed=retries;	SCpnt->done = done;	SCpnt->timeout_per_command = timeout;					memcpy ((void *) SCpnt->cmnd , (void *) cmnd, 10);	SCpnt->request_buffer = buffer;	SCpnt->request_bufflen = bufflen;	/* Start the timer ticking.  */	SCpnt->internal_timeout = 0;	internal_cmnd (SCpnt);#ifdef DEBUG	printk ("Leaving scsi_do_cmd()\n");#endif        }/*	The scsi_done() function disables the timeout timer for the scsi host, 	marks the host as not busy, and calls the user specified completion 	function for that host's current command.*/static void reset (Scsi_Cmnd * SCpnt)	{	#ifdef DEBUG		printk("reset(%d)\n", SCpnt->host);	#endif	SCpnt->flags |= (WAS_RESET | IS_RESETTING);	scsi_reset(SCpnt);	#ifdef DEBUG		printk("performing request sense\n");	#endif	scsi_request_sense (SCpnt);	}		static int check_sense (Scsi_Cmnd * SCpnt)	{	if (((SCpnt->sense_buffer[0] & 0x70) >> 4) == 7) {	        if (SCpnt->sense_buffer[2] &0xe0)		  return SUGGEST_ABORT;		switch (SCpnt->sense_buffer[2] & 0xf)		{		case NO_SENSE:		case RECOVERED_ERROR:			return 0;		case ABORTED_COMMAND:		case NOT_READY:			return SUGGEST_RETRY;			case UNIT_ATTENTION:			return SUGGEST_ABORT;		/* these three are not supported */			case COPY_ABORTED:		case VOLUME_OVERFLOW:		case MISCOMPARE:			case MEDIUM_ERROR:			return SUGGEST_REMAP;		case BLANK_CHECK:		case DATA_PROTECT:		case HARDWARE_ERROR:		case ILLEGAL_REQUEST:		default:			return SUGGEST_ABORT;		}	      }	else		return SUGGEST_RETRY;		}	/* This function is the mid-level interrupt routine, which decides how *  to handle error conditions.  Each invocation of this function must *  do one and *only* one of the following: * *  (1) Call last_cmnd[host].done.  This is done for fatal errors and *      normal completion, and indicates that the handling for this *      request is complete. *  (2) Call internal_cmnd to requeue the command.  This will result in *      scsi_done being called again when the retry is complete. *  (3) Call scsi_request_sense.  This asks the host adapter/drive for *      more information about the error condition.  When the information *      is available, scsi_done will be called again. *  (4) Call reset().  This is sort of a last resort, and the idea is that *      this may kick things loose and get the drive working again.  reset() *      automatically calls scsi_request_sense, and thus scsi_done will be *      called again once the reset is complete. * *      If none of the above actions are taken, the drive in question * will hang. If more than one of the above actions are taken by * scsi_done, then unpredictable behavior will result. */static void scsi_done (Scsi_Cmnd * SCpnt)	{	int status=0;	int exit=0;	int checked;	int oldto;	int host = SCpnt->host;	int result = SCpnt->result;	oldto = update_timeout(SCpnt, 0);#define FINISHED 0#define MAYREDO  1#define REDO	 3#define PENDING  4#ifdef DEBUG	printk("In scsi_done(host = %d, result = %06x)\n", host, result);#endif	if (host > max_scsi_hosts || host  < 0) 		{		update_timeout(SCpnt, 0);		panic("scsi_done() called with invalid host number.\n");		}	switch (host_byte(result))		{	case DID_OK:		if (SCpnt->flags & IS_RESETTING)			{			SCpnt->flags &= ~IS_RESETTING;			status = REDO;			break;			}		if (status_byte(result) && (SCpnt->flags & 		    WAS_SENSE))	/* Failed to obtain sense information */			{			SCpnt->flags &= ~WAS_SENSE;			SCpnt->internal_timeout &= ~SENSE_TIMEOUT;			if (!(SCpnt->flags & WAS_RESET))				{				reset(SCpnt);				return;				}			else				{				exit = (DRIVER_HARD | SUGGEST_ABORT);				status = FINISHED;				}			}		else switch(msg_byte(result))			{			case COMMAND_COMPLETE:			switch (status_byte(result))			{			case GOOD:				if (SCpnt->flags & WAS_SENSE)					{#ifdef DEBUG	printk ("In scsi_done, GOOD status, COMMAND COMPLETE, parsing sense information.\n");#endif					SCpnt->flags &= ~WAS_SENSE;					SCpnt->internal_timeout &= ~SENSE_TIMEOUT;						switch (checked = check_sense(SCpnt))					{					case 0: #ifdef DEBUG	printk("NO SENSE.  status = REDO\n");#endif						update_timeout(SCpnt, oldto);						status = REDO;						break;					case SUGGEST_REMAP:								case SUGGEST_RETRY: #ifdef DEBUG	printk("SENSE SUGGEST REMAP or SUGGEST RETRY - status = MAYREDO\n");#endif						status = MAYREDO;						exit = DRIVER_SENSE | SUGGEST_RETRY;						break;					case SUGGEST_ABORT:#ifdef DEBUG	printk("SENSE SUGGEST ABORT - status = FINISHED");#endif						status = FINISHED;						exit =  DRIVER_SENSE | SUGGEST_ABORT;						break;					default:						printk ("Internal error %s %s \n", __FILE__, 							__LINE__);					}			   					}					else					{#ifdef DEBUG	printk("COMMAND COMPLETE message returned, status = FINISHED. \n");#endif					exit =  DRIVER_OK;					status = FINISHED;					}				break;				case CHECK_CONDITION:#ifdef DEBUG	printk("CHECK CONDITION message returned, performing request sense.\n");#endif				scsi_request_sense (SCpnt);				status = PENDING;				break;       							case CONDITION_GOOD:			case INTERMEDIATE_GOOD:			case INTERMEDIATE_C_GOOD:#ifdef DEBUG	printk("CONDITION GOOD, INTERMEDIATE GOOD, or INTERMEDIATE CONDITION GOOD recieved and ignored. \n");#endif				break;							case BUSY:#ifdef DEBUG	printk("BUSY message returned, performing REDO");#endif				update_timeout(SCpnt, oldto);				status = REDO;				break;			case RESERVATION_CONFLICT:				reset(SCpnt);				return;#if 0				exit = DRIVER_SOFT | SUGGEST_ABORT;				status = MAYREDO;				break;#endif			default:				printk ("Internal error %s %s \n"					"status byte = %d \n", __FILE__, 					__LINE__, status_byte(result));							}			break;			default:				panic ("unsupported message byte recieved.");			}			break;	case DID_TIME_OUT:	#ifdef DEBUG	printk("Host returned DID_TIME_OUT - ");#endif		if (SCpnt->flags & WAS_TIMEDOUT)				{#ifdef DEBUG	printk("Aborting\n");#endif				exit = (DRIVER_TIMEOUT | SUGGEST_ABORT);			}				else 			{#ifdef DEBUG			printk ("Retrying.\n");#endif			SCpnt->flags  |= WAS_TIMEDOUT;			status = REDO;			}		break;	case DID_BUS_BUSY:	case DID_PARITY:		status = REDO;		break;	case DID_NO_CONNECT:#ifdef DEBUG		printk("Couldn't connect.\n");#endif		exit  = (DRIVER_HARD | SUGGEST_ABORT);		break;	case DID_ERROR:			status = MAYREDO;		exit = (DRIVER_HARD | SUGGEST_ABORT);		break;	case DID_BAD_TARGET:	case DID_ABORT:		exit = (DRIVER_INVALID | SUGGEST_ABORT);		break;		default : 				exit = (DRIVER_ERROR | SUGGEST_DIE);	}	switch (status) 		{		case FINISHED:		case PENDING:			break;		case MAYREDO:#ifdef DEBUG	printk("In MAYREDO, allowing %d retries, have %d\n\r",	       SCpnt->allowed, SCpnt->retries);#endif			if ((++SCpnt->retries) < SCpnt->allowed)			{			if ((SCpnt->retries >= (SCpnt->allowed >> 1))			    && !(SCpnt->flags & WAS_RESET))			        {					reset(SCpnt);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久精品国产| 欧美日韩高清影院| 日本中文在线一区| 最新成人av在线| 欧美成人女星排行榜| 色噜噜狠狠成人网p站| 激情五月激情综合网| 午夜精品久久久久久久| 亚洲视频一区在线观看| 国产欧美一区视频| 欧美精品一区视频| 日韩你懂的在线观看| 欧美日韩在线播放三区四区| kk眼镜猥琐国模调教系列一区二区| 石原莉奈在线亚洲三区| 亚洲六月丁香色婷婷综合久久 | 亚洲天堂免费在线观看视频| 黑人巨大精品欧美黑白配亚洲| 国产91露脸合集magnet| 91美女视频网站| 精品日韩欧美在线| 亚洲猫色日本管| 午夜久久久久久| 成人黄页在线观看| 精品理论电影在线观看| 亚洲天堂久久久久久久| 久久国产麻豆精品| 日本乱人伦一区| 国产欧美精品一区| 三级亚洲高清视频| 色999日韩国产欧美一区二区| 精品国产制服丝袜高跟| 亚洲图片一区二区| 成人av影院在线| 久久久久久99久久久精品网站| 亚洲福利视频导航| 一本一道久久a久久精品| 精品久久久久久最新网址| 中文字幕免费在线观看视频一区| 一区二区三区在线免费| 久久99国产乱子伦精品免费| 成人av网站大全| 欧美成人性战久久| 亚洲视频免费在线| 日本不卡123| 色综合久久久久久久久| 久久精品在这里| 国产激情视频一区二区在线观看 | 日韩精品一区二区三区蜜臀| 亚洲欧美综合在线精品| 麻豆国产一区二区| 欧美亚洲禁片免费| 国产精品久久久久久久第一福利| 日韩黄色片在线观看| 99久久伊人精品| 久久亚洲精华国产精华液| 日本美女视频一区二区| 欧美中文字幕亚洲一区二区va在线 | 久久久久久影视| 亚洲亚洲精品在线观看| 欧美午夜精品久久久久久超碰| 国产欧美视频在线观看| 国产成人综合亚洲网站| 久久九九全国免费| 99vv1com这只有精品| 91小宝寻花一区二区三区| 成人免费在线播放视频| 国精产品一区一区三区mba视频| 国产亚洲综合性久久久影院| 成人国产精品免费| 亚洲综合色视频| 精品国内二区三区| 国产乱一区二区| 久久久蜜桃精品| 久久久www成人免费毛片麻豆| 亚洲激情av在线| 国产91色综合久久免费分享| 欧美大白屁股肥臀xxxxxx| 免费人成网站在线观看欧美高清| 顶级嫩模精品视频在线看| 欧美mv日韩mv亚洲| 九九九精品视频| 精品乱码亚洲一区二区不卡| 麻豆免费看一区二区三区| 欧美日韩一二三| 日韩**一区毛片| 日韩女优视频免费观看| 国产一区二区在线看| 久久亚洲综合av| caoporn国产一区二区| 综合色中文字幕| 欧美亚洲动漫精品| 图片区小说区国产精品视频| 欧美老女人在线| 成人免费视频免费观看| 亚洲女同一区二区| 国产精品久久久久久久裸模| 91福利精品视频| 国产suv一区二区三区88区| 麻豆国产精品777777在线| 在线播放一区二区三区| 国产麻豆精品theporn| 午夜亚洲福利老司机| 国产精品理伦片| 精品视频在线免费看| 欧美日韩在线播放一区| 国产成人夜色高潮福利影视| 欧美一区二区视频在线观看| 日韩二区三区在线观看| 欧美一区二区三区精品| 韩国精品在线观看| 一区二区三区国产| 1区2区3区国产精品| 亚洲综合激情网| 另类小说视频一区二区| k8久久久一区二区三区| 久久久亚洲高清| 国产成a人无v码亚洲福利| 亚洲国产精品t66y| 色综合久久88色综合天天6| 亚洲成人福利片| 欧美大度的电影原声| 国产成人超碰人人澡人人澡| 亚洲欧洲成人精品av97| 国产在线精品免费| 中文字幕av资源一区| 91精品在线麻豆| 欧美精品久久99| 色综合久久久网| 欧美午夜免费电影| 94-欧美-setu| 麻豆久久久久久久| 美女脱光内衣内裤视频久久影院| 一区二区三区在线免费观看| 国产精品激情偷乱一区二区∴| 精品国精品国产尤物美女| 欧美亚洲综合另类| 欧美日韩国产大片| 欧美色老头old∨ideo| 欧美性色综合网| 欧美视频一区二区在线观看| 欧美亚洲国产bt| 欧美日韩一二三| 51精品国自产在线| 欧美一级日韩不卡播放免费| 欧美高清www午色夜在线视频| 在线亚洲精品福利网址导航| 欧美亚洲自拍偷拍| 欧美军同video69gay| 欧美一区二区在线播放| 精品国产伦一区二区三区免费| 91精品在线麻豆| 亚洲曰韩产成在线| 激情图区综合网| 91精品欧美福利在线观看| 亚洲免费高清视频在线| 中文字幕一区视频| 国产精品理伦片| 奇米影视一区二区三区小说| 在线不卡免费av| www.欧美.com| 麻豆国产欧美一区二区三区| 884aa四虎影成人精品一区| 国产精华液一区二区三区| 亚洲福中文字幕伊人影院| 国产色一区二区| 欧美老年两性高潮| 99久久99久久精品免费看蜜桃 | 中文字幕亚洲一区二区av在线| 3d成人动漫网站| 成人国产精品免费观看| 久久久久久久综合狠狠综合| 亚洲欧美国产高清| 精品一区在线看| 色婷婷国产精品综合在线观看| 欧美电视剧在线观看完整版| 一区二区三区四区不卡视频| 精品伊人久久久久7777人| 在线不卡a资源高清| 亚洲三级免费电影| 奇米四色…亚洲| 色欧美片视频在线观看在线视频| 欧美美女bb生活片| 国产精品色噜噜| 久久99国产精品久久| 91高清视频免费看| 国产精品欧美一级免费| 国产一区二区视频在线| 56国语精品自产拍在线观看| 亚洲欧美激情一区二区| 国产jizzjizz一区二区| 精品欧美乱码久久久久久| 婷婷亚洲久悠悠色悠在线播放| 91在线porny国产在线看| 日本一区二区三区国色天香| 美女视频一区二区三区| 欧美精品123区| 男人的天堂久久精品| 日韩欧美亚洲一区二区| 免费在线成人网|