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 #ifdef BIOSPARAM
  51 int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
  52 #endif
  53 
  54 int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
  55 
  56 #ifndef NULL
  57 #define NULL 0
  58 #endif
  59 
  60 #ifndef CMD_PER_LUN
  61 #define CMD_PER_LUN 2
  62 #endif
  63 
  64 #ifndef CAN_QUEUE
  65 #define CAN_QUEUE 16
  66 #endif
  67 
  68 #if defined(HOSTS_C) || defined(MODULE)
  69 
  70 #define GENERIC_NCR5380 {NULL, NULL, NULL,                              \
  71         generic_NCR5380_proc_info,                                      \
  72         "Generic NCR5380/NCR53C400 Scsi Driver",                        \
  73         generic_NCR5380_detect, generic_NCR5380_release_resources,      \
  74         generic_NCR5380_info, NULL,                                     \
  75         generic_NCR5380_queue_command, generic_NCR5380_abort,           \
  76         generic_NCR5380_reset, NULL,                                    \
  77         NCR5380_BIOSPARAM,                                              \
  78         /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL,                  \
  79         /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
  80 
  81 #endif
  82 
  83 #ifndef HOSTS_C
  84 
  85 #define __STRVAL(x) #x
  86 #define STRVAL(x) __STRVAL(x)
  87 
  88 #ifdef CONFIG_SCSI_G_NCR5380_PORT
  89 
  90 #define NCR5380_map_config port
  91 
  92 #define NCR5380_map_type int
  93 
  94 #define NCR5380_map_name port
  95 
  96 #define NCR5380_instance_name io_port
  97 
  98 #define NCR53C400_register_offset 0
  99 
 100 #define NCR53C400_address_adjust 8
 101 
 102 #ifdef NCR53C400
 103 #define NCR5380_region_size 16
 104 #else
 105 #define NCR5380_region_size 8
 106 #endif
 107 
 108 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
 109 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
 110 
 111 #else 
 112 /* therefore CONFIG_SCSI_G_NCR5380_MEM */
 113 
 114 #define NCR5380_map_config memory
 115 
 116 #define NCR5380_map_type volatile unsigned char*
 117 
 118 #define NCR5380_map_name base
 119 
 120 #define NCR5380_instance_name base
 121 
 122 #define NCR53C400_register_offset 0x108
 123 
 124 #define NCR53C400_address_adjust 0
 125 
 126 #define NCR53C400_mem_base 0x3880
 127 
 128 #define NCR53C400_host_buffer 0x3900
 129 
 130 #define NCR5380_region_size 0x3a00
 131 
 132 
 133 #define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
 134 #define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
 135 
 136 #endif
 137 
 138 #define NCR5380_implementation_fields \
 139     NCR5380_map_type NCR5380_map_name
 140 
 141 #define NCR5380_local_declare() \
 142     register NCR5380_implementation_fields
 143 
 144 #define NCR5380_setup(instance) \
 145     NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
 146 
 147 #define NCR5380_intr generic_NCR5380_intr
 148 #define NCR5380_queue_command generic_NCR5380_queue_command
 149 #define NCR5380_abort generic_NCR5380_abort
 150 #define NCR5380_reset generic_NCR5380_reset
 151 #define NCR5380_pread generic_NCR5380_pread
 152 #define NCR5380_pwrite generic_NCR5380_pwrite
 153 
 154 #define BOARD_NCR5380   0
 155 #define BOARD_NCR53C400 1
 156 
 157 #endif /* else def HOSTS_C */
 158 #endif /* ndef ASM */
 159 #endif /* GENERIC_NCR5380_H */
 160 

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