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

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

?? seagate.c

?? LINUX1.0源代碼,代碼條理清晰
?? C
?? 第 1 頁 / 共 3 頁
字號:
                                ++buffer;
                                len = buffer->length;
                                data = (unsigned char *) buffer->address;
#if (DEBUG & DEBUG_SG)
	printk("scsi%d : next scatter-gather buffer len = %d address = %08x\n",
		hostno, len, data);
#endif
                        }
			break;

		case REQ_DATAIN : 
#ifdef SLOW_HANDSHAKE
	if (borken) {
#if (DEBUG & (PHASE_DATAIN))
		transfered += len;
#endif
		for (; len && (STATUS & (REQ_MASK | STAT_REQ)) == (REQ_DATAIN |
			STAT_REQ); --len) {
				*data++ = DATA;
				borken_wait();
}
#if (DEBUG & (PHASE_DATAIN))
		transfered -= len;
#endif
	} else
#endif
#ifdef FAST
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:	movl (%%esi), %%eax;
	stosl;
"
#else
"1:	movb (%%esi), %%al;
        stosb;
"
#endif

"	loop 1b;" : :
        /* input */
        "S" (st0x_dr), "D" (data), "c" (SCint->transfersize) :
        /* clobbered */
        "eax", "ecx", "edi");

	len -= transfersize;
	data += transfersize;

#if (DEBUG & PHASE_DATAIN)
	printk("scsi%d: transfered += %d\n", hostno, transfersize);
	transfered += transfersize;
#endif

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

} else
#endif
{

#if (DEBUG & PHASE_DATAIN)
	printk("scsi%d: transfered += %d\n", hostno, len);
	transfered += len;	/* Assume we'll transfer it all, then
				   subtract what we *didn't* transfer */
#endif
	
/*
 * 	We loop as long as we are in a data in phase, there is room to read, 
 * 	and BSY is still active
 */
 
			__asm__ (
/*
	Local variables : 
	ecx = len
	edi = data
	esi = st0x_cr_sr
	ebx = st0x_dr

	Test for room to read
*/
	"\torl %%ecx, %%ecx
	jz 2f

	cld
	movl _st0x_cr_sr, %%esi
	movl _st0x_dr, %%ebx

1:	movb (%%esi), %%al\n"
/*
	Test for BSY
*/

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

/*
	Test for data in phase - STATUS & REQ_MASK should be REQ_DATAIN, = STAT_IO, which is 4.
*/
	"\tmovb $0xe, %%ah	
	andb %%al, %%ah
	cmpb $0x04, %%ah
	jne 2f\n"
		
/*
	Test for REQ
*/	
	"\ttest $0x10, %%al
	jz 1b

	movb (%%ebx), %%al	
	stosb	
	loop 1b\n"

"2:\n"
									:
/* output */
"=D" (data), "=c" (len) :
/* input */
"0" (data), "1" (len) :
/* clobbered */
"eax","ebx", "esi"); 

#if (DEBUG & PHASE_DATAIN)
	printk("scsi%d: transfered -= %d\n", hostno, len);
	transfered -= len;		/* Since we assumed all of Len got 
					 * transfered, correct our mistake */
#endif
}
	
                        if (!len && nobuffs) {
                                --nobuffs;
                                ++buffer;
                                len = buffer->length;
                                data = (unsigned char *) buffer->address;
#if (DEBUG & DEBUG_SG)
	printk("scsi%d : next scatter-gather buffer len = %d address = %08x\n",
		hostno, len, data);
#endif
                        }

			break;

		case REQ_CMDOUT : 
			while (((status_read = STATUS) & STAT_BSY) && 
			       ((status_read & REQ_MASK) == REQ_CMDOUT))
				if (status_read & STAT_REQ) {
					DATA = *(unsigned char *) cmnd;
					cmnd = 1+(unsigned char *) cmnd;
#ifdef SLOW_HANDSHAKE
					if (borken) 
						borken_wait();
#endif
				}
			break;
	
		case REQ_STATIN : 
			status = DATA;
			break;
				
		case REQ_MSGOUT : 
/*
 *	We can only have sent a MSG OUT if we requested to do this 
 *	by raising ATTN.  So, we must drop ATTN.
 */

			CONTROL = BASE_CMD | CMD_DRVR_ENABLE;
