ncr5380: Move NCR53C400-specific code
[cascardo/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 CONFIG_SCSI_GENERIC_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 NCR53C400_register_offset 0
40
41 #ifdef CONFIG_SCSI_GENERIC_NCR53C400
42 #define NCR5380_region_size 16
43 #else
44 #define NCR5380_region_size 8
45 #endif
46
47 #define NCR5380_read(reg) \
48         inb(instance->io_port + (reg))
49 #define NCR5380_write(reg, value) \
50         outb(value, instance->io_port + (reg))
51
52 #define NCR5380_implementation_fields /* none */
53
54 #else 
55 /* therefore SCSI_G_NCR5380_MEM */
56
57 #define NCR5380_map_type unsigned long
58 #define NCR5380_map_name base
59 #define NCR53C400_register_offset 0x108
60 #define NCR53C400_mem_base 0x3880
61 #define NCR53C400_host_buffer 0x3900
62 #define NCR5380_region_size 0x3a00
63
64 #define NCR5380_read(reg) \
65         readb(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
66               NCR53C400_mem_base + (reg))
67 #define NCR5380_write(reg, value) \
68         writeb(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
69                NCR53C400_mem_base + (reg))
70
71 #define NCR5380_implementation_fields \
72     void __iomem *iomem;
73
74 #endif
75
76 #define NCR5380_intr generic_NCR5380_intr
77 #define NCR5380_queue_command generic_NCR5380_queue_command
78 #define NCR5380_abort generic_NCR5380_abort
79 #define NCR5380_bus_reset generic_NCR5380_bus_reset
80 #define NCR5380_pread generic_NCR5380_pread
81 #define NCR5380_pwrite generic_NCR5380_pwrite
82 #define NCR5380_info generic_NCR5380_info
83 #define NCR5380_show_info generic_NCR5380_show_info
84
85 #define BOARD_NCR5380   0
86 #define BOARD_NCR53C400 1
87 #define BOARD_NCR53C400A 2
88 #define BOARD_DTC3181E  3
89
90 #endif /* GENERIC_NCR5380_H */
91