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

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

?? seagate.c

?? 內核是系統的心臟
?? C
?? 第 1 頁 / 共 3 頁
字號:
	return 0;
      }

int seagate_st0x_command (Scsi_Cmnd * SCpnt) {
	return internal_command (SCpnt->target, SCpnt->lun, SCpnt->cmnd, SCpnt->request_buffer,
				 SCpnt->request_bufflen, 
				 (int) NO_RECONNECT);
}
	
static int internal_command(unsigned char target, unsigned char lun, const void *cmnd,
			 void *buff, int bufflen, int reselect) {
	int len = 0;
	unsigned char *data = NULL;	
	struct scatterlist *buffer = NULL;
	int nobuffs = 0;
	int clock;			
	int temp;
#ifdef SLOW_HANDSHAKE
	int borken;	/* Does the current target require Very Slow I/O ? */
#endif


#if (DEBUG & PHASE_DATAIN) || (DEBUG & PHASE_DATOUT) 
	int transfered = 0;
#endif

#if (((DEBUG & PHASE_ETC) == PHASE_ETC) || (DEBUG & PRINT_COMMAND) || \
	(DEBUG & PHASE_EXIT))	
	int i;
#endif

#if ((DEBUG & PHASE_ETC) == PHASE_ETC)
	int phase=0, newphase;
#endif

	int done = 0;
	unsigned char status = 0;	
	unsigned char message = 0;
	register unsigned char status_read;

	unsigned transfersize = 0, underflow = 0;

	incommand = 0;
	st0x_aborted = 0;

#ifdef SLOW_HANDSHAKE
	borken = (int) scsi_devices[SCint->index].borken;
#endif

#if (DEBUG & PRINT_COMMAND)
	printk ("scsi%d : target = %d, command = ", hostno, target);
	print_command((unsigned char *) cmnd);
	printk("\n");
#endif

#if (DEBUG & PHASE_RESELECT)
	switch (reselect) {
	case RECONNECT_NOW :
		printk("scsi%d : reconnecting\n", hostno);
		break;
#ifdef LINKED
	case LINKED_RIGHT : 
		printk("scsi%d : connected, can reconnect\n", hostno);
		break;
	case LINKED_WRONG :
		printk("scsi%d : connected to wrong target, can reconnect\n",
			hostno);
		break;		
#endif
	case CAN_RECONNECT :
		printk("scsi%d : allowed to reconnect\n", hostno);
		break;
	default :
		printk("scsi%d : not allowed to reconnect\n", hostno);
	}
#endif
	

	if (target == (controller_type == SEAGATE ? 7 : 6))
		return DID_BAD_TARGET;

