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

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

?? fdomain.c

?? LINUX1.0源代碼,代碼條理清晰
?? C
?? 第 1 頁 / 共 4 頁
字號:
      are using ISA boards, but Future Domain provides the MCA ID
      anyway.  We can use this ID to ensure that this is a Future
      Domain TMC-1660/TMC-1680.
    */

   if (inb( port + LSB_ID_Code ) != 0xe9) { /* test for 0x6127 id */
      if (inb( port + LSB_ID_Code ) != 0x27) return 0;
      if (inb( port + MSB_ID_Code ) != 0x61) return 0;
      chip = tmc1800;
   } else {			            /* test for 0xe960 id */
      if (inb( port + MSB_ID_Code ) != 0x60) return 0;
      chip = tmc18c50;
   }

   /* We have a valid MCA ID for a TMC-1660/TMC-1680 Future Domain board.
      Now, check to be sure the bios_base matches these ports.  If someone
      was unlucky enough to have purchased more than one Future Domain
      board, then they will have to modify this code, as we only detect one
      board here.  [The one with the lowest bios_base.]  */

   options = inb( port + Configuration1 );

#if DEBUG_DETECT
   printk( " Options = %x\n", options );
#endif

				/* Check for board with lowest bios_base. */
   if (addresses[ (options & 0xc0) >> 6 ] != bios_base)
	 return 0;
   interrupt_level = ints[ (options & 0x0e) >> 1 ];

   return 1;
}

static int fdomain_test_loopback( void )
{
   int i;
   int result;

   for (i = 0; i < 255; i++) {
      outb( i, port_base + Write_Loopback );
      result = inb( port_base + Read_Loopback );
      if (i != result)
	    return 1;
   }
   return 0;
}

