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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? aha152x.c

?? 內(nèi)核是系統(tǒng)的心臟
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* aha152x.c -- Adaptec AHA-152x driver
 * Author: Juergen E. Fischer, fischer@server.et-inf.fho-emden.de
 * Copyright 1993 Juergen E. Fischer
 *
 *
 * This driver is based on
 *   fdomain.c -- Future Domain TMC-16x0 driver
 * which is
 *   Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
 *

 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.

 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 
 *
 * $Id: aha152x.c,v 0.101 1993/12/13 01:16:27 root Exp $
 *

 * $Log: aha152x.c,v $
 * Revision 0.101  1993/12/13  01:16:27  root
 * - fixed STATUS phase (non-GOOD stati were dropped sometimes;
 *   fixes problems with CD-ROM sector size detection & media change)
 *
 * Revision 0.100  1993/12/10  16:58:47  root
 * - fix for unsuccessful selections in case of non-continuous id assignments
 *   on the scsi bus.
 *
 * Revision 0.99  1993/10/24  16:19:59  root
 * - fixed DATA IN (rare read errors gone)
 *
 * Revision 0.98  1993/10/17  12:54:44  root
 * - fixed some recent fixes (shame on me)
 * - moved initialization of scratch area to aha152x_queue
 *
 * Revision 0.97  1993/10/09  18:53:53  root
 * - DATA IN fixed. Rarely left data in the fifo.
 *
 * Revision 0.96  1993/10/03  00:53:59  root
 * - minor changes on DATA IN
 *
 * Revision 0.95  1993/09/24  10:36:01  root
 * - change handling of MSGI after reselection
 * - fixed sti/cli
 * - minor changes
 *
 * Revision 0.94  1993/09/18  14:08:22  root
 * - fixed bug in multiple outstanding command code
 * - changed detection
 * - support for kernel command line configuration
 * - reset corrected
 * - changed message handling
 *
 * Revision 0.93  1993/09/15  20:41:19  root
 * - fixed bugs with multiple outstanding commands
 *
 * Revision 0.92  1993/09/13  02:46:33  root
 * - multiple outstanding commands work (no problems with IBM drive)
 *
 * Revision 0.91  1993/09/12  20:51:46  root
 * added multiple outstanding commands
 * (some problem with this $%&? IBM device remain)
 *
 * Revision 0.9  1993/09/12  11:11:22  root
 * - corrected auto-configuration
 * - changed the auto-configuration (added some '#define's)
 * - added support for dis-/reconnection
 *
 * Revision 0.8  1993/09/06  23:09:39  root
 * - added support for the drive activity light
 * - minor changes
 *
 * Revision 0.7  1993/09/05  14:30:15  root
 * - improved phase detection
 * - now using the new snarf_region code of 0.99pl13
 *
 * Revision 0.6  1993/09/02  11:01:38  root
 * first public release; added some signatures and biosparam()
 *
 * Revision 0.5  1993/08/30  10:23:30  root
 * fixed timing problems with my IBM drive
 *
 * Revision 0.4  1993/08/29  14:06:52  root
 * fixed some problems with timeouts due incomplete commands
 *
 * Revision 0.3  1993/08/28  15:55:03  root
 * writing data works too.  mounted and worked on a dos partition
 *
 * Revision 0.2  1993/08/27  22:42:07  root
 * reading data works.  Mounted a msdos partition.
 *
 * Revision 0.1  1993/08/25  13:38:30  root
 * first "damn thing doesn't work" version
 *
 * Revision 0.0  1993/08/14  19:54:25  root
 * empty function bodies; detect() works.
 *

 **************************************************************************


 
 DESCRIPTION:

 This is the Linux low-level SCSI driver for Adaptec AHA-1520/1522
 SCSI host adapters.


 PER-DEFINE CONFIGURABLE OPTIONS:

 AUTOCONF       : use configuration the controller reports (only 152x)
 IRQ            : override interrupt channel (9,10,11 or 12) (default 11)
 SCSI_ID        : override scsiid of AIC-6260 (0-7) (default 7)
 RECONNECT      : override target dis-/reconnection/multiple outstanding commands
 SKIP_BIOSTEST  : Don't test for BIOS signature (AHA-1510 or disabled BIOS)
 PORTBASE       : Force port base. Don't try to probe


 LILO COMMAND LINE OPTIONS:

 aha152x=<PORTBASE>,<IRQ>,<SCSI-ID>,<RECONNECT>

 The normal configuration can be overridden by specifying a command line.
 When you do this, the BIOS test is skipped. Entered values have to be
 valid (known). Don't use values that aren't support under normal operation.
 If you think that you need other value: contact me.


 REFERENCES USED:

 "AIC-6260 SCSI Chip Specification", Adaptec Corporation.

 "SCSI COMPUTER SYSTEM INTERFACE - 2 (SCSI-2)", X3T9.2/86-109 rev. 10h

 "Writing a SCSI device driver for Linux", Rik Faith (faith@cs.unc.edu)

 "Kernel Hacker's Guide", Michael K. Johnson (johnsonm@sunsite.unc.edu)

 "Adaptec 1520/1522 User's Guide", Adaptec Corporation.
 
 Michael K. Johnson (johnsonm@sunsite.unc.edu)

 Drew Eckhardt (drew@cs.colorado.edu)

 Eric Youngdale (eric@tantalus.nrl.navy.mil) 

 special thanks to Eric Youngdale for the free(!) supplying the
 documentation on the chip.

 **************************************************************************/

