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

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

?? aha152x.c

?? 內核是系統的心臟
?? 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];
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆123| 精品欧美一区二区在线观看| 欧美成人一级视频| 欧美激情一区二区三区| 天天爽夜夜爽夜夜爽精品视频| 国产一区二区三区最好精华液| 欧美日韩精品欧美日韩精品| 国产日韩精品一区二区浪潮av| 天天免费综合色| 91久久精品网| 亚洲天堂福利av| 粉嫩aⅴ一区二区三区四区五区| 日韩欧美黄色影院| 亚洲成人免费视| 91热门视频在线观看| 久久久久久电影| 精品无人区卡一卡二卡三乱码免费卡| 欧美影片第一页| 一区av在线播放| 97久久超碰精品国产| 国产亚洲污的网站| 加勒比av一区二区| 欧美videos中文字幕| 奇米色777欧美一区二区| 欧美日韩精品一区二区三区| 亚洲午夜在线电影| 欧美三级三级三级爽爽爽| 有码一区二区三区| 色综合久久综合| 亚洲日本护士毛茸茸| 成人免费av网站| 国产精品视频你懂的| 国产98色在线|日韩| 国产日韩欧美一区二区三区综合| 美日韩一区二区三区| 91麻豆精品国产自产在线观看一区| 亚洲线精品一区二区三区| 在线观看亚洲专区| 一区二区三区在线观看欧美| 在线观看av一区| 香蕉久久一区二区不卡无毒影院| 欧美日韩国产精选| 午夜欧美视频在线观看| 欧美顶级少妇做爰| 久久成人麻豆午夜电影| 久久亚洲二区三区| 粉嫩13p一区二区三区| 亚洲视频1区2区| 欧美三级三级三级爽爽爽| 免费不卡在线视频| 久久久久成人黄色影片| 成人91在线观看| 亚洲成人第一页| 精品欧美久久久| 成人短视频下载| 亚洲一区二区美女| 日韩精品在线看片z| 懂色av噜噜一区二区三区av| 亚洲欧美另类图片小说| 69精品人人人人| 成人精品国产一区二区4080| 亚洲麻豆国产自偷在线| 欧美一区二区性放荡片| 国产一区二区精品久久91| 亚洲视频在线观看三级| 欧美日韩国产另类不卡| 国产麻豆视频一区| 一区二区三区不卡视频在线观看| 日韩视频一区二区在线观看| 成人精品在线视频观看| 亚洲午夜私人影院| 国产女主播在线一区二区| 一本色道综合亚洲| 精品一区二区三区久久久| 自拍偷拍亚洲欧美日韩| 精品免费国产二区三区| 99久久国产综合精品色伊| 日韩影视精彩在线| 欧美激情一区二区三区不卡| 欧美一区二区三区视频| 91麻豆免费看片| 国产伦精品一区二区三区免费迷 | 91麻豆精品在线观看| 奇米影视7777精品一区二区| 亚洲欧美色一区| 久久婷婷国产综合国色天香| 欧美日韩国产一级片| 不卡的电影网站| 国产乱对白刺激视频不卡| 婷婷成人综合网| 亚洲一区二区三区在线| 国产精品久久久久毛片软件| 欧美tk—视频vk| 欧美日韩国产另类一区| 色天天综合久久久久综合片| 福利一区二区在线| 国内偷窥港台综合视频在线播放| 天天操天天干天天综合网| 亚洲精品精品亚洲| 国产精品九色蝌蚪自拍| 久久久精品2019中文字幕之3| 欧美久久久久中文字幕| 在线观看日韩电影| 91视频在线看| 成人天堂资源www在线| 毛片不卡一区二区| 美女视频一区在线观看| 免费在线观看成人| 日本成人在线不卡视频| 五月天丁香久久| 天堂av在线一区| 日韩av不卡在线观看| 日韩极品在线观看| 亚洲五月六月丁香激情| 亚洲成人先锋电影| 午夜久久久久久电影| 亚洲午夜在线电影| 亚洲成av人片在www色猫咪| 亚洲电影在线免费观看| 午夜视频在线观看一区二区三区| 亚洲精品免费电影| 亚洲一区免费视频| 亚洲福利一二三区| 日韩二区在线观看| 国模冰冰炮一区二区| 国产麻豆欧美日韩一区| 国产69精品一区二区亚洲孕妇| 成人性生交大片免费看中文| av在线一区二区| 不卡高清视频专区| 精品视频在线免费看| 欧美一区二区三区四区五区| 欧美xxxxx牲另类人与| 久久精品男人的天堂| 亚洲欧洲色图综合| 亚洲18色成人| 国产综合一区二区| 一本一本大道香蕉久在线精品 | 91亚洲精品久久久蜜桃网站 | www久久精品| 日本一区二区三区四区在线视频 | 亚洲人妖av一区二区| 日本在线不卡视频| 日本欧美久久久久免费播放网| 捆绑紧缚一区二区三区视频| 国产成a人无v码亚洲福利| 91麻豆国产福利在线观看| 欧美日本视频在线| 久久精品人人做| 夜夜爽夜夜爽精品视频| 久草精品在线观看| 91成人在线精品| 精品国产制服丝袜高跟| 亚洲欧美偷拍卡通变态| 另类欧美日韩国产在线| jlzzjlzz欧美大全| 欧美一区二区三区思思人 | 欧美一区二区播放| 国产精品久久毛片av大全日韩| 亚洲愉拍自拍另类高清精品| 裸体一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃 | 日韩丝袜情趣美女图片| 最近日韩中文字幕| 国产乱码精品一区二区三| 欧美日韩免费不卡视频一区二区三区| 精品国产电影一区二区| 亚洲一区二区欧美日韩 | 韩国一区二区三区| 欧美在线综合视频| 中文字幕欧美区| 精品亚洲成a人在线观看| 欧美精品久久99久久在免费线| 国产精品黄色在线观看| 精品一区二区免费| 日韩手机在线导航| 偷窥少妇高潮呻吟av久久免费| 成人精品小蝌蚪| 国产欧美综合在线观看第十页| 日韩不卡一区二区三区| 欧美影视一区在线| 一区二区三区欧美在线观看| 国产99久久久久久免费看农村| 日韩视频一区二区| 亚洲一区二区三区四区在线免费观看| 风流少妇一区二区| 国产色产综合色产在线视频| 免费日韩伦理电影| 欧美日韩精品三区| 亚洲妇熟xx妇色黄| 欧美系列日韩一区| 亚洲精品成人悠悠色影视| 成人av在线资源网站| 国产三级欧美三级| 国产麻豆日韩欧美久久| 久久久久久日产精品| 国产麻豆午夜三级精品| 国产欧美日韩三区| 国产精品一区专区| 日本一区二区三区四区|