scsi/NCR5380: remove redundant HOSTS_C macro tests
[firefly-linux-kernel-4.4.55.git] / drivers / scsi / g_NCR5380.h
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
36 #define GENERIC_NCR5380_PUBLIC_RELEASE 1
37
38 #ifdef NCR53C400
39 #define BIOSPARAM
40 #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
41 #else
42 #define NCR5380_BIOSPARAM NULL
43 #endif
44
45 #ifndef ASM
46 static int generic_NCR5380_abort(Scsi_Cmnd *);
47 static int generic_NCR5380_detect(struct scsi_host_template *);
48 static int generic_NCR5380_release_resources(struct Scsi_Host *);
49 static int generic_NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
50 static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
51 static const char* generic_NCR5380_info(struct Scsi_Host *);
52
53 #ifndef CMD_PER_LUN
54 #define CMD_PER_LUN 2
55 #endif
56
57 #ifndef CAN_QUEUE
58 #define CAN_QUEUE 16
59 #endif
60
61 #define __STRVAL(x) #x
62 #define STRVAL(x) __STRVAL(x)
63
64 #ifndef SCSI_G_NCR5380_MEM
65
66 #define NCR5380_map_config port
67 #define NCR5380_map_type int
68 #define NCR5380_map_name port
69 #define NCR5380_instance_name io_port
70 #define NCR53C400_register_offset 0
71 #define NCR53C400_address_adjust 8
72
73 #ifdef NCR53C400
74 #define NCR5380_region_size 16
75 #else
76 #define NCR5380_region_size 8
77 #endif
78
79 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
80 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
81
82 #define NCR5380_implementation_fields \
83     NCR5380_map_type NCR5380_map_name
84
85 #define NCR5380_local_declare() \
86     register NCR5380_implementation_fields
87
88 #define NCR5380_setup(instance) \
89     NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
90
91 #else 
92 /* therefore SCSI_G_NCR5380_MEM */
93
94 #define NCR5380_map_config memory
95 #define NCR5380_map_type unsigned long
96 #define NCR5380_map_name base
97 #define NCR5380_instance_name base
98 #define NCR53C400_register_offset 0x108
99 #define NCR53C400_address_adjust 0
100 #define NCR53C400_mem_base 0x3880
101 #define NCR53C400_host_buffer 0x3900
102 #define NCR5380_region_size 0x3a00
103
104 #define NCR5380_read(reg) readb(iomem + NCR53C400_mem_base + (reg))
105 #define NCR5380_write(reg, value) writeb(value, iomem + NCR53C400_mem_base + (reg))
106
107 #define NCR5380_implementation_fields \
108     NCR5380_map_type NCR5380_map_name; \
109     void __iomem *iomem;
110
111 #define NCR5380_local_declare() \
112     register void __iomem *iomem
113
114 #define NCR5380_setup(instance) \
115     iomem = (((struct NCR5380_hostdata *)(instance)->hostdata)->iomem)
116
117 #endif
118
119 #define NCR5380_intr generic_NCR5380_intr
120 #define NCR5380_queue_command generic_NCR5380_queue_command
121 #define NCR5380_abort generic_NCR5380_abort
122 #define NCR5380_bus_reset generic_NCR5380_bus_reset
123 #define NCR5380_pread generic_NCR5380_pread
124 #define NCR5380_pwrite generic_NCR5380_pwrite
125 #define NCR5380_proc_info notyet_generic_proc_info
126
127 #define BOARD_NCR5380   0
128 #define BOARD_NCR53C400 1
129 #define BOARD_NCR53C400A 2
130 #define BOARD_DTC3181E  3
131
132 #endif /* ndef ASM */
133 #endif /* GENERIC_NCR5380_H */
134