int fdomain_16x0_detect( int hostnum )
{
   int              i, j;
   int              flag = 0;
   struct sigaction sa;
   int              retcode;
#if DO_DETECT
   const int        buflen = 255;
   Scsi_Cmnd        SCinit;
   unsigned char    do_inquiry[] =       { INQUIRY, 0, 0, 0, buflen, 0 };
   unsigned char    do_request_sense[] = { REQUEST_SENSE, 0, 0, 0, buflen, 0 };
   unsigned char    do_read_capacity[] = { READ_CAPACITY,
					   0, 0, 0, 0, 0, 0, 0, 0, 0 };
   unsigned char    buf[buflen];
#endif

#if DEBUG_DETECT
   printk( "fdomain_16x0_detect()," );
#endif

   for (i = 0; !bios_base && i < ADDRESS_COUNT; i++) {
#if DEBUG_DETECT
      printk( " %x(%x),", (unsigned)addresses[i], (unsigned)bios_base );
#endif
      for (j = 0; !bios_base && j < SIGNATURE_COUNT; j++) {
	 if (!memcmp( ((char *)addresses[i] + signatures[j].sig_offset),
		      signatures[j].signature, signatures[j].sig_length )) {
	    bios_major = signatures[j].major_bios_version;
	    bios_minor = signatures[j].minor_bios_version;
	    bios_base = addresses[i];
	 }
      }
   }

   if (!bios_base) {
#if DEBUG_DETECT
      printk( " FAILED: NO BIOS\n" );
#endif
      return 0;
   }

   if (bios_major == 2) {
      /* The TMC-1660/TMC-1680 has a RAM area just after the BIOS ROM.
	 Assuming the ROM is enabled (otherwise we wouldn't have been
	 able to read the ROM signature :-), then the ROM sets up the
	 RAM area with some magic numbers, such as a list of port
	 base addresses and a list of the disk "geometry" reported to
	 DOS (this geometry has nothing to do with physical geometry).
       */

      port_base = *((char *)bios_base + 0x1fcc)
	    + (*((char *)bios_base + 0x1fcd) << 8);
   
#if DEBUG_DETECT
      printk( " %x,", port_base );
#endif

      for (flag = 0, i = 0; !flag && i < PORT_COUNT; i++) {
	 if (port_base == ports[i])
	       ++flag;
      }

      if (flag)
	    flag = fdomain_is_valid_port( port_base );
   }

   if (!flag) {			/* Cannot get port base from BIOS RAM */
      
      /* This is a bad sign.  It usually means that someone patched the
	 BIOS signature list (the signatures variable) to contain a BIOS
	 signature for a board *OTHER THAN* the TMC-1660/TMC-1680.  It
	 also means that we don't have a Version 2.0 BIOS :-)
       */
      
#if DEBUG_DETECT
      if (bios_major != 2) printk( " RAM FAILED, " );
#endif

      /* Anyway, the alternative to finding the address in the RAM is
	 to just search through every possible port address for one
	 that is attached to the Future Domain card.  Don't panic,
	 though, about reading all these random port addresses--there
	 are rumors that the Future Domain BIOS does something very
	 similar.

	 Do not, however, check ports which the kernel knows are being used
         by another driver.
       */

      for (i = 0; !flag && i < PORT_COUNT; i++) {
	 port_base = ports[i];
	 if (check_region( port_base, 0x10 )) {
#if DEBUG_DETECT
	    printf( " (%x inuse),", port_base );
#endif
	    continue;
	 }
#if DEBUG_DETECT
	 printk( " %x,", port_base );
#endif
	 flag = fdomain_is_valid_port( port_base );
      }
   }

   if (!flag) {
#if DEBUG_DETECT
      printk( " FAILED: NO PORT\n" );
#endif
      return 0;		/* Cannot find valid set of ports */
   }

   print_banner();

   SCSI_Mode_Cntl_port   = port_base + SCSI_Mode_Cntl;
   FIFO_Data_Count_port  = port_base + FIFO_Data_Count;
   Interrupt_Cntl_port   = port_base + Interrupt_Cntl;
   Interrupt_Status_port = port_base + Interrupt_Status;
   Read_FIFO_port        = port_base + Read_FIFO;
   Read_SCSI_Data_port   = port_base + Read_SCSI_Data;
   SCSI_Cntl_port        = port_base + SCSI_Cntl;
   SCSI_Data_NoACK_port  = port_base + SCSI_Data_NoACK;
   SCSI_Status_port      = port_base + SCSI_Status;
   TMC_Cntl_port         = port_base + TMC_Cntl;
   TMC_Status_port       = port_base + TMC_Status;
   Write_FIFO_port       = port_base + Write_FIFO;
   Write_SCSI_Data_port  = port_base + Write_SCSI_Data;

   fdomain_16x0_reset( NULL );

   if (fdomain_test_loopback()) {
#if DEBUG_DETECT
      printk( "Future Domain: LOOPBACK TEST FAILED, FAILING DETECT!\n" );
#endif
      return 0;
   }

   this_host = hostnum;

				/* Log IRQ with kernel */
   
   if (!interrupt_level) {
      panic( "Future Domain: *NO* interrupt level selected!\n" );
   } else {
      /* Register the IRQ with the kernel */

      sa.sa_handler  = fdomain_16x0_intr;
      sa.sa_flags    = SA_INTERRUPT;
      sa.sa_mask     = 0;
      sa.sa_restorer = NULL;
      
      retcode = irqaction( interrupt_level, &sa );

      if (retcode < 0) {
	 if (retcode == -EINVAL) {
	    printk( "Future Domain: IRQ %d is bad!\n", interrupt_level );
	    printk( "               This shouldn't happen!\n" );
	    printk( "               Send mail to faith@cs.unc.edu\n" );
	 } else if (retcode == -EBUSY) {
	    printk( "Future Domain: IRQ %d is already in use!\n",
		    interrupt_level );
	    printk( "               Please use another IRQ!\n" );
	 } else {
	    printk( "Future Domain: Error getting IRQ %d\n", interrupt_level );
	    printk( "               This shouldn't happen!\n" );
	    printk( "               Send mail to faith@cs.unc.edu\n" );
	 }
	 panic( "Future Domain: Driver requires interruptions\n" );
      } else {
	 printk( "Future Domain: IRQ %d requested from kernel\n",
		 interrupt_level );
      }
   }

				/* Log I/O ports with kernel */

   snarf_region( port_base, 0x10 );

   if ((bios_major == 3 && bios_minor >= 2) || bios_major < 0) {
      adapter_mask = 0x80;
      scsi_hosts[this_host].this_id = 7;
   }
   
#if DO_DETECT

   /* These routines are here because of the way the SCSI bus behaves after
      a reset.  This appropriate behavior was not handled correctly by the
      higher level SCSI routines when I first wrote this driver.  Now,
      however, correct scan routines are part of scsi.c and these routines
      are no longer needed.  However, this code is still good for
      debugging.  */

   SCinit.request_buffer  = SCinit.buffer = buf;
   SCinit.request_bufflen = SCinit.bufflen = sizeof(buf)-1;
   SCinit.use_sg          = 0;
   SCinit.lun             = 0;

   printk( "Future Domain detection routine scanning for devices:\n" );
   for (i = 0; i < 8; i++) {
      SCinit.target = i;
      if (i == scsi_hosts[this_host].this_id) /* Skip host adapter */
	    continue;
      memcpy(SCinit.cmnd, do_request_sense, sizeof(do_request_sense));
      retcode = fdomain_16x0_command(&SCinit);
      if (!retcode) {
	 memcpy(SCinit.cmnd, do_inquiry, sizeof(do_inquiry));
	 retcode = fdomain_16x0_command(&SCinit);
	 if (!retcode) {
	    printk( "     SCSI ID %d: ", i );
	    for (j = 8; j < (buf[4] < 32 ? buf[4] : 32); j++)
		  printk( "%c", buf[j] >= 20 ? buf[j] : ' ' );
	    memcpy(SCinit.cmnd, do_read_capacity, sizeof(do_read_capacity));
	    retcode = fdomain_16x0_command(&SCinit);
	    if (!retcode) {
	       unsigned long blocks, size, capacity;
	       
	       blocks = (buf[0] << 24) | (buf[1] << 16)
		     | (buf[2] << 8) | buf[3];
	       size = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7];
	       capacity = +( +(blocks / 1024L) * +(size * 10L)) / 1024L;
	       
	       printk( "%lu MB (%lu byte blocks)",
		       ((capacity + 5L) / 10L), size );
	    } else {
	       memcpy(SCinit.cmnd, do_request_sense, sizeof(do_request_sense));
	       retcode = fdomain_16x0_command(&SCinit);
	    }
	    printk ("\n" );
	 } else {
	    memcpy(SCinit.cmnd, do_request_sense, sizeof(do_request_sense));
	    retcode = fdomain_16x0_command(&SCinit);
	 }
      }
   }
