root/kernel/blk_drv/scsi/seagate.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  *      seagate.h Copyright (C) 1992 Drew Eckhardt 
   3  *      low level scsi driver header for ST01/ST02 by
   4  *              Drew Eckhardt 
   5  *
   6  *      <drew@colorado.edu>
   7  */
   8 
   9 #ifndef _SEAGATE_H
  10         #define SEAGATE_H
  11 /*
  12         $Header
  13 */
  14 #ifndef ASM
  15 int seagate_st0x_biosparam(int, int, int*);
  16 int seagate_st0x_detect(int);
  17 int seagate_st0x_command(Scsi_Cmnd *);
  18 int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
  19 
  20 int seagate_st0x_abort(Scsi_Cmnd *, int);
  21 const char *seagate_st0x_info(void);
  22 int seagate_st0x_reset(void); 
  23 
  24 #ifndef NULL
  25         #define NULL 0
  26 #endif
  27 
  28 #ifdef CONFIG_BLK_DEV_SD
  29 #define SEAGATE_ST0X  {"Seagate ST-01/ST-02", seagate_st0x_detect,      \
  30                          seagate_st0x_info, seagate_st0x_command,       \
  31                          seagate_st0x_queue_command, seagate_st0x_abort, \
  32                          seagate_st0x_reset, NULL, seagate_st0x_biosparam, \
  33                          1, 7, SG_ALL, 1, 0, 0}
  34 #else
  35 #define SEAGATE_ST0X  {"Seagate ST-01/ST-02", seagate_st0x_detect,      \
  36                          seagate_st0x_info, seagate_st0x_command,       \
  37                          seagate_st0x_queue_command, seagate_st0x_abort, \
  38                          seagate_st0x_reset, NULL, NULL, \
  39                          1, 7, SG_ALL, 1, 0, 0}
  40 #endif /* CONFIG_BLK_DEV_SD */
  41 #endif
  42 
  43 
  44 /*
  45         defining PARITY causes parity data to be checked
  46 */
  47 
  48 #define PARITY
  49 
  50 /*
  51         defining ARBITRATE causes the arbitration sequence to be used.  And speed to drop by a 
  52         factor of ten.
  53 */
  54 
  55 #undef ARBITRATE
  56 
  57 
  58 /*
  59         Thanks to Brian Antoine for the example code in his Messy-Loss ST-01
  60                 driver, and Mitsugu Suzuki for information on the ST-01
  61                 SCSI host.
  62 */
  63 
  64 /*
  65         CONTROL defines
  66 */
  67 
  68 #define CMD_RST                 0x01
  69 #define CMD_SEL                 0x02
  70 #define CMD_BSY                 0x04
  71 #define CMD_ATTN                0x08
  72 #define CMD_START_ARB           0x10
  73 #define CMD_EN_PARITY           0x20
  74 #define CMD_INTR                0x40
  75 #define CMD_DRVR_ENABLE         0x80
  76 
  77 /*
  78         STATUS
  79 */
  80 
  81 #define STAT_BSY                0x01
  82 #define STAT_MSG                0x02
  83 #define STAT_IO                 0x04
  84 #define STAT_CD                 0x08
  85 #define STAT_REQ                0x10
  86 #define STAT_SEL                0x20
  87 #define STAT_PARITY             0x40
  88 #define STAT_ARB_CMPL           0x80
  89 
  90 /* 
  91         REQUESTS
  92 */
  93 
  94 #define REQ_MASK (STAT_CD |  STAT_IO | STAT_MSG)
  95 #define REQ_DATAOUT 0
  96 #define REQ_DATAIN STAT_IO
  97 #define REQ_CMDOUT STAT_CD
  98 #define REQ_STATIN (STAT_CD | STAT_IO)
  99 #define REQ_MSGOUT (STAT_MSG | STAT_CD)
 100 #define REQ_MSGIN (STAT_MSG | STAT_CD | STAT_IO)
 101 
 102 extern volatile int seagate_st0x_timeout;
 103 
 104 #ifdef PARITY
 105         #define BASE_CMD CMD_EN_PARITY
 106 #else
 107         #define BASE_CMD  0
 108 #endif
 109 
 110 /*
 111         Debugging code
 112 */
 113 
 114 #define PHASE_BUS_FREE 1
 115 #define PHASE_ARBITRATION 2
 116 #define PHASE_SELECTION 4
 117 #define PHASE_DATAIN 8 
 118 #define PHASE_DATAOUT 0x10
 119 #define PHASE_CMDOUT 0x20
 120 #define PHASE_MSGIN 0x40
 121 #define PHASE_MSGOUT 0x80
 122 #define PHASE_STATUSIN 0x100
 123 #define PHASE_ETC (PHASE_DATAIN | PHASE_DATA_OUT | PHASE_CMDOUT | PHASE_MSGIN | PHASE_MSGOUT | PHASE_STATUSIN)
 124 #define PRINT_COMMAND 0x200
 125 #define PHASE_EXIT 0x400
 126 #define PHASE_RESELECT 0x800
 127 #define DEBUG_FAST 0x1000
 128 #define DEBUG_SG   0x2000
 129 #define DEBUG_LINKED    0x4000
 130 
 131 /* 
 132  *      Control options - these are timeouts specified in .01 seconds.
 133  */
 134 
 135 #define ST0X_BUS_FREE_DELAY 25
 136 #define ST0X_SELECTION_DELAY 15
 137 
 138 #define eoi() __asm__("push %%eax\nmovb $0x20, %%al\noutb %%al, $0x20\npop %%eax"::)
 139         
 140 #define SEAGATE 1       /* these determine the type of the controller */
 141 #define FD      2
 142 
 143 
 144 #endif
 145 

/* [previous][next][first][last][top][bottom][index][help] */