root/drivers/scsi/g_NCR5380.h

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

INCLUDED FROM


   1 /*
   2  * Generic Generic NCR5380 driver defines
   3  *
   4  * Copyright 1993, Drew Eckhardt
   5  *      Visionary Computing
   6  *      (Unix and Linux consulting and custom programming)
   7  *      drew@colorado.edu
   8  *      +1 (303) 440-4894
   9  *
  10  * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
  11  *    K.Lentin@cs.monash.edu.au
  12  *
  13  * ALPHA RELEASE 1. 
  14  *
  15  * For more information, please consult 
  16  *
  17  * NCR 5380 Family
  18  * SCSI Protocol Controller
  19  * Databook
  20  *
  21  * NCR Microelectronics
  22  * 1635 Aeroplaza Drive
  23  * Colorado Springs, CO 80916
  24  * 1+ (719) 578-3400
  25  * 1+ (800) 334-5454
  26  */
  27 
  28 /*
  29  * $Log: generic_NCR5380.h,v $
  30  */
  31 
  32 #ifndef GENERIC_NCR5380_H
  33 #define GENERIC_NCR5380_H
  34 
  35 #define GENERIC_NCR5380_PUBLIC_RELEASE 1
  36 
  37 #ifdef NCR53C400
  38 #define BIOSPARAM
  39 #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
  40 #else
  41 #define NCR5380_BIOSPARAM NULL
  42 #endif
  43 
  44 #ifndef ASM
  45 int generic_NCR5380_abort(Scsi_Cmnd *);
  46 int generic_NCR5380_detect(Scsi_Host_Template *);
  47 int generic_NCR5380_release_resources(struct Scsi_Host *);
  48 int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
  49 int generic_NCR5380_reset(Scsi_Cmnd *);
  50 int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
  51                      int length, int hostno, int inout);
  52 const char* generic_NCR5380_info(struct Scsi_Host *);
  53 #ifdef BIOSPARAM
  54 int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
  55 #endif
  56 
  57 int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
  58 
  59 #ifndef NULL
  60 #define NULL 0
  61 #endif
  62 
  63 #ifndef CMD_PER_LUN
  64 #define CMD_PER_LUN 2
  65 #endif
  66 
  67 #ifndef CAN_QUEUE
  68 #define CAN_QUEUE 16
  69 #endif
  70 
  71 #if defined(HOSTS_C) || defined(MODULE)
  72 
  73 #define GENERIC_NCR5380 {NULL, NULL, NULL,                              \
  74         generic_NCR5380_proc_info,                                      \
  75         "Generic NCR5380/NCR53C400 Scsi Driver",                        \
  76         generic_NCR5380_detect, generic_NCR5380_release_resources,      \
  77         (void *)generic_NCR5380_info, NULL,                             \
  78         generic_NCR5380_queue_command, generic_NCR5380_abort,           \
  79         generic_NCR5380_reset, NULL,                                    \
  80         NCR5380_BIOSPARAM,                                              \
  81         /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL,                  \
  82         /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
  83 
  84 #endif
  85 
  86 #ifndef HOSTS_C
  87 
  88 #define __STRVAL(x) #x
  89 #define STRVAL(x) __STRVAL(x)
  90 
  91 #ifdef CONFIG_SCSI_G_NCR5380_PORT
  92 
  93 #define NCR5380_map_config port
  94 
  95 #define NCR5380_map_type int
  96 
  97 #define NCR5380_map_name port
  98 
  99 #define NCR5380_instance_name io_port
 100 
 101 #define NCR53C400_register_offset 0
 102 
 103 #define NCR53C400_address_adjust 8
 104 
 105 #ifdef NCR53C400
 106 #define NCR5380_region_size 16
 107 #else
 108 #define NCR5380_region_size 8
 109 #endif
 110 
 111 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
 112 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
 113 
 114 #else 
 115 /* therefore CONFIG_SCSI_G_NCR5380_MEM */
 116 
 117 #define NCR5380_map_config memory
 118 
 119 #define NCR5380_map_type volatile unsigned char*
 120 
 121 #define NCR5380_map_name base
 122 
 123 #define NCR5380_instance_name base
 124 
 125 #define NCR53C400_register_offset 0x108
 126 
 127 #define NCR53C400_address_adjust 0
 128 
 129 #define NCR53C400_mem_base 0x3880
 130 
 131 #define NCR53C400_host_buffer 0x3900
 132 
 133 #define NCR5380_region_size 0x3a00
 134 
 135 
 136 #define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
 137 #define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
 138 
 139 #endif
 140 
 141 #define NCR5380_implementation_fields \
 142     NCR5380_map_type NCR5380_map_name
 143 
 144 #define NCR5380_local_declare() \
 145     register NCR5380_implementation_fields
 146 
 147 #define NCR5380_setup(instance) \
 148     NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
 149 
 150 #define NCR5380_intr generic_NCR5380_intr
 151 #define NCR5380_queue_command generic_NCR5380_queue_command
 152 #define NCR5380_abort generic_NCR5380_abort
 153 #define NCR5380_reset generic_NCR5380_reset
 154 #define NCR5380_pread generic_NCR5380_pread
 155 #define NCR5380_pwrite generic_NCR5380_pwrite
 156 #define NCR5380_proc_info notyet_generic_proc_info
 157 
 158 #define BOARD_NCR5380   0
 159 #define BOARD_NCR53C400 1
 160 
 161 #endif /* else def HOSTS_C */
 162 #endif /* ndef ASM */
 163 #endif /* GENERIC_NCR5380_H */
 164 

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