/*
 * 	If we are reconecting, then we must send an IDENTIFY message in 
 *	 response  to MSGOUT.
 */
			switch (reselect) {
			case CAN_RECONNECT:
				DATA = IDENTIFY(1, lun);

#if (DEBUG & (PHASE_RESELECT | PHASE_MSGOUT)) 
				printk("scsi%d : sent IDENTIFY message.\n", hostno);
#endif
				break;
#ifdef LINKED
			case LINKED_WRONG:
				DATA = ABORT;
				linked_connected = 0;
				reselect = CAN_RECONNECT;
				goto connect_loop;
#if (DEBUG & (PHASE_MSGOUT | DEBUG_LINKED))
				printk("scsi%d : sent ABORT message to cancle incorrect I_T_L nexus.\n", hostno);
#endif
#endif /* LINKED */
#if (DEBUG & DEBUG_LINKED) 
	    printk("correct\n");
#endif
			default:
				DATA = NOP;
				printk("scsi%d : target %d requested MSGOUT, sent NOP message.\n", hostno, target);
			}
			break;
					
		case REQ_MSGIN : 
			switch (message = DATA) {
			case DISCONNECT :
				should_reconnect = 1;
                                current_data = data;    /* WDE add */
				current_buffer = buffer;
                                current_bufflen = len;  /* WDE add */
				current_nobuffs = nobuffs;
#ifdef LINKED
				linked_connected = 0;
#endif
				done=1;
#if (DEBUG & (PHASE_RESELECT | PHASE_MSGIN))
				printk("scsi%d : disconnected.\n", hostno);
#endif
				break;

#ifdef LINKED
			case LINKED_CMD_COMPLETE:
			case LINKED_FLG_CMD_COMPLETE:
#endif
			case COMMAND_COMPLETE :
/*
 * Note : we should check for underflow here.   
 */
#if (DEBUG & PHASE_MSGIN)	
				printk("scsi%d : command complete.\n", hostno);
#endif
				done = 1;
				break;
			case ABORT :
#if (DEBUG & PHASE_MSGIN)
				printk("scsi%d : abort message.\n", hostno);
#endif
				done=1;
				break;
			case SAVE_POINTERS :
				current_buffer = buffer;
                                current_bufflen = len;  /* WDE add */
				current_data = data;	/* WDE mod */
				current_nobuffs = nobuffs;
#if (DEBUG & PHASE_MSGIN)
				printk("scsi%d : pointers saved.\n", hostno);
#endif 
				break;
			case RESTORE_POINTERS:
				buffer=current_buffer;
				cmnd=current_cmnd;
				data=current_data;	/* WDE mod */
				len=current_bufflen;
				nobuffs=current_nobuffs;
#if (DEBUG & PHASE_MSGIN)
				printk("scsi%d : pointers restored.\n", hostno);
#endif
				break;
			default:

/*
 * 	IDENTIFY distinguishes itself from the other messages by setting the
 *	high byte.
 * 	
 *	Note : we need to handle at least one outstanding command per LUN,
 *	and need to hash the SCSI command for that I_T_L nexus based on the 
 *	known ID (at this point) and LUN.
 */

				if (message & 0x80) {
#if (DEBUG & PHASE_MSGIN)
					printk("scsi%d : IDENTIFY message received from id %d, lun %d.\n",
						hostno, target, message & 7);
#endif
				} else {

/*
 *      We should go into a MESSAGE OUT phase, and send  a MESSAGE_REJECT 
 * 	if we run into a message that we don't like.  The seagate driver 
 * 	needs some serious restructuring first though.
 */

#if (DEBUG & PHASE_MSGIN)
					printk("scsi%d : unknown message %d from target %d.\n",
						hostno,  message,   target);
#endif	
				}
			}
			break;

		default : 
			printk("scsi%d : unknown phase.\n", hostno); 
			st0x_aborted = DID_ERROR; 
		}	

#ifdef SLOW_HANDSHAKE
/*
 * I really don't care to deal with borken devices in each single 
 * byte transfer case (ie, message in, message out, status), so
 * I'll do the wait here if necessary.
 */
		if (borken)
			borken_wait();
#endif
 
		} /* if ends */
		} /* while ends */

#if (DEBUG & (PHASE_DATAIN | PHASE_DATAOUT | PHASE_EXIT))
	printk("scsi%d : Transfered %d bytes\n", hostno, transfered);
#endif

#if (DEBUG & PHASE_EXIT)
#if 0		/* Doesn't work for scatter / gather */
	printk("Buffer : \n");
	for (i = 0; i < 20; ++i) 
		printk ("%02x  ", ((unsigned char *) data)[i]);	/* WDE mod */
	printk("\n");
#endif
	printk("scsi%d : status = ", hostno);
        print_status(status);
	printk("message = %02x\n", message);
