root/kernel/blk_drv/scsi/hosts.c

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

DEFINITIONS

This source file includes following definitions.
  1. scsi_init
  2. sd_init
  3. sd_init1
  4. sd_attach
  5. sr_init
  6. sr_init1
  7. sr_attach
  8. st_init
  9. st_init1
  10. st_attach

   1 /*
   2  *      hosts.c Copyright (C) 1992 Drew Eckhardt 
   3  *      mid to lowlevel SCSI driver interface by
   4  *              Drew Eckhardt 
   5  *
   6  *      <drew@colorado.edu>
   7  */
   8 
   9 
  10 /*
  11  *      This file contains the medium level SCSI
  12  *      host interface initialization, as well as the scsi_hosts array of SCSI
  13  *      hosts currently present in the system. 
  14  */
  15 
  16 #include <linux/config.h>
  17 #include "../blk.h"
  18 #include <linux/kernel.h>
  19 #include "scsi.h"
  20 
  21 #ifndef NULL 
  22 #define NULL 0L
  23 #endif
  24 
  25 #include "hosts.h"
  26 
  27 #ifdef CONFIG_SCSI_AHA1542
  28 #include "aha1542.h"
  29 #endif
  30 
  31 #ifdef CONFIG_SCSI_AHA1740
  32 #include "aha1740.h"
  33 #endif
  34 
  35 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
  36 #include "fdomain.h"
  37 #endif
  38 
  39 #ifdef CONFIG_SCSI_SEAGATE
  40 #include "seagate.h"
  41 #endif
  42 
  43 #ifdef CONFIG_SCSI_ULTRASTOR
  44 #include "ultrastor.h"
  45 #endif
  46 
  47 #ifdef CONFIG_SCSI_7000FASST
  48 #include "wd7000.h"
  49 #endif
  50 
  51 #ifdef CONFIG_SCSI_DEBUG
  52 #include "scsi_debug.h"
  53 #endif
  54 
  55 /*
  56 static const char RCSid[] = "$Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/hosts.c,v 1.1 1992/07/24 06:27:38 root Exp root $";
  57 */
  58 
  59 /*
  60  *      The scsi host entries should be in the order you wish the 
  61  *      cards to be detected.  A driver may appear more than once IFF
  62  *      it can deal with being detected (and therefore initialized) 
  63  *      with more than one simulatenous host number, can handle being
  64  *      rentrant, etc.
  65  *
  66  *      They may appear in any order, as each SCSI host  is told which host number it is
  67  *      during detection.
  68  */
  69 
  70 /* This is a placeholder for controllers that are not configured into
  71    the system - we do this to ensure that the controller numbering is
  72    always consistent, no matter how the kernel is configured. */
  73 
  74 #define NO_CONTROLLER {NULL, NULL, NULL, NULL, NULL, NULL, NULL, \
  75                 NULL, NULL, 0, 0, 0, 0, 0, 0}
  76 
  77 /*
  78  *      When figure is run, we don't want to link to any object code.  Since 
  79  *      the macro for each host will contain function pointers, we cannot 
  80  *      use it and instead must use a "blank" that does no such 
  81  *      idiocy.
  82  */
  83 
  84 Scsi_Host scsi_hosts[] =
  85         {
  86 #ifdef CONFIG_SCSI_AHA1542
  87         AHA1542,
  88 #endif
  89 #ifdef CONFIG_SCSI_AHA1740
  90         AHA1740,
  91 #endif
  92 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
  93         FDOMAIN_16X0,
  94 #endif
  95 #ifdef CONFIG_SCSI_SEAGATE
  96         SEAGATE_ST0X,
  97 #endif
  98 #ifdef CONFIG_SCSI_ULTRASTOR
  99         ULTRASTOR_14F,
 100 #endif
 101 #ifdef CONFIG_SCSI_7000FASST
 102         WD7000,
 103 #endif
 104 #ifdef CONFIG_SCSI_DEBUG
 105         SCSI_DEBUG,
 106 #endif
 107         };
 108 
 109 /*
 110  *      Our semaphores and timeout counters, where size depends on MAX_SCSI_HOSTS here. 
 111  */
 112 
 113 volatile unsigned char host_busy[MAX_SCSI_HOSTS];
 114 volatile int host_timeout[MAX_SCSI_HOSTS];
 115 int last_reset[MAX_SCSI_HOSTS];
 116 Scsi_Cmnd *host_queue[MAX_SCSI_HOSTS]; 
 117 struct wait_queue *host_wait[MAX_SCSI_HOSTS] = {NULL,};   /* For waiting until host available*/
 118 int max_scsi_hosts = MAX_SCSI_HOSTS;  /* This is used by scsi.c */
 119 
 120 void scsi_init(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 121         {
 122         static int called = 0;
 123         int i, count;   
 124         if (!called)
 125                 {
 126                 called = 1;     
 127                 for (count = i = 0; i < MAX_SCSI_HOSTS; ++i)
 128                         {
 129 /*
 130  * Initialize our semaphores.  -1 is interpreted to mean 
 131  * "inactive" - where as 0 will indicate a time out condition.
 132  */ 
 133 
 134                         host_busy[i] = 0;
 135                         host_queue[i] = NULL;   
 136                         
 137                         if ((scsi_hosts[i].detect) &&  (scsi_hosts[i].present = scsi_hosts[i].detect(i)))
 138                                 {               
 139                                 printk ("scsi%d : %s.\n",
 140                                          count, scsi_hosts[i].name);
 141                                 printk ("%s", scsi_hosts[i].info());
 142                                 ++count;
 143                                 }
 144                         }
 145                 printk ("scsi : %d hosts.\n", count);
 146                 }
 147 
 148         }
 149 
 150 #ifndef CONFIG_BLK_DEV_SD
 151 unsigned long sd_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 152   return memory_start;
 153 };
 154 unsigned long sd_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 155   return memory_start;
 156 };
 157 void sd_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 158 };
 159 int NR_SD=-1;
 160 int MAX_SD=0;
 161 #endif
 162 
 163 
 164 #ifndef CONFIG_BLK_DEV_SR
 165 unsigned long sr_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 166   return memory_start;
 167 };
 168 unsigned long sr_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 169   return memory_start;
 170 };
 171 void sr_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 172 };
 173 int NR_SR=-1;
 174 int MAX_SR=0;
 175 #endif
 176 
 177 
 178 #ifndef CONFIG_BLK_DEV_ST
 179 unsigned long st_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 180   return memory_start;
 181 };
 182 unsigned long st_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 183   return memory_start;
 184 };
 185 void st_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 186 };
 187 int NR_ST=-1;
 188 int MAX_ST=0;
 189 #endif
 190 

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