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 /*
  71  *      When figure is run, we don't want to link to any object code.  Since 
  72  *      the macro for each host will contain function pointers, we cannot 
  73  *      use it and instead must use a "blank" that does no such 
  74  *      idiocy.
  75  */
  76 
  77 Scsi_Host scsi_hosts[] =
  78         {
  79 #ifdef CONFIG_SCSI_AHA1542
  80         AHA1542,
  81 #endif
  82 #ifdef CONFIG_SCSI_AHA1740
  83         AHA1740,
  84 #endif
  85 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
  86         FDOMAIN_16X0,
  87 #endif
  88 #ifdef CONFIG_SCSI_SEAGATE
  89         SEAGATE_ST0X,
  90 #endif
  91 #ifdef CONFIG_SCSI_ULTRASTOR
  92         ULTRASTOR_14F,
  93 #endif
  94 #ifdef CONFIG_SCSI_7000FASST
  95         WD7000,
  96 #endif
  97 #ifdef CONFIG_SCSI_DEBUG
  98         SCSI_DEBUG,
  99 #endif
 100         };
 101 
 102 /*
 103  *      Our semaphores and timeout counters, where size depends on MAX_SCSI_HOSTS here. 
 104  */
 105 
 106 volatile unsigned char host_busy[MAX_SCSI_HOSTS];
 107 volatile int host_timeout[MAX_SCSI_HOSTS];
 108 int last_reset[MAX_SCSI_HOSTS];
 109 Scsi_Cmnd *host_queue[MAX_SCSI_HOSTS]; 
 110 struct wait_queue *host_wait[MAX_SCSI_HOSTS] = {NULL,};   /* For waiting until host available*/
 111 int max_scsi_hosts = MAX_SCSI_HOSTS;  /* This is used by scsi.c */
 112 
 113 void scsi_init(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 114         {
 115         static int called = 0;
 116         int i, count;   
 117         if (!called)
 118                 {
 119                 called = 1;     
 120                 for (count = i = 0; i < MAX_SCSI_HOSTS; ++i)
 121                         {
 122 /*
 123  * Initialize our semaphores.  -1 is interpreted to mean 
 124  * "inactive" - where as 0 will indicate a time out condition.
 125  */ 
 126 
 127                         host_busy[i] = 0;
 128                         host_queue[i] = NULL;   
 129                         
 130                         if ((scsi_hosts[i].detect) &&  (scsi_hosts[i].present = scsi_hosts[i].detect(i)))
 131                                 {               
 132                                 printk ("scsi%d : %s.\n",
 133                                          count, scsi_hosts[i].name);
 134                                 printk ("%s", scsi_hosts[i].info());
 135                                 ++count;
 136                                 }
 137                         }
 138                 printk ("scsi : %d hosts.\n", count);
 139                 }
 140 
 141         }
 142 
 143 #ifndef CONFIG_BLK_DEV_SD
 144 unsigned long sd_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 145   return memory_start;
 146 };
 147 unsigned long sd_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 148   return memory_start;
 149 };
 150 void sd_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 151 };
 152 int NR_SD=-1;
 153 int MAX_SD=0;
 154 #endif
 155 
 156 
 157 #ifndef CONFIG_BLK_DEV_SR
 158 unsigned long sr_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 159   return memory_start;
 160 };
 161 unsigned long sr_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 162   return memory_start;
 163 };
 164 void sr_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 165 };
 166 int NR_SR=-1;
 167 int MAX_SR=0;
 168 #endif
 169 
 170 
 171 #ifndef CONFIG_BLK_DEV_ST
 172 unsigned long st_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 173   return memory_start;
 174 };
 175 unsigned long st_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 176   return memory_start;
 177 };
 178 void st_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 179 };
 180 int NR_ST=-1;
 181 int MAX_ST=0;
 182 #endif
 183 

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