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

   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 <linux/kernel.h>
  20 #include "scsi.h"
  21 
  22 #ifndef NULL 
  23         #define NULL 0L
  24 #endif
  25 
  26 #ifdef FIGURE_MAX_SCSI_HOSTS
  27         #define MAX_SCSI_HOSTS
  28 #endif
  29 
  30 #include "hosts.h"
  31 
  32 #ifdef CONFIG_SCSI_AHA1542
  33 #include "aha1542.h"
  34 #endif
  35 
  36 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
  37 #include "fdomain.h"
  38 #endif
  39 
  40 #ifdef CONFIG_SCSI_SEAGATE
  41 #include "seagate.h"
  42 #endif
  43 
  44 #ifdef CONFIG_SCSI_ULTRASTOR
  45 #include "ultrastor.h"
  46 #endif
  47 
  48 #ifdef CONFIG_SCSI_7000FASST
  49 #include "7000fasst.h"
  50 #endif
  51 
  52 /*
  53 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 $";
  54 */
  55 
  56 /*
  57  *      The scsi host entries should be in the order you wish the 
  58  *      cards to be detected.  A driver may appear more than once IFF
  59  *      it can deal with being detected (and therefore initialized) 
  60  *      with more than one simulatenous host number, can handle being
  61  *      rentrant, etc.
  62  *
  63  *      They may appear in any order, as each SCSI host  is told which host number it is
  64  *      during detection.
  65  */
  66 
  67 /*
  68  *      When figure is run, we don't want to link to any object code.  Since 
  69  *      the macro for each host will contain function pointers, we cannot 
  70  *      use it and instead must use a "blank" that does no such 
  71  *      idiocy.
  72  */
  73 
  74 #ifdef FIGURE_MAX_SCSI_HOSTS
  75         #define BLANKIFY(what) BLANK_HOST
  76 #else
  77         #define BLANKIFY(what) what
  78 #endif
  79 
  80 Scsi_Host scsi_hosts[] =
  81         {
  82 #ifdef CONFIG_SCSI_AHA1542
  83         BLANKIFY(AHA1542),
  84 #endif
  85 
  86 #ifdef CONFIG_SCSI_FUTURE_DOMAIN
  87         BLANKIFY(FDOMAIN_16X0),
  88 #endif
  89 
  90 #ifdef CONFIG_SCSI_SEAGATE
  91         BLANKIFY(SEAGATE_ST0X),
  92 #endif
  93 #ifdef CONFIG_SCSI_ULTRASTOR
  94         BLANKIFY(ULTRASTOR_14F),
  95 #endif
  96 #ifdef CONFIG_SCSI_7000FASST
  97         BLANKIFY(WD7000FASST),
  98 #endif
  99         };
 100 
 101 #ifdef FIGURE_MAX_SCSI_HOSTS
 102         #undef MAX_SCSI_HOSTS
 103         #define  MAX_SCSI_HOSTS  (sizeof(scsi_hosts) / sizeof(Scsi_Host))
 104 #endif
 105 
 106 #ifdef FIGURE_MAX_SCSI_HOSTS
 107 #include <stdio.h>
 108 void main (void)
     /* [previous][next][first][last][top][bottom][index][help] */
 109 {       
 110         printf("%d", MAX_SCSI_HOSTS);
 111 }
 112 #else
 113 /*
 114  *      Our semaphores and timeout counters, where size depends on MAX_SCSI_HOSTS here. 
 115  */
 116 
 117 volatile unsigned char host_busy[MAX_SCSI_HOSTS];
 118 volatile int host_timeout[MAX_SCSI_HOSTS];
 119 volatile Scsi_Cmnd *host_queue[MAX_SCSI_HOSTS]; 
 120 
 121 void scsi_init(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 122         {
 123         static int called = 0;
 124         int i, count;   
 125         if (!called)
 126                 {
 127                 called = 1;     
 128                 for (count = i = 0; i < MAX_SCSI_HOSTS; ++i)
 129                         {
 130 /*
 131  * Initialize our semaphores.  -1 is interpreted to mean 
 132  * "inactive" - where as 0 will indicate a time out condition.
 133  */ 
 134 
 135                         host_busy[i] = 0;
 136                         host_timeout[i] = 0;
 137                         host_queue[i] = NULL;   
 138                         
 139                         if ((scsi_hosts[i].detect) &&  (scsi_hosts[i].present = scsi_hosts[i].detect(i)))
 140                                 {               
 141                                 printk ("scsi%d : %s.\n\r",
 142                                          count, scsi_hosts[i].name);
 143                                 printk ("%s", scsi_hosts[i].info());
 144                                 ++count;
 145                                 }
 146                         }
 147                 printk ("scsi : %d hosts. \n\r", count);
 148                 }
 149 
 150         }
 151 
 152 #endif
 153 #else
 154 void main(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
 155         printf("0\n");
 156         }
 157 #endif  

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