1 |
1626 |
jcastillo |
/*
|
2 |
|
|
* atari_scsi.h -- Header file for the Atari native SCSI driver
|
3 |
|
|
*
|
4 |
|
|
* Copyright 1994 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
|
5 |
|
|
*
|
6 |
|
|
* (Loosely based on the work of Robert De Vries' team)
|
7 |
|
|
*
|
8 |
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
9 |
|
|
* License. See the file COPYING in the main directory of this archive
|
10 |
|
|
* for more details.
|
11 |
|
|
*
|
12 |
|
|
*/
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
#ifndef ATARI_SCSI_H
|
16 |
|
|
#define ATARI_SCSI_H
|
17 |
|
|
|
18 |
|
|
/* (I_HAVE_OVERRUNS stuff removed) */
|
19 |
|
|
|
20 |
|
|
#ifndef ASM
|
21 |
|
|
int atari_scsi_abort (Scsi_Cmnd *);
|
22 |
|
|
int atari_scsi_detect (Scsi_Host_Template *);
|
23 |
|
|
const char *atari_scsi_info (struct Scsi_Host *);
|
24 |
|
|
int atari_scsi_queue_command (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
|
25 |
|
|
int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
|
26 |
|
|
int atari_scsi_proc_info (char *, char **, off_t, int, int, int);
|
27 |
|
|
#ifdef MODULE
|
28 |
|
|
int atari_scsi_release (struct Scsi_Host *);
|
29 |
|
|
#else
|
30 |
|
|
#define atari_scsi_release NULL
|
31 |
|
|
#endif
|
32 |
|
|
|
33 |
|
|
/* The values for CMD_PER_LUN and CAN_QUEUE are somehow arbitrary. Higher
|
34 |
|
|
* values should work, too; try it! (but cmd_per_lun costs memory!) */
|
35 |
|
|
|
36 |
|
|
/* But there seems to be a bug somewhere that requires CAN_QUEUE to be
|
37 |
|
|
* 2*CMD_OER_LUN. At least on a TT, no spurious timeouts seen since
|
38 |
|
|
* changed CMD_PER_LUN... */
|
39 |
|
|
|
40 |
|
|
/* Note: The Falcon currently uses 8/1 setting due to unsolved problems with
|
41 |
|
|
* cmd_per_lun != 1 */
|
42 |
|
|
|
43 |
|
|
#define ATARI_TT_CAN_QUEUE 16
|
44 |
|
|
#define ATARI_TT_CMD_PER_LUN 8
|
45 |
|
|
#define ATARI_TT_SG_TABLESIZE SG_ALL
|
46 |
|
|
|
47 |
|
|
#define ATARI_FALCON_CAN_QUEUE 8
|
48 |
|
|
#define ATARI_FALCON_CMD_PER_LUN 1
|
49 |
|
|
#define ATARI_FALCON_SG_TABLESIZE SG_NONE
|
50 |
|
|
|
51 |
|
|
#define DEFAULT_USE_TAGGED_QUEUING 0
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
#if defined (HOSTS_C) || defined (MODULE)
|
55 |
|
|
|
56 |
|
|
#define ATARI_SCSI { NULL, NULL, NULL, \
|
57 |
|
|
atari_scsi_proc_info, \
|
58 |
|
|
"Atari native SCSI", \
|
59 |
|
|
atari_scsi_detect, \
|
60 |
|
|
atari_scsi_release, \
|
61 |
|
|
atari_scsi_info, \
|
62 |
|
|
/* command */ NULL, \
|
63 |
|
|
atari_scsi_queue_command, \
|
64 |
|
|
atari_scsi_abort, \
|
65 |
|
|
atari_scsi_reset, \
|
66 |
|
|
/* slave_attach */ NULL, \
|
67 |
|
|
/* bios_param */ NULL, \
|
68 |
|
|
/* can queue */ 0, /* initialized at run-time */ \
|
69 |
|
|
/* host_id */ 0, /* initialized at run-time */ \
|
70 |
|
|
/* scatter gather */ 0, /* initialized at run-time */ \
|
71 |
|
|
/* cmd per lun */ 0, /* initialized at run-time */ \
|
72 |
|
|
/* present */ 0, \
|
73 |
|
|
/* unchecked ISA DMA */ 0, \
|
74 |
|
|
/* use_clustering */ DISABLE_CLUSTERING }
|
75 |
|
|
|
76 |
|
|
#endif
|
77 |
|
|
|
78 |
|
|
#ifndef HOSTS_C
|
79 |
|
|
|
80 |
|
|
#define NCR5380_implementation_fields /* none */
|
81 |
|
|
|
82 |
|
|
#define NCR5380_read(reg) atari_scsi_reg_read( reg )
|
83 |
|
|
#define NCR5380_write(reg, value) atari_scsi_reg_write( reg, value )
|
84 |
|
|
|
85 |
|
|
#define NCR5380_intr atari_scsi_intr
|
86 |
|
|
#define NCR5380_queue_command atari_scsi_queue_command
|
87 |
|
|
#define NCR5380_abort atari_scsi_abort
|
88 |
|
|
#define NCR5380_proc_info atari_scsi_proc_info
|
89 |
|
|
#define NCR5380_dma_read_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 0)
|
90 |
|
|
#define NCR5380_dma_write_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 1)
|
91 |
|
|
#define NCR5380_dma_residual(inst) atari_scsi_dma_residual( inst )
|
92 |
|
|
#define NCR5380_dma_xfer_len(i,cmd,phase) \
|
93 |
|
|
atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
|
94 |
|
|
|
95 |
|
|
/* Debugging printk definitions:
|
96 |
|
|
* DPRINTK() is the generic one, takes an NDEBUG_* mask as argument;
|
97 |
|
|
* all others are hardcoded to one NDEBUG_* code:
|
98 |
|
|
*
|
99 |
|
|
* ARB -> arbitration
|
100 |
|
|
* ASEN -> auto-sense
|
101 |
|
|
* DMA -> DMA
|
102 |
|
|
* HSH -> PIO handshake
|
103 |
|
|
* INF -> information transfer
|
104 |
|
|
* INI -> initialization
|
105 |
|
|
* INT -> interrupt
|
106 |
|
|
* LNK -> linked commands
|
107 |
|
|
* MAIN -> NCR5380_main() control flow
|
108 |
|
|
* NDAT -> no data-out phase
|
109 |
|
|
* NWR -> no write commands
|
110 |
|
|
* PIO -> PIO transfers
|
111 |
|
|
* PDMA -> pseudo DMA (unused on Atari)
|
112 |
|
|
* QU -> queues
|
113 |
|
|
* RSL -> reselections
|
114 |
|
|
* SEL -> selections
|
115 |
|
|
* USL -> usleep cpde (unused on Atari)
|
116 |
|
|
* LBS -> last byte sent (unused on Atari)
|
117 |
|
|
* RSS -> restarting of selections
|
118 |
|
|
* EXT -> extended messages
|
119 |
|
|
* ABRT -> aborting and resetting
|
120 |
|
|
* TAG -> queue tag handling
|
121 |
|
|
* MER -> merging of consec. buffers
|
122 |
|
|
*
|
123 |
|
|
*/
|
124 |
|
|
|
125 |
|
|
#define DPRINTK(mask, format, args...) \
|
126 |
|
|
do { \
|
127 |
|
|
if (NDEBUG & (mask)) \
|
128 |
|
|
printk(KERN_DEBUG format , ## args); \
|
129 |
|
|
} while(0)
|
130 |
|
|
|
131 |
|
|
#define ARB_PRINTK(format, args...) \
|
132 |
|
|
DPRINTK(NDEBUG_ARBITRATION, format , ##args)
|
133 |
|
|
#define ASEN_PRINTK(format, args...) \
|
134 |
|
|
DPRINTK(NDEBUG_AUTOSENSE, format , ##args)
|
135 |
|
|
#define DMA_PRINTK(format, args...) \
|
136 |
|
|
DPRINTK(NDEBUG_DMA, format , ##args)
|
137 |
|
|
#define HSH_PRINTK(format, args...) \
|
138 |
|
|
DPRINTK(NDEBUG_HANDSHAKE, format , ##args)
|
139 |
|
|
#define INF_PRINTK(format, args...) \
|
140 |
|
|
DPRINTK(NDEBUG_INFORMATION, format , ##args)
|
141 |
|
|
#define INI_PRINTK(format, args...) \
|
142 |
|
|
DPRINTK(NDEBUG_INIT, format , ##args)
|
143 |
|
|
#define INT_PRINTK(format, args...) \
|
144 |
|
|
DPRINTK(NDEBUG_INTR, format , ##args)
|
145 |
|
|
#define LNK_PRINTK(format, args...) \
|
146 |
|
|
DPRINTK(NDEBUG_LINKED, format , ##args)
|
147 |
|
|
#define MAIN_PRINTK(format, args...) \
|
148 |
|
|
DPRINTK(NDEBUG_MAIN, format , ##args)
|
149 |
|
|
#define NDAT_PRINTK(format, args...) \
|
150 |
|
|
DPRINTK(NDEBUG_NO_DATAOUT, format , ##args)
|
151 |
|
|
#define NWR_PRINTK(format, args...) \
|
152 |
|
|
DPRINTK(NDEBUG_NO_WRITE, format , ##args)
|
153 |
|
|
#define PIO_PRINTK(format, args...) \
|
154 |
|
|
DPRINTK(NDEBUG_PIO, format , ##args)
|
155 |
|
|
#define PDMA_PRINTK(format, args...) \
|
156 |
|
|
DPRINTK(NDEBUG_PSEUDO_DMA, format , ##args)
|
157 |
|
|
#define QU_PRINTK(format, args...) \
|
158 |
|
|
DPRINTK(NDEBUG_QUEUES, format , ##args)
|
159 |
|
|
#define RSL_PRINTK(format, args...) \
|
160 |
|
|
DPRINTK(NDEBUG_RESELECTION, format , ##args)
|
161 |
|
|
#define SEL_PRINTK(format, args...) \
|
162 |
|
|
DPRINTK(NDEBUG_SELECTION, format , ##args)
|
163 |
|
|
#define USL_PRINTK(format, args...) \
|
164 |
|
|
DPRINTK(NDEBUG_USLEEP, format , ##args)
|
165 |
|
|
#define LBS_PRINTK(format, args...) \
|
166 |
|
|
DPRINTK(NDEBUG_LAST_BYTE_SENT, format , ##args)
|
167 |
|
|
#define RSS_PRINTK(format, args...) \
|
168 |
|
|
DPRINTK(NDEBUG_RESTART_SELECT, format , ##args)
|
169 |
|
|
#define EXT_PRINTK(format, args...) \
|
170 |
|
|
DPRINTK(NDEBUG_EXTENDED, format , ##args)
|
171 |
|
|
#define ABRT_PRINTK(format, args...) \
|
172 |
|
|
DPRINTK(NDEBUG_ABORT, format , ##args)
|
173 |
|
|
#define TAG_PRINTK(format, args...) \
|
174 |
|
|
DPRINTK(NDEBUG_TAGS, format , ##args)
|
175 |
|
|
#define MER_PRINTK(format, args...) \
|
176 |
|
|
DPRINTK(NDEBUG_MERGING, format , ##args)
|
177 |
|
|
|
178 |
|
|
/* conditional macros for NCR5380_print_{,phase,status} */
|
179 |
|
|
|
180 |
|
|
#define NCR_PRINT(mask) \
|
181 |
|
|
((NDEBUG & (mask)) ? NCR5380_print(instance) : (void)0)
|
182 |
|
|
|
183 |
|
|
#define NCR_PRINT_PHASE(mask) \
|
184 |
|
|
((NDEBUG & (mask)) ? NCR5380_print_phase(instance) : (void)0)
|
185 |
|
|
|
186 |
|
|
#define NCR_PRINT_STATUS(mask) \
|
187 |
|
|
((NDEBUG & (mask)) ? NCR5380_print_status(instance) : (void)0)
|
188 |
|
|
|
189 |
|
|
#define NDEBUG_ANY 0xffffffff
|
190 |
|
|
|
191 |
|
|
|
192 |
|
|
#endif /* else def HOSTS_C */
|
193 |
|
|
#endif /* ndef ASM */
|
194 |
|
|
#endif /* ATARI_SCSI_H */
|
195 |
|
|
|
196 |
|
|
|