2 * Generic Generic NCR5380 driver defines
4 * Copyright 1993, Drew Eckhardt
6 * (Unix and Linux consulting and custom programming)
10 * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
11 * K.Lentin@cs.monash.edu.au
15 * For more information, please consult
18 * SCSI Protocol Controller
21 * NCR Microelectronics
22 * 1635 Aeroplaza Drive
23 * Colorado Springs, CO 80916
29 * $Log: generic_NCR5380.h,v $
32 #ifndef GENERIC_NCR5380_H
33 #define GENERIC_NCR5380_H
35 #include <linux/config.h>
37 #define GENERIC_NCR5380_PUBLIC_RELEASE 1
41 #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
43 #define NCR5380_BIOSPARAM NULL
47 int generic_NCR5380_abort(Scsi_Cmnd
*);
48 int generic_NCR5380_detect(Scsi_Host_Template
*);
49 int generic_NCR5380_release_resources(struct Scsi_Host
*);
50 int generic_NCR5380_queue_command(Scsi_Cmnd
*, void (*done
)(Scsi_Cmnd
*));
51 int generic_NCR5380_reset(Scsi_Cmnd
*, unsigned int);
52 int notyet_generic_proc_info (char *buffer
,char **start
, off_t offset
,
53 int length
, int hostno
, int inout
);
54 const char* generic_NCR5380_info(struct Scsi_Host
*);
56 int generic_NCR5380_biosparam(Disk
*, kdev_t
, int *);
59 int generic_NCR5380_proc_info(char* buffer
, char** start
, off_t offset
, int length
, int hostno
, int inout
);
73 #if defined(HOSTS_C) || defined(MODULE)
75 #define GENERIC_NCR5380 { \
76 proc_info: generic_NCR5380_proc_info, \
77 name: "Generic NCR5380/NCR53C400 Scsi Driver", \
78 detect: generic_NCR5380_detect, \
79 release: generic_NCR5380_release_resources, \
80 info: (void *)generic_NCR5380_info, \
81 queuecommand: generic_NCR5380_queue_command, \
82 abort: generic_NCR5380_abort, \
83 reset: generic_NCR5380_reset, \
84 bios_param: NCR5380_BIOSPARAM, \
85 can_queue: CAN_QUEUE, \
87 sg_tablesize: SG_ALL, \
88 cmd_per_lun: CMD_PER_LUN , \
89 use_clustering: DISABLE_CLUSTERING}
95 #define __STRVAL(x) #x
96 #define STRVAL(x) __STRVAL(x)
98 #ifdef CONFIG_SCSI_G_NCR5380_PORT
100 #define NCR5380_map_config port
102 #define NCR5380_map_type int
104 #define NCR5380_map_name port
106 #define NCR5380_instance_name io_port
108 #define NCR53C400_register_offset 0
110 #define NCR53C400_address_adjust 8
113 #define NCR5380_region_size 16
115 #define NCR5380_region_size 8
118 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
119 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
122 /* therefore CONFIG_SCSI_G_NCR5380_MEM */
124 #define NCR5380_map_config memory
126 #define NCR5380_map_type volatile unsigned char*
128 #define NCR5380_map_name base
130 #define NCR5380_instance_name base
132 #define NCR53C400_register_offset 0x108
134 #define NCR53C400_address_adjust 0
136 #define NCR53C400_mem_base 0x3880
138 #define NCR53C400_host_buffer 0x3900
140 #define NCR5380_region_size 0x3a00
143 #define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
144 #define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
148 #define NCR5380_implementation_fields \
149 NCR5380_map_type NCR5380_map_name
151 #define NCR5380_local_declare() \
152 register NCR5380_implementation_fields
154 #define NCR5380_setup(instance) \
155 NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
157 #define NCR5380_intr generic_NCR5380_intr
158 #define do_NCR5380_intr do_generic_NCR5380_intr
159 #define NCR5380_queue_command generic_NCR5380_queue_command
160 #define NCR5380_abort generic_NCR5380_abort
161 #define NCR5380_reset generic_NCR5380_reset
162 #define NCR5380_pread generic_NCR5380_pread
163 #define NCR5380_pwrite generic_NCR5380_pwrite
164 #define NCR5380_proc_info notyet_generic_proc_info
166 #define BOARD_NCR5380 0
167 #define BOARD_NCR53C400 1
168 #define BOARD_NCR53C400A 2
169 #define BOARD_DTC3181E 3
171 #endif /* else def HOSTS_C */
172 #endif /* ndef ASM */
173 #endif /* GENERIC_NCR5380_H */