#endif

   return 1;
}

const char *fdomain_16x0_info(void)
{
   static char buffer[80];
   char        *pt;
   
   strcpy( buffer, "Future Domain: TMC-16x0 SCSI driver, version" );
   if (strchr( VERSION, ':')) { /* Assume VERSION is an RCS Revision string */
      strcat( buffer, strchr( VERSION, ':' ) + 1 );
      pt = strrchr( buffer, '$') - 1;
      if (!pt)  		/* Stripped RCS Revision string? */
	    pt = buffer + strlen( buffer ) - 1;
      if (*pt != ' ')
	    ++pt;
      *pt++ = '\n';
      *pt = '\0';
   } else {			/* Assume VERSION is a number */
      strcat( buffer, " " VERSION "\n" );
   }
      
   return buffer;
}

#if 0
static int fdomain_arbitrate( void )
{
   int           status = 0;
   unsigned long timeout;

#if EVERY_ACCESS
   printk( "fdomain_arbitrate()\n" );
#endif
   
   outb( 0x00, SCSI_Cntl_port );              /* Disable data drivers */
   outb( adapter_mask, port_base + SCSI_Data_NoACK ); /* Set our id bit */
   outb( 0x04 | PARITY_MASK, TMC_Cntl_port ); /* Start arbitration */

   timeout = jiffies + 50;	              /* 500 mS */
   while (jiffies < timeout) {
      status = inb( TMC_Status_port );        /* Read adapter status */
      if (status & 0x02)		      /* Arbitration complete */
	    return 0;	
   }

   /* Make bus idle */
   fdomain_make_bus_idle();

#if EVERY_ACCESS
   printk( "Arbitration failed, status = %x\n", status );
#endif
#if ERRORS_ONLY
   printk( "Future Domain: Arbitration failed, status = %x", status );
#endif
   return 1;
}
#endif