#endif


/* We shouldn't reach this until *after* BSY has been deasserted */
#ifdef notyet
	if (st0x_aborted) {
		if (STATUS & STAT_BSY) {	
			seagate_st0x_reset(NULL);
			st0x_aborted = DID_RESET;
		} 
		abort_confirm = 1;
	} 
#endif

#ifdef LINKED
else {
/*
 * Fix the message byte so that unsuspecting high level drivers don't 
 * puke when they see a LINKED COMMAND message in place of the COMMAND 
 * COMPLETE they may be expecting.  Shouldn't be necessary, but it's 
 * better to be on the safe side. 
 *
 * A non LINKED* message byte will indicate that the command completed, 
 * and we are now disconnected.
 */

		switch (message) {
		case LINKED_CMD_COMPLETE :
		case LINKED_FLG_CMD_COMPLETE : 
			message = COMMAND_COMPLETE;
			linked_target = current_target;
			linked_lun = current_lun;
			linked_connected = 1;
#if (DEBUG & DEBUG_LINKED)
			printk("scsi%d : keeping I_T_L nexus established for linked command.\n", 
				hostno);
#endif
/*
 * We also will need to adjust status to accomodate intermediate conditions.
 */
			if ((status == INTERMEDIATE_GOOD) ||
				(status == INTERMEDIATE_C_GOOD))
				status = GOOD;
			
			break;
/*
 * We should also handle what are "normal" termination messages 
 * here (ABORT, BUS_DEVICE_RESET?, and COMMAND_COMPLETE individually, 
 * and flake if things aren't right.
 */

		default :
#if (DEBUG & DEBUG_LINKED)
			printk("scsi%d : closing I_T_L nexus.\n", hostno);
#endif
			linked_connected = 0;
		}
	}
#endif /* LINKED */




	if (should_reconnect) {
#if (DEBUG & PHASE_RESELECT)
		printk("scsi%d : exiting seagate_st0x_queue_command() with reconnect enabled.\n",
			hostno);
#endif
		CONTROL = BASE_CMD | CMD_INTR ;
	} else 
		CONTROL = BASE_CMD;

	return retcode (st0x_aborted);
	}

int seagate_st0x_abort (Scsi_Cmnd * SCpnt, int code)
	{
	if (code)
		st0x_aborted = code;
	else
		st0x_aborted = DID_ABORT;

		return 0;
	}

/*
	the seagate_st0x_reset function resets the SCSI bus
*/
	
int seagate_st0x_reset (Scsi_Cmnd * SCpnt)
	{
	unsigned clock;
	/*
		No timeouts - this command is going to fail because 
		it was reset.
	*/

#ifdef DEBUG
	printk("In seagate_st0x_reset()\n");
#endif


	/* assert  RESET signal on SCSI bus.  */
		
	CONTROL = BASE_CMD  | CMD_RST;
	clock=jiffies+2;

	
	/* Wait.  */
	
	while (jiffies < clock);

	CONTROL = BASE_CMD;
	
	st0x_aborted = DID_RESET;

#ifdef DEBUG
	printk("SCSI bus reset.\n");
#endif
	if(SCpnt) SCpnt->flags |= NEEDS_JUMPSTART;
	return 0;
	}

#ifdef CONFIG_BLK_DEV_SD

#include <asm/segment.h>
#include "sd.h"
#include "scsi_ioctl.h"

