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
46 int generic_NCR5380_abort(Scsi_Cmnd *);
47 int generic_NCR5380_detect(Scsi_Host_Template *);
48 int generic_NCR5380_release_resources(struct Scsi_Host *);
49 int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
50 int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int);
51 int notyet_generic_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
52 const char *generic_NCR5380_info(struct Scsi_Host *);
54 int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
57 int generic_NCR5380_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
67 #define GENERIC_NCR5380 { \
68 proc_info: generic_NCR5380_proc_info, \
69 name: "Generic NCR5380/NCR53C400 Scsi Driver", \
70 detect: generic_NCR5380_detect, \
71 release: generic_NCR5380_release_resources, \
72 info: (void *)generic_NCR5380_info, \
73 queuecommand: generic_NCR5380_queue_command, \
74 abort: generic_NCR5380_abort, \
75 reset: generic_NCR5380_reset, \
76 bios_param: NCR5380_BIOSPARAM, \
77 can_queue: CAN_QUEUE, \
79 sg_tablesize: SG_ALL, \
80 cmd_per_lun: CMD_PER_LUN , \
81 use_clustering: DISABLE_CLUSTERING}
85 #define __STRVAL(x) #x
86 #define STRVAL(x) __STRVAL(x)
88 #ifdef CONFIG_SCSI_G_NCR5380_PORT
89 #define NCR5380_map_config port
90 #define NCR5380_map_type int
91 #define NCR5380_map_name port
92 #define NCR5380_instance_name io_port
93 #define NCR53C400_register_offset 0
94 #define NCR53C400_address_adjust 8
96 * FIXME: size should be runtime decided
99 #define NCR5380_region_size 16
101 #define NCR5380_region_size 8
104 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
105 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
108 /* therefore CONFIG_SCSI_G_NCR5380_MEM */
110 #define NCR5380_map_config memory
111 #define NCR5380_map_type unsigned long
112 #define NCR5380_map_name base
113 #define NCR5380_instance_name base
114 #define NCR53C400_register_offset 0x108
115 #define NCR53C400_address_adjust 0
116 #define NCR53C400_mem_base 0x3880
117 #define NCR53C400_host_buffer 0x3900
118 #define NCR5380_region_size 0x3a00
120 #define NCR5380_read(reg) isa_readb(NCR5380_map_name + NCR53C400_mem_base + (reg))
121 #define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + NCR53C400_mem_base + (reg), value)
125 #define NCR5380_implementation_fields \
126 NCR5380_map_type NCR5380_map_name
128 #define NCR5380_local_declare() \
129 register NCR5380_implementation_fields
131 #define NCR5380_setup(instance) \
132 NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
134 #define NCR5380_intr generic_NCR5380_intr
135 #define do_NCR5380_intr do_generic_NCR5380_intr
136 #define NCR5380_queue_command generic_NCR5380_queue_command
137 #define NCR5380_abort generic_NCR5380_abort
138 #define NCR5380_reset generic_NCR5380_reset
139 #define NCR5380_pread generic_NCR5380_pread
140 #define NCR5380_pwrite generic_NCR5380_pwrite
141 #define NCR5380_proc_info notyet_generic_proc_info
143 #define BOARD_NCR5380 0
144 #define BOARD_NCR53C400 1
145 #define BOARD_NCR53C400A 2
146 #define BOARD_DTC3181E 3
148 #endif /* else def HOSTS_C */
149 #endif /* GENERIC_NCR5380_H */