/*
 *	We work it differently depending on if this is is "the first time,"
 *	or a reconnect.  If this is a reselct phase, then SEL will 
 *	be asserted, and we must skip selection / arbitration phases.
 */

	switch (reselect) {
	case RECONNECT_NOW:
#if (DEBUG & PHASE_RESELECT)
		printk("scsi%d : phase RESELECT \n", hostno);
#endif

/*
 *	At this point, we should find the logical or of our ID and the original
 *	target's ID on the BUS, with BSY, SEL, and I/O signals asserted.
 *
 *	After ARBITRATION phase is completed, only SEL, BSY, and the 
 *	target ID are asserted.  A valid initator ID is not on the bus
 *	until IO is asserted, so we must wait for that.
 */
		
		for (clock = jiffies + 10, temp = 0; (jiffies < clock) &&
		     !(STATUS & STAT_IO););
		
		if (jiffies >= clock)
			{
#if (DEBUG & PHASE_RESELECT)
			printk("scsi%d : RESELECT timed out while waiting for IO .\n",
				hostno);
#endif
			return (DID_BAD_INTR << 16);
			}

/* 
 * 	After I/O is asserted by the target, we can read our ID and its
 *	ID off of the BUS.
 */
 
		if (!((temp = DATA) & (controller_type == SEAGATE ? 0x80 : 0x40)))
			{
#if (DEBUG & PHASE_RESELECT)
			printk("scsi%d : detected reconnect request to different target.\n" 
			       "\tData bus = %d\n", hostno, temp);
#endif
			return (DID_BAD_INTR << 16);
			}

		if (!(temp & (1 << current_target)))
			{
			printk("scsi%d : Unexpected reselect interrupt.  Data bus = %d\n",
				hostno, temp);
			return (DID_BAD_INTR << 16);
			}

		buffer=current_buffer;	
                cmnd=current_cmnd;      /* WDE add */
                data=current_data;      /* WDE add */
                len=current_bufflen;    /* WDE add */
		nobuffs=current_nobuffs;

/*
 * 	We have determined that we have been selected.  At this point, 
 *	we must respond to the reselection by asserting BSY ourselves
 */

#if 1
		CONTROL = (BASE_CMD | CMD_DRVR_ENABLE | CMD_BSY);
#else
		CONTROL = (BASE_CMD | CMD_BSY);
#endif

/*
 *	The target will drop SEL, and raise BSY, at which time we must drop
 *	BSY.
 */

		for (clock = jiffies + 10; (jiffies < clock) &&  (STATUS & STAT_SEL););

		if (jiffies >= clock)
			{ 
			CONTROL = (BASE_CMD | CMD_INTR);
#if (DEBUG & PHASE_RESELECT)
			printk("scsi%d : RESELECT timed out while waiting for SEL.\n",
				hostno);
#endif
			return (DID_BAD_INTR << 16);				 
			}

		CONTROL = BASE_CMD;

/*
 *	At this point, we have connected with the target and can get 
 *	on with our lives.
 */	 
		break;
	case CAN_RECONNECT:

#ifdef LINKED
/*
 * This is a bletcherous hack, just as bad as the Unix #! interpreter stuff.
 * If it turns out we are using the wrong I_T_L nexus, the easiest way to deal
 * with it is to go into our INFORMATION TRANSFER PHASE code, send a ABORT 
 * message on MESSAGE OUT phase, and then loop back to here.
 */
  
connect_loop :

#endif

#if (DEBUG & PHASE_BUS_FREE)
		printk ("scsi%d : phase = BUS FREE \n", hostno);
#endif

/*
 *	BUS FREE PHASE
 *
 * 	On entry, we make sure that the BUS is in a BUS FREE
 *	phase, by insuring that both BSY and SEL are low for
 *	at least one bus settle delay.  Several reads help
 *	eliminate wire glitch.
 */

		clock = jiffies + ST0X_BUS_FREE_DELAY;	

#if !defined (ARBITRATE) 
		while (((STATUS |  STATUS | STATUS) & 
		         (STAT_BSY | STAT_SEL)) && 
			 (!st0x_aborted) && (jiffies < clock));

		if (jiffies > clock)
			return retcode(DID_BUS_BUSY);
		else if (st0x_aborted)
			return retcode(st0x_aborted);
#endif

#if (DEBUG & PHASE_SELECTION)
		printk("scsi%d : phase = SELECTION\n", hostno);
#endif

		clock = jiffies + ST0X_SELECTION_DELAY;

/*
 * Arbitration/selection procedure : 
 * 1.  Disable drivers
 * 2.  Write HOST adapter address bit
 * 3.  Set start arbitration.
 * 4.  We get either ARBITRATION COMPLETE or SELECT at this
 *     point.
 * 5.  OR our ID and targets on bus.
 * 6.  Enable SCSI drivers and asserted SEL and ATTN
 */
		
#if defined(ARBITRATE)	
	cli();
	CONTROL = 0;
	DATA = (controller_type == SEAGATE) ? 0x80 : 0x40;
	CONTROL = CMD_START_ARB; 
	sti();
	while (!((status_read = STATUS) & (STAT_ARB_CMPL | STAT_SEL)) &&
		(jiffies < clock) && !st0x_aborted);

	if (!(status_read & STAT_ARB_CMPL)) {
#if (DEBUG & PHASE_SELECTION)
		if (status_read & STAT_SEL) 
			printk("scsi%d : arbitration lost\n", hostno);
		else
			printk("scsi%d : arbitration timeout.\n", hostno);
#endif
		CONTROL = BASE_CMD;
		return retcode(DID_NO_CONNECT);
	};

#if (DEBUG & PHASE_SELECTION)
	printk("scsi%d : arbitration complete\n", hostno);
#endif
#endif


/*
 *	When the SCSI device decides that we're gawking at it, it will 
 *	respond by asserting BUSY on the bus.
 *
 * 	Note : the Seagate ST-01/02 product manual says that we should 
 * 	twiddle the DATA register before the control register.  However,
 *	this does not work reliably so we do it the other way arround.
 *
 *	Probably could be a problem with arbitration too, we really should
 *	try this with a SCSI protocol or logic analyzer to see what is 
 *	going on.
 */
	cli();
	DATA = (unsigned char) ((1 << target) | (controller_type == SEAGATE ? 0x80 : 0x40));
	CONTROL = BASE_CMD | CMD_DRVR_ENABLE | CMD_SEL | 
		(reselect ? CMD_ATTN : 0);
	sti();
		while (!((status_read = STATUS) & STAT_BSY) && 
			(jiffies < clock) && !st0x_aborted)

#if 0 && (DEBUG & PHASE_SELECTION)
		{
		temp = clock - jiffies;

		if (!(jiffies % 5))
			printk("seagate_st0x_timeout : %d            \r",temp);
	
		}
		printk("Done.                                             \n");
		printk("scsi%d : status = %02x, seagate_st0x_timeout = %d, aborted = %02x \n", 
			hostno, status_read, temp, st0x_aborted);
#else
		;
#endif
	

		if ((jiffies >= clock)  && !(status_read & STAT_BSY))
			{
#if (DEBUG & PHASE_SELECTION)
			printk ("scsi%d : NO CONNECT with target %d, status = %x \n", 
				hostno, target, STATUS);
#endif
			return retcode(DID_NO_CONNECT);
			}

/*
 *	If we have been aborted, and we have a command in progress, IE the 
 *	target still has BSY asserted, then we will reset the bus, and 
 * 	notify the midlevel driver to expect sense.
 */

		if (st0x_aborted) {
			CONTROL = BASE_CMD;
			if (STATUS & STAT_BSY) {
				printk("scsi%d : BST asserted after we've been aborted.\n",
					hostno);
				seagate_st0x_reset(NULL);
				return retcode(DID_RESET);
			}
			return retcode(st0x_aborted);
		}	

/* Establish current pointers.  Take into account scatter / gather */

        if ((nobuffs = SCint->use_sg)) {
#if (DEBUG & DEBUG_SG)
	{
	int i;
	printk("scsi%d : scatter gather requested, using %d buffers.\n",
		hostno, nobuffs);
	for (i = 0; i < nobuffs; ++i)
		printk("scsi%d : buffer %d address = %08x length = %d\n",
			hostno, i, buffer[i].address, buffer[i].length);
	}
#endif
		
                buffer = (struct scatterlist *) SCint->buffer;
                len = buffer->length;
                data = (unsigned char *) buffer->address;
        } else {
#if (DEBUG & DEBUG_SG)
	printk("scsi%d : scatter gather not requested.\n", hostno);
#endif
                buffer = NULL;
                len = SCint->request_bufflen;
                data = (unsigned char *) SCint->request_buffer;
        }

#if (DEBUG & (PHASE_DATAIN | PHASE_DATAOUT))
	printk("scsi%d : len = %d\n", hostno, len);
#endif

		break;
#ifdef LINKED
	case LINKED_RIGHT:
	    	break;
	case LINKED_WRONG:
		break;
#endif
	}