static int fdomain_select( int target )
{
   int           status;
   unsigned long timeout;


   outb( 0x82, SCSI_Cntl_port ); /* Bus Enable + Select */
   outb( adapter_mask | (1 << target), SCSI_Data_NoACK_port );

   /* Stop arbitration and enable parity */
   outb( PARITY_MASK, TMC_Cntl_port ); 

   timeout = jiffies + 25;	        /* 250mS */
   while (jiffies < timeout) {
      status = inb( SCSI_Status_port ); /* Read adapter status */
      if (status & 1) {		        /* Busy asserted */
	 /* Enable SCSI Bus (on error, should make bus idle with 0) */
	 outb( 0x80, SCSI_Cntl_port );
	 return 0;
      }
   }
   /* Make bus idle */
   fdomain_make_bus_idle();
#if EVERY_ACCESS
   if (!target) printk( "Selection failed\n" );
#endif
#if ERRORS_ONLY
   if (!target) printk( "Future Domain: Selection failed" );
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女视频在线| 91碰在线视频| 国产欧美日韩精品在线| 色综合色综合色综合色综合色综合 | 综合av第一页| 99久久99久久久精品齐齐| 欧美精品一区二区精品网| 亚洲电影你懂得| www.99精品| 国产精品视频九色porn| 国产成人午夜高潮毛片| 国产精品久久久一本精品| 国产三级一区二区| 99免费精品在线| 亚洲欧美日本韩国| 一本久久精品一区二区| 免费av网站大全久久| 国产精品午夜免费| 国产一区二区中文字幕| 91色在线porny| 图片区小说区国产精品视频| 国产精品丝袜黑色高跟| www.日韩在线| 久久99国产精品麻豆| 美女www一区二区| 久久精品99国产国产精| 亚洲少妇中出一区| 亚洲综合自拍偷拍| 日韩一级二级三级精品视频| 99re这里只有精品首页| 国产91清纯白嫩初高中在线观看| 日韩久久久久久| 亚洲欧美自拍偷拍色图| 麻豆精品一区二区av白丝在线| 日本一区免费视频| 欧洲激情一区二区| 亚洲尤物视频在线| 蜜臀a∨国产成人精品| 久久综合九色综合欧美就去吻| 在线播放国产精品二区一二区四区| 欧美激情综合在线| 国产精品久久一级| 亚洲欧美色一区| 天天爽夜夜爽夜夜爽精品视频| 欧美日韩精品一区二区| 日韩欧美在线一区二区三区| 色综合久久88色综合天天免费| 欧日韩精品视频| 欧美性感一类影片在线播放| 欧美三级电影在线观看| 国产成人夜色高潮福利影视| 国产精品自拍毛片| 欧美亚洲国产一区二区三区va | 在线区一区二视频| 亚洲丝袜制服诱惑| 亚洲色大成网站www久久九九| 欧美日本在线播放| 国产亚洲精品资源在线26u| 欧美在线三级电影| 欧美不卡一二三| 亚洲成人av电影| ㊣最新国产の精品bt伙计久久| 国产不卡在线一区| 欧美二区在线观看| 亚洲午夜在线观看视频在线| 国产精品1区2区3区| 久久国产精品无码网站| 91影视在线播放| 日韩三级高清在线| 国产精品久久久久久一区二区三区| 中文字幕一区二| 免费av网站大全久久| 666欧美在线视频| 亚洲欧美在线视频| 一区二区三区自拍| 91麻豆swag| 欧美男女性生活在线直播观看| 性做久久久久久久免费看| 国产一区二区三区综合| 精品国产百合女同互慰| 欧美一级精品在线| 欧洲精品中文字幕| 亚洲视频中文字幕| 免费看欧美女人艹b| 亚洲已满18点击进入久久| 欧美美女一区二区在线观看| 亚洲欧洲三级电影| 久久国产剧场电影| 制服丝袜在线91| 激情久久五月天| 国产精品二三区| 国产精品久久久一区麻豆最新章节| 一区二区三区欧美久久| 最新国产の精品合集bt伙计| 久久97超碰国产精品超碰| 欧美一级片在线观看| 亚洲专区一二三| 91在线观看成人| 精品动漫一区二区三区在线观看| 亚洲成在人线在线播放| 欧洲生活片亚洲生活在线观看| 亚洲午夜激情网页| 69成人精品免费视频| 高清在线成人网| 亚洲欧美激情插 | 亚洲猫色日本管| 成人夜色视频网站在线观看| 欧美一区二区三区在| 裸体健美xxxx欧美裸体表演| 久久在线免费观看| 亚洲三级在线免费观看| 韩国中文字幕2020精品| 七七婷婷婷婷精品国产| 九九国产精品视频| 麻豆一区二区三| 久久天堂av综合合色蜜桃网| 欧美性大战久久久久久久 | 精品免费日韩av| 日本福利一区二区| 蜜桃久久久久久| 精品国产一区二区三区av性色 | 美国十次综合导航| 欧美一区午夜精品| 一区二区三区在线视频观看| 懂色中文一区二区在线播放| 午夜精品福利一区二区蜜股av| 精品国产百合女同互慰| 一区二区三区成人| 成人午夜短视频| 成年人国产精品| 蜜臀精品久久久久久蜜臀| 亚洲欧美日韩小说| 亚洲视频一二三| 国产三级欧美三级| 久久影院午夜论| 在线亚洲人成电影网站色www| 国产精品私房写真福利视频| 91精品国产日韩91久久久久久| 中文字幕日韩一区| 国产日韩欧美精品一区| 久久久久免费观看| 久久先锋影音av| 精品国产乱码久久久久久浪潮 | 欧美日韩在线不卡| www.欧美.com| 亚洲一二三区视频在线观看| 美女在线视频一区| 久久er精品视频| 亚洲欧美偷拍卡通变态| 自拍av一区二区三区| 欧美亚洲一区二区在线| 蜜臀av在线播放一区二区三区| 久久精品欧美一区二区三区不卡| 欧美日韩专区在线| 91精品国产欧美一区二区18 | 国产电影一区二区三区| 97国产一区二区| 日韩一区二区在线播放| 国产精品午夜免费| 日本不卡视频在线观看| 国产成人av一区二区三区在线| 欧美一a一片一级一片| 国产亚洲自拍一区| 亚洲h在线观看| 成人av在线观| 日韩欧美一区二区久久婷婷| 亚洲美女屁股眼交3| 国产又黄又大久久| 欧美日韩黄色影视| 成人欧美一区二区三区视频网页| 奇米综合一区二区三区精品视频| 成人av资源网站| 国产午夜精品一区二区三区四区 | 欧美一区日韩一区| 一区二区三区在线观看动漫| 国产成人精品亚洲777人妖| 制服丝袜中文字幕亚洲| 一级日本不卡的影视| 成人午夜精品一区二区三区| 欧美videos中文字幕| 日日摸夜夜添夜夜添国产精品| 成人av电影观看| 国产欧美一区二区三区在线老狼| 日本特黄久久久高潮| 欧美午夜影院一区| 亚洲女人的天堂| 91香蕉视频黄| 中文字幕一区三区| 国产91在线观看丝袜| 久久综合色鬼综合色| 久久aⅴ国产欧美74aaa| 欧美精品xxxxbbbb| 亚洲bt欧美bt精品| 欧美日韩中文精品| 国产精品久久久久久妇女6080 | 91久久国产综合久久| 久久亚洲欧美国产精品乐播| 久久不见久久见免费视频1 | 国产老妇另类xxxxx| 精品国精品自拍自在线|