ncr5380: Remove more pointless macros
[deliverable/linux.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
14 #ifndef GENERIC_NCR5380_H
15 #define GENERIC_NCR5380_H
16
17 #ifdef NCR53C400
18 #define BIOSPARAM
19 #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
20 #else
21 #define NCR5380_BIOSPARAM NULL
22 #endif
23
24 #ifndef CMD_PER_LUN
25 #define CMD_PER_LUN 2
26 #endif
27
28 #ifndef CAN_QUEUE
29 #define CAN_QUEUE 16
30 #endif
31
32 #define __STRVAL(x) #x
33 #define STRVAL(x) __STRVAL(x)
34
35 #ifndef SCSI_G_NCR5380_MEM
36
37 #define NCR5380_map_type int
38 #define NCR5380_map_name port
39 #define NCR5380_instance_name io_port
40 #define NCR53C400_register_offset 0
41 #define NCR53C400_address_adjust 8
42
43 #ifdef NCR53C400
44 #define NCR5380_region_size 16
45 #else
46 #define NCR5380_region_size 8
47 #endif
48
49 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
50 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
51
52 #define NCR5380_implementation_fields \
53 NCR5380_map_type NCR5380_map_name
54
55 #define NCR5380_local_declare() \
56 register NCR5380_implementation_fields
57
58 #define NCR5380_setup(instance) \
59 NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
60
61 #else
62 /* therefore SCSI_G_NCR5380_MEM */
63
64 #define NCR5380_map_type unsigned long
65 #define NCR5380_map_name base
66 #define NCR5380_instance_name base
67 #define NCR53C400_register_offset 0x108
68 #define NCR53C400_address_adjust 0
69 #define NCR53C400_mem_base 0x3880
70 #define NCR53C400_host_buffer 0x3900
71 #define NCR5380_region_size 0x3a00
72
73 #define NCR5380_read(reg) readb(iomem + NCR53C400_mem_base + (reg))
74 #define NCR5380_write(reg, value) writeb(value, iomem + NCR53C400_mem_base + (reg))
75
76 #define NCR5380_implementation_fields \
77 NCR5380_map_type NCR5380_map_name; \
78 void __iomem *iomem;
79
80 #define NCR5380_local_declare() \
81 register void __iomem *iomem
82
83 #define NCR5380_setup(instance) \
84 iomem = (((struct NCR5380_hostdata *)(instance)->hostdata)->iomem)
85
86 #endif
87
88 #define NCR5380_intr generic_NCR5380_intr
89 #define NCR5380_queue_command generic_NCR5380_queue_command
90 #define NCR5380_abort generic_NCR5380_abort
91 #define NCR5380_bus_reset generic_NCR5380_bus_reset
92 #define NCR5380_pread generic_NCR5380_pread
93 #define NCR5380_pwrite generic_NCR5380_pwrite
94 #define NCR5380_info generic_NCR5380_info
95 #define NCR5380_show_info generic_NCR5380_show_info
96
97 #define BOARD_NCR5380 0
98 #define BOARD_NCR53C400 1
99 #define BOARD_NCR53C400A 2
100 #define BOARD_DTC3181E 3
101
102 #endif /* GENERIC_NCR5380_H */
103
This page took 0.108068 seconds and 6 git commands to generate.