/*
 * 	There are several conditions under which we wish to send a message : 
 *	1.  When we are allowing disconnect / reconnect, and need to establish
 *	    the I_T_L nexus via an IDENTIFY with the DiscPriv bit set.
 *
 *	2.  When we are doing linked commands, are have the wrong I_T_L nexus
 *	    established and want to send an ABORT message.
 */

	
	CONTROL = BASE_CMD | CMD_DRVR_ENABLE | 
		(((reselect == CAN_RECONNECT)
#ifdef LINKED 
		|| (reselect == LINKED_WRONG)
#endif 
		)  ? CMD_ATTN : 0) ;
	
/*
 * 	INFORMATION TRANSFER PHASE
 *
 *	The nasty looking read / write inline assembler loops we use for 
 *	DATAIN and DATAOUT phases are approximately 4-5 times as fast as 
 *	the 'C' versions - since we're moving 1024 bytes of data, this
 *	really adds up.
 */

#if ((DEBUG & PHASE_ETC) == PHASE_ETC)
	printk("scsi%d : phase = INFORMATION TRANSFER\n", hostno);
#endif  

	incommand = 1;
	transfersize = SCint->transfersize;
	underflow = SCint->underflow;


/*
 * 	Now, we poll the device for status information,
 *	and handle any requests it makes.  Note that since we are unsure of 
 *	how much data will be flowing across the system, etc and cannot 
 *	make reasonable timeouts, that we will instead have the midlevel
 * 	driver handle any timeouts that occur in this phase.
 */

	while (((status_read = STATUS) & STAT_BSY) && !st0x_aborted && !done) 
		{
#ifdef PARITY
		if (status_read & STAT_PARITY)
			{
			printk("scsi%d : got parity error\n", hostno);
			st0x_aborted = DID_PARITY;
			}	
#endif

		if (status_read & STAT_REQ)
			{
#if ((DEBUG & PHASE_ETC) == PHASE_ETC)
			if ((newphase = (status_read & REQ_MASK)) != phase)
				{
				phase = newphase;
				switch (phase)
				{
				case REQ_DATAOUT: 
					printk("scsi%d : phase = DATA OUT\n",
						hostno); 
					break;
				case REQ_DATAIN : 
					printk("scsi%d : phase = DATA IN\n",
						hostno); 
					break;
				case REQ_CMDOUT : 
					printk("scsi%d : phase = COMMAND OUT\n",
						hostno); 
					break;
				case REQ_STATIN :
					 printk("scsi%d : phase = STATUS IN\n",
						hostno); 
					break;
				case REQ_MSGOUT :
					printk("scsi%d : phase = MESSAGE OUT\n",
						hostno); 
					break;
				case REQ_MSGIN :
					printk("scsi%d : phase = MESSAGE IN\n",
						hostno);
					break;
				default : 
					printk("scsi%d : phase = UNKNOWN\n",
						hostno); 
					st0x_aborted = DID_ERROR; 
				}	
				}
#endif
		switch (status_read & REQ_MASK)
		{			
		case REQ_DATAOUT : 
/*
 * If we are in fast mode, then we simply splat the data out
 * in word-sized chunks as fast as we can.
 */

#ifdef FAST 
if (!len) {
#if 0 
        printk("scsi%d: underflow to target %d lun %d \n", 
                hostno, target, lun);
        st0x_aborted = DID_ERROR;
        fast = 0;
#endif
        break;
}

if (fast && transfersize && !(len % transfersize) && (len >= transfersize)
#ifdef FAST32
	&& !(transfersize % 4)
#endif
	) {
#if (DEBUG & DEBUG_FAST) 
        printk("scsi%d : FAST transfer, underflow = %d, transfersize = %d\n"
               "         len = %d, data = %08x\n", hostno, SCint->underflow, 
               SCint->transfersize, len, data);
#endif

        __asm__("
	cld;
"
#ifdef FAST32
"	shr $2, %%ecx;
1:	lodsl;
	movl %%eax, (%%edi);
"
#else
"1:	lodsb;
        movb %%al, (%%edi);
"
#endif
"	loop 1b;" : :
        /* input */
        "D" (st0x_dr), "S" (data), "c" (SCint->transfersize) :
        /* clobbered */
        "eax", "ecx", "esi" );

	len -= transfersize;
	data += transfersize;

#if (DEBUG & DEBUG_FAST)
	printk("scsi%d : FAST transfer complete len = %d data = %08x\n", 
		hostno, len, data);
#endif


} else 
#endif

{
/*
 * 	We loop as long as we are in a data out phase, there is data to send, 
 *	and BSY is still active.
 */
		__asm__ (

/*
	Local variables : 
	len = ecx
	data = esi
	st0x_cr_sr = ebx
	st0x_dr =  edi

	Test for any data here at all.
*/
	"\torl %%ecx, %%ecx
	jz 2f

	cld

	movl _st0x_cr_sr, %%ebx
	movl _st0x_dr, %%edi
	
1:	movb (%%ebx), %%al\n"
/*
	Test for BSY
*/

	"\ttest $1, %%al
	jz 2f\n"

/*
	Test for data out phase - STATUS & REQ_MASK should be REQ_DATAOUT, which is 0.
*/
	"\ttest $0xe, %%al
	jnz 2f	\n"
/*
	Test for REQ
*/	
	"\ttest $0x10, %%al
	jz 1b
	lodsb
	movb %%al, (%%edi) 
	loop 1b

2: 
									":
/* output */
"=S" (data), "=c" (len) :
/* input */
"0" (data), "1" (len) :
/* clobbered */
"eax", "ebx", "edi"); 
}

                        if (!len && nobuffs) {
                                --nobuffs;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜诱惑制服诱惑色一区在线观看| 精品国产网站在线观看| 欧美男人的天堂一二区| 精品免费99久久| 一区二区久久久久久| 日本午夜一区二区| 99精品久久99久久久久| 欧美mv日韩mv国产网站| 一区二区三区欧美| 国产69精品久久久久毛片| 国产欧美综合在线观看第十页 | 99re6这里只有精品视频在线观看| av一本久道久久综合久久鬼色| 91精品国产黑色紧身裤美女| 中文字幕中文字幕一区二区 | 欧美日韩国产综合草草| 中文在线资源观看网站视频免费不卡 | 久久精子c满五个校花| 午夜精品久久久久久不卡8050| 懂色av一区二区夜夜嗨| 精品国产乱码久久久久久1区2区| 亚洲图片一区二区| 色哟哟国产精品| 国产精品免费丝袜| 蜜桃久久av一区| 欧美疯狂性受xxxxx喷水图片| 亚洲美女一区二区三区| 成人免费精品视频| 国产欧美一区二区三区沐欲| 精品中文字幕一区二区小辣椒| 宅男在线国产精品| 日韩精品一级二级 | 欧美精选一区二区| 一区二区三区加勒比av| 91麻豆高清视频| 1024精品合集| 91污在线观看| 一区二区三区不卡视频| 91搞黄在线观看| 亚洲综合一二区| 欧洲国产伦久久久久久久| 亚洲日本欧美天堂| 欧美在线你懂的| 亚洲国产精品影院| 69av一区二区三区| 久久国产精品第一页| 337p日本欧洲亚洲大胆色噜噜| 麻豆成人91精品二区三区| 精品奇米国产一区二区三区| 国产美女娇喘av呻吟久久| 国产午夜精品久久| 国产精品久久久一本精品 | 麻豆精品新av中文字幕| 欧美日韩在线精品一区二区三区激情| 日韩美女精品在线| 在线看不卡av| 日韩在线一二三区| 久久久一区二区三区捆绑**| 成人亚洲精品久久久久软件| 亚洲欧洲日韩在线| 欧美在线999| 久久精品国产99| 亚洲国产精品国自产拍av| 91女人视频在线观看| 香蕉加勒比综合久久| 精品国产乱码久久久久久免费| 国产福利精品一区| 亚洲一区二区三区视频在线播放 | 91香蕉视频在线| 亚洲www啪成人一区二区麻豆| 成人av片在线观看| 91日韩在线专区| 亚洲视频免费看| 欧美日韩精品系列| 免费看日韩a级影片| 亚洲国产婷婷综合在线精品| 日韩三级中文字幕| 99视频超级精品| 日本aⅴ免费视频一区二区三区 | 午夜国产精品影院在线观看| 亚洲精品一区二区精华| 色婷婷精品久久二区二区蜜臂av| 亚洲va欧美va国产va天堂影院| 精品久久一区二区三区| 欧美中文字幕一区二区三区亚洲| 国产99久久久久久免费看农村| 国产精品电影院| 日韩一区二区中文字幕| 色猫猫国产区一区二在线视频| 美国三级日本三级久久99| 亚洲男人电影天堂| 久久欧美中文字幕| 欧美丰满嫩嫩电影| 日本高清免费不卡视频| 成人在线综合网站| 玖玖九九国产精品| 亚洲福利一二三区| 亚洲免费成人av| 成人丝袜高跟foot| 亚洲精选一二三| 老司机午夜精品99久久| 国产精品日产欧美久久久久| 欧美疯狂性受xxxxx喷水图片| 91亚洲资源网| 国产成人午夜视频| 国产一区不卡在线| 久久午夜电影网| 777a∨成人精品桃花网| 欧美伊人精品成人久久综合97| 国产激情一区二区三区四区| 日本91福利区| 日韩福利电影在线| 午夜精品久久久久影视| 一区二区三区91| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 久久一二三国产| 久久久久国产一区二区三区四区| 日韩写真欧美这视频| 欧美一区二区三区视频免费播放| 精品视频一区二区不卡| 在线欧美小视频| 亚洲男人电影天堂| 一区二区三区鲁丝不卡| 亚洲欧美色图小说| 亚洲欧美日韩国产手机在线| 亚洲欧洲一区二区三区| 亚洲精品日韩综合观看成人91| 国产精品久久网站| 亚洲同性同志一二三专区| 久久久久久久久久看片| 国产视频一区二区在线| 国产欧美一区二区精品性色超碰| 久久久久久久久伊人| 国产精品毛片大码女人| 亚洲欧美一区二区久久| 亚洲五码中文字幕| 日韩综合小视频| 久久99久久精品欧美| 国产成人一级电影| 99精品国产视频| 欧美日韩一区二区电影| 日韩欧美国产系列| 国产精品丝袜91| 一区二区在线观看视频| 亚洲观看高清完整版在线观看 | 一区二区三区资源| 91精品国产综合久久蜜臀| 日韩女优电影在线观看| 国产日韩成人精品| 亚洲男同1069视频| 美腿丝袜一区二区三区| 国产激情一区二区三区桃花岛亚洲| 成人动漫精品一区二区| 欧美男生操女生| 中文字幕第一区二区| 国产综合色视频| av电影在线观看不卡| 不卡一区在线观看| 欧美日韩国产在线播放网站| 日韩美女视频在线| 亚洲欧美日韩国产综合在线| 另类小说色综合网站| 99国产精品久久久久| 欧美一区日韩一区| 中文字幕中文字幕中文字幕亚洲无线| 亚洲国产精品久久艾草纯爱| 国产一区二区三区av电影 | 久久久国产一区二区三区四区小说| 亚洲天堂精品在线观看| 男女性色大片免费观看一区二区 | 欧美亚洲综合久久| 久久午夜免费电影| 亚洲精品乱码久久久久| 国内外成人在线| 欧美在线观看禁18| 国产精品不卡一区| 国产伦精品一区二区三区视频青涩| 91福利小视频| 欧美激情艳妇裸体舞| 久久久久久夜精品精品免费| 亚洲毛片av在线| 国产成人精品亚洲777人妖 | 国产在线播放一区| 在线成人免费视频| 一区二区在线看| eeuss国产一区二区三区| 欧美精品一区二区三区蜜臀| 亚洲黄色av一区| 欧美a级一区二区| 欧美日韩精品一区二区| 夜夜精品视频一区二区| 成人午夜在线免费| 久久综合精品国产一区二区三区| 日韩高清不卡在线| 欧美专区在线观看一区| 亚洲人成精品久久久久久| 成人h精品动漫一区二区三区| 久久蜜桃一区二区| 国产伦精品一区二区三区免费迷| 日韩一区二区高清|