#include "aha152x.h"

#include <linux/sched.h>
#include <asm/io.h>
#include "../block/blk.h"
#include "scsi.h"
#include "hosts.h"
#include "constants.h"
#include <asm/system.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/wait.h>
#include <linux/ioport.h>

/* DEFINES */


/* If auto configuration is disabled, IRQ, SCSI_ID and RECONNECT have to
   be predefined */
#if !defined(AUTOCONF)
#if !defined(IRQ)
#error undefined IRQ; define AUTOCONF or IRQ
#endif
#if !defined(SCSI_ID)
#error undefined SCSI_ID; define AUTOCONF or SCSI_ID
#endif
#if !defined(RECONNECT)
#error undefined RECONNECT; define AUTOCONF or RECONNECT
#endif
#endif

/* I use this when I'm looking for weird bugs */
#define DEBUG_TIMING 

#if defined(DEBUG)

#undef  SKIP_PORTS              /* don't display ports */

#undef  DEBUG_QUEUE             /* debug queue() */
#undef  DEBUG_RESET             /* debug reset() */
#undef  DEBUG_INTR              /* debug intr() */
#undef  DEBUG_SELECTION         /* debug selection part in intr() */
#undef  DEBUG_MSGO              /* debug message out phase in intr() */
#undef  DEBUG_MSGI              /* debug message in phase in intr() */
#undef  DEBUG_STATUS            /* debug status phase in intr() */
#undef  DEBUG_CMD               /* debug command phase in intr() */
#undef  DEBUG_DATAI             /* debug data in phase in intr() */
#undef  DEBUG_DATAO             /* debug data out phase in intr() */
#undef  DEBUG_ABORT             /* debug abort() */
#undef  DEBUG_DONE              /* debug done() */
#undef  DEBUG_BIOSPARAM         /* debug biosparam() */

#undef  DEBUG_RACE              /* debug race conditions */
#undef  DEBUG_PHASES            /* debug phases (useful to trace) */
#undef  DEBUG_QUEUES            /* debug reselection */

/* recently used for debugging */
#if 0
#define DEBUG_PHASES
#define DEBUG_DATAI
#endif

#endif

#define DEBUG_RESET             /* resets should be rare */
#define DEBUG_ABORT             /* aborts too */

/* END OF DEFINES */

/* some additional "phases" for getphase() */
#define P_BUSFREE  1
#define P_PARITY   2

char *aha152x_id = "Adaptec 152x SCSI driver; $Revision: 0.101 $\n";

static int port_base      = 0;
static int this_host      = 0;
static int can_disconnect = 0;
static int commands       = 0;

/* set by aha152x_setup according to the command line */
static int setup_called    = 0;
static int setup_portbase  = 0;
static int setup_irq       = 0;
static int setup_scsiid    = 0;
static int setup_reconnect = 0;

static char *setup_str = (char *)NULL;

enum {
   not_issued   = 0x01,
   in_selection = 0x02,
   disconnected = 0x04,
   aborted      = 0x08,
   sent_ident   = 0x10,
   in_other     = 0x20,
};
 