int seagate_st0x_biosparam(int size, int dev, int* ip) {
  unsigned char buf[256 + sizeof(int) * 2], cmd[6], *data, *page;
  int *sizes, result, formatted_sectors, total_sectors;
  int cylinders, heads, sectors;

  Scsi_Device *disk;

  disk = rscsi_disks[MINOR(dev) >> 4].device;

/*
 * Only SCSI-I CCS drives and later implement the necessary mode sense 
 * pages.  
 */

  if (disk->scsi_level < 2) 
	return -1;

  sizes = (int *) buf;
  data = (unsigned char *) (sizes + 2);

  cmd[0] = MODE_SENSE;
  cmd[1] = (disk->lun << 5) & 0xe5;
  cmd[2] = 0x04; /* Read page 4, rigid disk geometry page current values */
  cmd[3] = 0;
  cmd[4] = 255;
  cmd[5] = 0;

/*
 * We are transfering 0 bytes in the out direction, and expect to get back
 * 24 bytes for each mode page.
 */

  sizes[0] = 0;
  sizes[1] = 256;

  memcpy (data, cmd, 6);

  if (!(result = kernel_scsi_ioctl (disk, SCSI_IOCTL_SEND_COMMAND, (void *) buf))) {
/*
 * The mode page lies beyond the MODE SENSE header, with length 4, and 
 * the BLOCK DESCRIPTOR, with length header[3].
 */

    page = data + 4 + data[3];
    heads = (int) page[5];
    cylinders = (page[2] << 16) | (page[3] << 8) | page[4];

    cmd[2] = 0x03; /* Read page 3, format page current values */
    memcpy (data, cmd, 6);

    if (!(result = kernel_scsi_ioctl (disk, SCSI_IOCTL_SEND_COMMAND, (void *) buf))) {
      page = data + 4 + data[3];
      sectors = (page[10] << 8) | page[11];	

	
/*
 * Get the total number of formatted sectors from the block descriptor, 
 * so we can tell how many are being used for alternates.  
 */

      formatted_sectors = (data[4 + 1] << 16) | (data[4 + 2] << 8) |
	data[4 + 3] ;

      total_sectors = (heads * cylinders * sectors);

/*
 * Adjust the real geometry by subtracting 
 * (spare sectors / (heads * tracks)) cylinders from the number of cylinders.
 *
 * It appears that the CE cylinder CAN be a partial cylinder.
 */

     
printk("scsi%d : heads = %d cylinders = %d sectors = %d total = %d formatted = %d\n",
    hostno, heads, cylinders, sectors, total_sectors, formatted_sectors);

      if (!heads || !sectors || !cylinders)
	result = -1;
      else
	cylinders -= ((total_sectors - formatted_sectors) / (heads * sectors));

/*
 * Now, we need to do a sanity check on the geometry to see if it is 
 * BIOS compatable.  The maximum BIOS geometry is 1024 cylinders * 
 * 256 heads * 64 sectors. 
 */

      if ((cylinders > 1024) || (sectors > 64)) 
	result = -1;
      else {
	ip[0] = heads;
	ip[1] = sectors;
	ip[2] = cylinders;
      }

/* 
 * There should be an alternate mapping for things the seagate doesn't
 * understand, but I couldn't say what it is with reasonable certainty.
 */

      }
    }
    
  return result;
}
#endif /* CONFIG_BLK_DEV_SD */

