root/kernel/blk_drv/scsi/hosts.c

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

DEFINITIONS

This source file includes following definitions.
  1. main
  2. scsi_init
  3. main
  4. sd_init
  5. sd_init1
  6. sd_attach
  7. sr_init
  8. sr_init1
  9. sr_attach
  10. st_init
  11. st_init1
  12. 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 
  18 #ifdef CONFIG_SCSI
  19 #include "../blk.h"
  20 #include <linux/kernel.h>
  21 #include "scsi.h"
  22 
  23 #ifndef NULL 
  24         #define NULL 0L
  25 #endif
  26 
  27 #ifdef FIGURE_MAX_SCSI_HOSTS
  28         #define MAX_SCSI_HOSTS
  29 #endif
  30 
  31 #ifndef MAX_SCSI_HOSTS
  32         #include "max_hosts.h"
  33 #endif
  34 
  35 #include "hosts.h"
  36 
  37 #ifdef CONFIG_SCSI_AHA1542
  38 #include "aha1542.h"
  39 #endif
  40 
  41 #ifdef CONFIG_SCSI_AHA1740
  42 #include "aha1740.h"
  43 #endif
  44 
  45 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
  46 #include "fdomain.h"
  47 #endif
  48 
  49 #ifdef CONFIG_SCSI_SEAGATE
  50 #include "seagate.h"
  51 #endif
  52 
  53 #ifdef CONFIG_SCSI_ULTRASTOR
  54 #include "ultrastor.h"
  55 #endif
  56 
  57 #ifdef CONFIG_SCSI_7000FASST
  58 #include "wd7000.h"
  59 #endif
  60 
  61 #ifdef CONFIG_SCSI_DEBUG
  62 #include "scsi_debug.h"
  63 #endif
  64 
  65 /*
  66 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 $";
  67 */
  68 
  69 /*
  70  *      The scsi host entries should be in the order you wish the 
  71  *      cards to be detected.  A driver may appear more than once IFF
  72  *      it can deal with being detected (and therefore initialized) 
  73  *      with more than one simulatenous host number, can handle being
  74  *      rentrant, etc.
  75  *
  76  *      They may appear in any order, as each SCSI host  is told which host number it is
  77  *      during detection.
  78  */
  79 
  80 /*
  81  *      When figure is run, we don't want to link to any object code.  Since 
  82  *      the macro for each host will contain function pointers, we cannot 
  83  *      use it and instead must use a "blank" that does no such 
  84  *      idiocy.
  85  */
  86 
  87 #ifdef FIGURE_MAX_SCSI_HOSTS
  88         #define BLANKIFY(what) BLANK_HOST
  89 #else
  90         #define BLANKIFY(what) what
  91 #endif
  92 
  93 Scsi_Host scsi_hosts[] =
  94         {
  95 #ifdef CONFIG_SCSI_AHA1542
  96         BLANKIFY(AHA1542),
  97 #endif
  98 
  99 #ifdef CONFIG_SCSI_AHA1740
 100         BLANKIFY(AHA1740),
 101 #endif
 102 
 103 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
 104         BLANKIFY(FDOMAIN_16X0),
 105 #endif
 106 
 107 #ifdef CONFIG_SCSI_SEAGATE
 108         BLANKIFY(SEAGATE_ST0X),
 109 #endif
 110 #ifdef CONFIG_SCSI_ULTRASTOR
 111         BLANKIFY(ULTRASTOR_14F),
 112 #endif
 113 #ifdef CONFIG_SCSI_7000FASST
 114         BLANKIFY(WD7000),
 115 #endif
 116 #ifdef CONFIG_SCSI_DEBUG
 117         BLANKIFY(SCSI_DEBUG),
 118 #endif
 119         };
 120 
 121 #ifdef FIGURE_MAX_SCSI_HOSTS
 122         #undef MAX_SCSI_HOSTS
 123         #define  MAX_SCSI_HOSTS  (sizeof(scsi_hosts) / sizeof(Scsi_Host))
 124 #endif
 125 
 126 #ifdef FIGURE_MAX_SCSI_HOSTS
 127 #include <stdio.h>
 128 void main (void)
     /* [previous][next][first][last][top][bottom][index][help] */
 129 {       
 130         printf("%d", MAX_SCSI_HOSTS);
 131 }
 132 #else
 133 /*
 134  *      Our semaphores and timeout counters, where size depends on MAX_SCSI_HOSTS here. 
 135  */
 136 
 137 volatile unsigned char host_busy[MAX_SCSI_HOSTS];
 138 volatile int host_timeout[MAX_SCSI_HOSTS];
 139 int last_reset[MAX_SCSI_HOSTS];
 140 Scsi_Cmnd *host_queue[MAX_SCSI_HOSTS]; 
 141 struct wait_queue *host_wait[MAX_SCSI_HOSTS] = {NULL,};   /* For waiting until host available*/
 142 int max_scsi_hosts = MAX_SCSI_HOSTS;  /* This is used by scsi.c */
 143 
 144 void scsi_init(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 145         {
 146         static int called = 0;
 147         int i, count;   
 148         if (!called)
 149                 {
 150                 called = 1;     
 151                 for (count = i = 0; i < MAX_SCSI_HOSTS; ++i)
 152                         {
 153 /*
 154  * Initialize our semaphores.  -1 is interpreted to mean 
 155  * "inactive" - where as 0 will indicate a time out condition.
 156  */ 
 157 
 158                         host_busy[i] = 0;
 159                         host_queue[i] = NULL;   
 160                         
 161                         if ((scsi_hosts[i].detect) &&  (scsi_hosts[i].present = scsi_hosts[i].detect(i)))
 162                                 {               
 163                                 printk ("scsi%d : %s.\n\r",
 164                                          count, scsi_hosts[i].name);
 165                                 printk ("%s", scsi_hosts[i].info());
 166                                 ++count;
 167                                 }
 168                         }
 169                 printk ("scsi : %d hosts. \n\r", count);
 170                 }
 171 
 172         }
 173 
 174 #endif
 175 #else
 176 void main(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
 177         printf("0\n");
 178         }
 179 #endif  
 180 
 181 
 182 #ifndef CONFIG_BLK_DEV_SD
 183 unsigned long sd_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 184   return memory_start;
 185 };
 186 unsigned long sd_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 187   return memory_start;
 188 };
 189 void sd_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 190 };
 191 int NR_SD=-1;
 192 int MAX_SD=0;
 193 #endif
 194 
 195 
 196 #ifndef CONFIG_BLK_DEV_SR
 197 unsigned long sr_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 198   return memory_start;
 199 };
 200 unsigned long sr_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 201   return memory_start;
 202 };
 203 void sr_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 204 };
 205 int NR_SR=-1;
 206 int MAX_SR=0;
 207 #endif
 208 
 209 
 210 #ifndef CONFIG_BLK_DEV_ST
 211 unsigned long st_init(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 212   return memory_start;
 213 };
 214 unsigned long st_init1(unsigned long memory_start, unsigned long memory_end){
     /* [previous][next][first][last][top][bottom][index][help] */
 215   return memory_start;
 216 };
 217 void st_attach(Scsi_Device * SDp){
     /* [previous][next][first][last][top][bottom][index][help] */
 218 };
 219 int NR_ST=-1;
 220 int MAX_ST=0;
 221 #endif
 222 

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