/*
 * Command queues:
 * issue_SC        : commands that are queued to be issued 
 * current_SC      : command that's currently using the bus
 * disconnected_SC : commands that that have been disconnected 
 */
static Scsi_Cmnd            *issue_SC        = NULL;
static Scsi_Cmnd            *current_SC      = NULL;
static Scsi_Cmnd            *disconnected_SC = NULL;

static struct wait_queue    *abortion_complete;
static int                  abort_result;

void aha152x_intr( int irqno );
void aha152x_done( int error );
void aha152x_setup( char *str, int *ints );

static void aha152x_reset_ports(void);
static void aha152x_panic(char *msg);

static void disp_ports(void);
static void show_command(Scsi_Cmnd *ptr);
static void show_queues(void);
static void disp_enintr(void);

#if defined(DEBUG_RACE)
static void enter_driver(const char *);
static void leave_driver(const char *);
#endif

/* possible locations for the Adaptec BIOS */
static void *addresses[] =
{
  (void *) 0xdc000,   /* default first */
  (void *) 0xc8000,
  (void *) 0xcc000,
  (void *) 0xd0000,
  (void *) 0xd4000,
  (void *) 0xd8000,
  (void *) 0xe0000,
  (void *) 0xf0000,
};
#define ADDRESS_COUNT (sizeof( addresses ) / sizeof( unsigned ))

/* possible i/o adresses for the AIC-6260 */
static unsigned short ports[] =
{
  0x340,      /* default first */
  0x140
};
#define PORT_COUNT (sizeof( ports ) / sizeof( unsigned short ))

/* possible interrupt channels */
static unsigned short ints[] = { 9, 10, 11, 12 };

/* signatures for various AIC-6260 based controllers */
static struct signature {
  char *signature;
  int  sig_offset;
  int  sig_length;
} signatures[] =
{
  {
    "Adaptec AHA-1520 BIOS\r\n\0\
Version 1.4      \r\n\0\
Copyright 1990 Adaptec, Inc.\r\n\
All Rights Reserved\r\n \r\n \r\n", 0x102e, 101
  },                                                          /* Adaptec 152x */
  {
    "Adaptec ASW-B626 BIOS\r\n\0\
Version 1.0      \r\n\0\
Copyright 1990 Adaptec, Inc.\r\n\
All Rights Reserved\r\n\0 \r\n \r\n", 0x1029, 102
  },                                                   /* on-board controller */
  { "Adaptec BIOS: ASW-B626", 0x0F, 22},               /* on-board controller */
  { "Adaptec ASW-B626 S2 BIOS", 0x2e6c, 24},           /* on-board controller */
};
#define SIGNATURE_COUNT (sizeof( signatures ) / sizeof( struct signature ))


static void do_pause( unsigned amount ) /* Pause for amount*10 milliseconds */
{
   unsigned long the_time = jiffies + amount; /* 0.01 seconds per jiffy */

   while (jiffies < the_time)
     ;
}

/*
 *  queue services:
 */