#endif	/* defined(CONFIG_SCSI_SEGATE) */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩不卡在线观看日韩不卡视频| 欧美成人三级在线| 欧美日本在线视频| 久久精品人人做| 亚洲综合av网| 日本中文字幕一区| k8久久久一区二区三区| 欧美日韩视频不卡| 欧美国产在线观看| 亚洲国产欧美在线| 粉嫩aⅴ一区二区三区四区| 成人精品亚洲人成在线| 欧美日韩中文字幕一区二区| 久久麻豆一区二区| 午夜国产精品一区| aaa亚洲精品一二三区| 欧美一区二区三区啪啪| 中文字幕av一区二区三区免费看| 亚洲国产aⅴ成人精品无吗| 国产成人在线色| 欧美一级日韩不卡播放免费| 国产欧美日韩综合| 日韩成人伦理电影在线观看| 丁香桃色午夜亚洲一区二区三区| 欧美一区在线视频| 一区二区三区在线观看国产 | 亚洲va在线va天堂| 国产成人免费在线观看| 91精品国产麻豆国产自产在线| 国产精品福利电影一区二区三区四区| 免费黄网站欧美| 欧美综合久久久| 综合av第一页| 国产经典欧美精品| 久久人人爽爽爽人久久久| 午夜电影一区二区| 欧美三级韩国三级日本一级| 国产精品成人在线观看| 国产精品77777竹菊影视小说| 91精品欧美福利在线观看| 亚洲图片自拍偷拍| 欧美少妇一区二区| 亚洲韩国一区二区三区| 欧美最猛性xxxxx直播| 亚洲国产电影在线观看| 久久国产剧场电影| 日韩精品一区二区在线| 蜜臀久久久99精品久久久久久| 欧美视频精品在线| 亚洲人妖av一区二区| 不卡一区二区中文字幕| 中文字幕不卡在线观看| 成人黄色片在线观看| 欧美国产精品一区二区| 国产美女av一区二区三区| 久久在线观看免费| 国产精品国产自产拍在线| 波多野结衣亚洲一区| 亚洲韩国精品一区| 久久综合色一综合色88| caoporen国产精品视频| 亚洲国产欧美日韩另类综合 | 日韩综合在线视频| 久久精品人人做人人综合| 91极品美女在线| 久久精工是国产品牌吗| 综合久久给合久久狠狠狠97色 | 天天综合日日夜夜精品| 精品国产免费一区二区三区四区| va亚洲va日韩不卡在线观看| 丝袜国产日韩另类美女| 亚洲国产精华液网站w| 欧美精品v日韩精品v韩国精品v| 久久99国产乱子伦精品免费| 一区免费观看视频| 精品久久久久99| 色先锋久久av资源部| 美女国产一区二区| 亚洲黄色在线视频| 久久婷婷国产综合精品青草| 色94色欧美sute亚洲线路二 | 欧美国产亚洲另类动漫| 欧美日韩你懂得| 成人黄色av电影| 看片的网站亚洲| 亚洲国产成人va在线观看天堂| 精品久久久久久最新网址| 欧美日韩一区不卡| 99久久精品国产麻豆演员表| 美腿丝袜亚洲综合| 午夜在线电影亚洲一区| 日韩伦理av电影| 国产女人水真多18毛片18精品视频| 欧美日韩的一区二区| 91福利精品第一导航| 成人免费毛片片v| 国内久久精品视频| 久久精品99国产精品日本| 亚洲国产成人av| 一区二区欧美视频| 中文字幕日韩精品一区| 日本一区二区三区四区| 久久综合色综合88| 26uuu欧美日本| 精品国精品国产| 欧美tickle裸体挠脚心vk| 欧美一区三区二区| 日韩一区二区不卡| 日韩视频永久免费| 日韩区在线观看| 日韩精品专区在线影院观看| 欧美日韩美少妇| 91精品国产日韩91久久久久久| 欧美日韩激情一区二区三区| 欧美三级日韩在线| 欧美日本韩国一区| 欧美曰成人黄网| 欧美日韩电影一区| 日韩欧美亚洲一区二区| 欧美电影免费观看高清完整版| 精品欧美久久久| 国产区在线观看成人精品| 欧美激情一区二区三区| 国产精品乱码一区二区三区软件| 国产精品欧美精品| 亚洲综合999| 美洲天堂一区二卡三卡四卡视频| 久久99在线观看| 懂色一区二区三区免费观看| 成人精品电影在线观看| 色999日韩国产欧美一区二区| 欧洲另类一二三四区| 欧美日本精品一区二区三区| 88在线观看91蜜桃国自产| 久久夜色精品一区| 国产精品对白交换视频| 亚洲电影一级片| 精品亚洲国产成人av制服丝袜| 国产精品18久久久久久久久久久久| 国产99精品在线观看| 色乱码一区二区三区88| 欧美久久久影院| 久久精品日产第一区二区三区高清版 | 精品理论电影在线| 中文字幕在线不卡国产视频| 亚洲欧美成人一区二区三区| 视频在线观看国产精品| 国产成人自拍在线| 欧美在线观看你懂的| 欧美精品一区二区三区四区 | 亚洲综合丝袜美腿| 久久精品国产一区二区三区免费看| 国内外成人在线视频| av在线这里只有精品| 在线不卡a资源高清| 日本一区二区成人在线| 性做久久久久久免费观看欧美| 精品一区二区三区香蕉蜜桃| 91视视频在线直接观看在线看网页在线看| 欧美酷刑日本凌虐凌虐| 国产精品久久一级| 日本中文字幕不卡| 91久久人澡人人添人人爽欧美 | 免费在线观看一区二区三区| 成人国产精品免费观看| 欧美精品第1页| 自拍偷拍亚洲综合| 国产老肥熟一区二区三区| 欧美日本不卡视频| 亚洲欧美在线高清| 国内成人精品2018免费看| 欧美日韩夫妻久久| 亚洲欧美偷拍三级| 风间由美一区二区三区在线观看 | 久久影院视频免费| 天天av天天翘天天综合网 | 国产一区二区三区在线观看免费视频| 欧美自拍偷拍一区| 成人欧美一区二区三区黑人麻豆| 激情小说欧美图片| 日韩一区二区三区在线观看| 一区二区三区成人| 成人av免费在线| 中文字幕不卡在线| 成人高清免费在线播放| 精品国产乱码久久久久久老虎| 日本亚洲最大的色成网站www| 日本高清不卡在线观看| 一区视频在线播放| 亚洲国产一区二区视频| 制服丝袜一区二区三区| 水蜜桃久久夜色精品一区的特点| 亚洲女同一区二区| 亚洲综合偷拍欧美一区色| 99国内精品久久| 中文字幕制服丝袜成人av| 国产精品一区三区| 久久久久久久久岛国免费| 久久av老司机精品网站导航| 日韩午夜激情视频|