static inline void append_SC( Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
{
  Scsi_Cmnd *end;

  new_SC->host_scribble = (unsigned char *) NULL;
  if(!*SC)
    *SC=new_SC;
  else
    {
      for( end=*SC;
           end->host_scribble;
           end = (Scsi_Cmnd *) end->host_scribble )
        ;
      end->host_scribble = (unsigned char *) new_SC;
    }
}

static inline Scsi_Cmnd *remove_first_SC( Scsi_Cmnd **SC )
{
  Scsi_Cmnd *ptr;

  ptr=*SC;
  if(ptr)
    *SC= (Scsi_Cmnd *) (*SC)->host_scribble;
  return ptr;
}

static inline Scsi_Cmnd *remove_SC( Scsi_Cmnd **SC, int target, int lun )
{
  Scsi_Cmnd *ptr, *prev;

  for( ptr=*SC, prev=NULL;
       ptr && ((ptr->target!=target) || (ptr->lun!=lun));
       prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble )
    ;

  if(ptr)
    if(prev)
      prev->host_scribble = ptr->host_scribble;
    else
      *SC= (Scsi_Cmnd *) ptr->host_scribble;
  return ptr;
}

/*
 * read inbound byte and wait for ACK to get low
 */
static void make_acklow(void)
{
  SETPORT( SXFRCTL0, CH1|SPIOEN );
  GETPORT(SCSIDAT);
  SETPORT( SXFRCTL0, CH1 );

  while( TESTHI( SCSISIG, ACKI ) )
    ;
}

/*
 * detect current phase more reliable:
 * phase is valid, when the target asserts REQ after we've deasserted ACK.
 *
 * return value is a valid phase or an error code.
 *
 * errorcodes:
 *   P_BUSFREE   BUS FREE phase detected
 *   P_PARITY    parity error in DATA phase
 */
static int getphase(void)
{
  int phase, sstat1;
  
  while( 1 )
    {
      do
        {
          while( !( ( sstat1 = GETPORT( SSTAT1 ) ) & (BUSFREE|SCSIRSTI|REQINIT ) ) )
            ;
          if( sstat1 & BUSFREE )
            return P_BUSFREE;
          if( sstat1 & SCSIRSTI )
            {
              /* IBM drive responds with RSTI to RSTO */
              printk("aha152x: RESET IN\n");
              SETPORT( SSTAT1, SCSIRSTI );
            }
        }
      while( TESTHI( SCSISIG, ACKI ) || TESTLO( SSTAT1, REQINIT ) );

      SETPORT( SSTAT1, CLRSCSIPERR );
  
      phase = GETPORT( SCSISIG ) & P_MASK ;

      if( TESTHI( SSTAT1, SCSIPERR ) )
        {
          if( (phase & (CDO|MSGO))==0 )                         /* DATA phase */
            return P_PARITY;

          make_acklow();
        }
      else
        return phase;
    }
}

/* called from init/main.c */
void aha152x_setup( char *str, int *ints)
{
  if(setup_called)
    panic("aha152x: aha152x_setup called twice.\n");

  setup_called=ints[0];
  setup_str=str;

  if(ints[0] != 4)
    return; 

  setup_portbase  = ints[1];
  setup_irq       = ints[2];
  setup_scsiid    = ints[3];
  setup_reconnect = ints[4];
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区视频在线看| 亚洲成人资源在线| 欧美性一二三区| 激情综合网最新| 亚洲影视资源网| 亚洲国产成人一区二区三区| 日本精品一级二级| 成人黄色在线看| 日韩在线一区二区三区| 欧美猛男超大videosgay| 国产九色sp调教91| 精品一区二区三区欧美| 无吗不卡中文字幕| 香蕉久久一区二区不卡无毒影院 | 亚洲视频 欧洲视频| 日韩免费观看高清完整版| 欧美最猛性xxxxx直播| 亚洲精品中文字幕在线观看| 日本高清视频一区二区| 高清av一区二区| a级高清视频欧美日韩| 国产一区啦啦啦在线观看| 久久综合五月天婷婷伊人| 9人人澡人人爽人人精品| 国产拍揄自揄精品视频麻豆| 日韩精品一区国产麻豆| 国产成人欧美日韩在线电影| 国产精品一区一区| 成人永久aaa| 成人a级免费电影| 一本一道波多野结衣一区二区| av日韩在线网站| 91麻豆自制传媒国产之光| 91蝌蚪porny| 欧美精品乱人伦久久久久久| 日韩精品一区二区三区老鸭窝| 欧美电影免费提供在线观看| 欧美激情一区二区三区四区| 国产精品乱人伦中文| 亚洲小说春色综合另类电影| 日韩高清电影一区| 粉嫩av一区二区三区| 91污在线观看| 日韩一级片网站| 亚洲色图欧美偷拍| 免费成人在线视频观看| 成人av免费在线播放| 欧美人成免费网站| 欧美韩日一区二区三区| 亚洲午夜精品在线| 国产在线视视频有精品| 欧美视频在线播放| 中文字幕精品一区| 蜜臀av一区二区在线免费观看| 成人理论电影网| 日韩欧美高清在线| 亚洲成av人片一区二区| 成人午夜激情在线| 精品电影一区二区三区| 亚洲资源中文字幕| voyeur盗摄精品| 久久久影院官网| 蜜臀av性久久久久蜜臀aⅴ| 色婷婷综合五月| 中文字幕一区二区三区在线不卡| 三级久久三级久久久| 欧美无砖专区一中文字| 中文字幕一区av| thepron国产精品| 欧美极品少妇xxxxⅹ高跟鞋| 国内精品伊人久久久久av一坑| 制服丝袜中文字幕亚洲| 天堂一区二区在线| 欧美日本在线播放| 美女精品自拍一二三四| 欧美一卡二卡在线观看| 日韩主播视频在线| 欧美tickle裸体挠脚心vk| 男男成人高潮片免费网站| 日韩美一区二区三区| 韩国女主播成人在线观看| 日韩欧美国产系列| 国产成人免费网站| 亚洲视频资源在线| 色婷婷综合久久久| 日本视频一区二区| 国产精品视频免费看| 色婷婷精品久久二区二区蜜臂av | 一本大道久久a久久综合| 亚洲卡通动漫在线| 国产色一区二区| 风间由美一区二区三区在线观看 | 日本伦理一区二区| 免费成人美女在线观看| 精品国产伦理网| 日韩一区精品视频| 国产婷婷色一区二区三区四区| 成人精品亚洲人成在线| 亚洲欧美经典视频| 91亚洲国产成人精品一区二区三| 久久精品一区二区三区不卡| 成人免费看视频| 中文字幕巨乱亚洲| 色视频欧美一区二区三区| 亚洲精品国产a久久久久久| 欧美系列日韩一区| 国产99久久久国产精品潘金| 亚洲成av人片一区二区梦乃| 日本一区二区不卡视频| 欧美不卡在线视频| 精品视频一区 二区 三区| 韩国三级中文字幕hd久久精品| 一区二区三国产精华液| 中文字幕高清不卡| 久久亚洲一区二区三区四区| 欧美精品久久久久久久多人混战| av成人老司机| 懂色中文一区二区在线播放| 久久99热这里只有精品| 日本欧美在线看| 亚洲在线观看免费| 亚洲一二三四在线观看| 亚洲区小说区图片区qvod| 综合欧美亚洲日本| 亚洲欧美色图小说| 亚洲精品成人少妇| 亚洲第一av色| 日本vs亚洲vs韩国一区三区二区 | 777色狠狠一区二区三区| 欧美在线你懂得| 欧美肥大bbwbbw高潮| 91精品国产综合久久精品图片 | 亚洲综合视频网| 一区二区三区免费在线观看| 亚洲精品水蜜桃| 日本视频在线一区| 狠狠v欧美v日韩v亚洲ⅴ| 国产成人精品三级| 91色乱码一区二区三区| 欧美精品乱码久久久久久| 91精品国产高清一区二区三区蜜臀| 日韩三级视频在线看| 国产性色一区二区| 一区二区国产视频| 麻豆精品视频在线| 99热这里都是精品| 欧美美女视频在线观看| 欧美国产成人精品| 青青青爽久久午夜综合久久午夜| 国产精一区二区三区| 在线观看中文字幕不卡| 久久久蜜桃精品| 亚洲1区2区3区视频| 高清久久久久久| 欧美电视剧在线观看完整版| 国产精品久久久一本精品| 蜜桃av一区二区三区| 日本福利一区二区| 中文字幕欧美区| 国内精品写真在线观看| 91精品国产色综合久久不卡蜜臀| 综合色中文字幕| 成人中文字幕合集| 久久久电影一区二区三区| 日韩精品一二三区| 欧美成人a∨高清免费观看| 一区二区三区四区视频精品免费| 国产成人综合视频| 国产欧美精品日韩区二区麻豆天美| 午夜视频在线观看一区| 99久久夜色精品国产网站| 日本一区二区免费在线| 九九久久精品视频| 精品国产91亚洲一区二区三区婷婷| 亚洲电影一级片| 91精品国产综合久久精品app| 亚洲第四色夜色| 777a∨成人精品桃花网| 日本在线不卡视频一二三区| 欧美午夜在线一二页| 亚洲成a人v欧美综合天堂下载| 在线精品视频一区二区| 亚洲综合免费观看高清完整版在线| 成人免费观看视频| 亚洲色图欧美偷拍| 欧美中文字幕一二三区视频| 亚洲无线码一区二区三区| 欧美精品xxxxbbbb| 国内精品在线播放| 中文字幕免费观看一区| 亚洲精品视频在线| 日韩一区二区在线观看视频| 亚洲激情五月婷婷| 欧美高清www午色夜在线视频| 久草精品在线观看| 中文字幕中文在线不卡住| 2017欧美狠狠色| bt7086福利一区国产| 麻豆一区二区三| 综合欧美一区二区三区|