patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / drivers / scsi / 3w-xxxx.h
1 /* 
2    3w-xxxx.h -- 3ware Storage Controller device driver for Linux.
3    
4    Written By: Adam Radford <linuxraid@amcc.com>
5    Modifications By: Joel Jacobson <linux@3ware.com>
6                      Arnaldo Carvalho de Melo <acme@conectiva.com.br>
7                      Brad Strand <linux@3ware.com>
8
9    Copyright (C) 1999-2004 3ware Inc.
10
11    Kernel compatiblity By:      Andre Hedrick <andre@suse.com>
12    Non-Copyright (C) 2000       Andre Hedrick <andre@suse.com>
13
14    This program is free software; you can redistribute it and/or modify
15    it under the terms of the GNU General Public License as published by
16    the Free Software Foundation; version 2 of the License.
17
18    This program is distributed in the hope that it will be useful,           
19    but WITHOUT ANY WARRANTY; without even the implied warranty of            
20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             
21    GNU General Public License for more details.                              
22
23    NO WARRANTY                                                               
24    THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR        
25    CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT      
26    LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,      
27    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is    
28    solely responsible for determining the appropriateness of using and       
29    distributing the Program and assumes all risks associated with its        
30    exercise of rights under this Agreement, including but not limited to     
31    the risks and costs of program errors, damage to or loss of data,         
32    programs or equipment, and unavailability or interruption of operations.  
33
34    DISCLAIMER OF LIABILITY                                                   
35    NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY   
36    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL        
37    DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND   
38    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR     
39    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE    
40    USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED  
41    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES             
42
43    You should have received a copy of the GNU General Public License         
44    along with this program; if not, write to the Free Software               
45    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
46
47    Bugs/Comments/Suggestions should be mailed to:                            
48    linuxraid@amcc.com
49    
50    For more information, goto:
51    http://www.amcc.com
52 */
53
54 #ifndef _3W_XXXX_H
55 #define _3W_XXXX_H
56
57 #include <linux/version.h>
58 #include <linux/types.h>
59
60 /* AEN strings */
61 static char *tw_aen_string[] = {
62         [0x000] = "INFO: AEN queue empty",
63         [0x001] = "INFO: Soft reset occurred",
64         [0x002] = "ERROR: Unit degraded: Unit #",
65         [0x003] = "ERROR: Controller error",
66         [0x004] = "ERROR: Rebuild failed: Unit #",
67         [0x005] = "INFO: Rebuild complete: Unit #",
68         [0x006] = "ERROR: Incomplete unit detected: Unit #",
69         [0x007] = "INFO: Initialization complete: Unit #",
70         [0x008] = "WARNING: Unclean shutdown detected: Unit #",
71         [0x009] = "WARNING: ATA port timeout: Port #",
72         [0x00A] = "ERROR: Drive error: Port #",
73         [0x00B] = "INFO: Rebuild started: Unit #",
74         [0x00C] = "INFO: Initialization started: Unit #",
75         [0x00D] = "ERROR: Logical unit deleted: Unit #",
76         [0x00F] = "WARNING: SMART threshold exceeded: Port #",
77         [0x021] = "WARNING: ATA UDMA downgrade: Port #",
78         [0x021] = "WARNING: ATA UDMA upgrade: Port #",
79         [0x023] = "WARNING: Sector repair occurred: Port #",
80         [0x024] = "ERROR: SBUF integrity check failure",
81         [0x025] = "ERROR: Lost cached write: Port #",
82         [0x026] = "ERROR: Drive ECC error detected: Port #",
83         [0x027] = "ERROR: DCB checksum error: Port #",
84         [0x028] = "ERROR: DCB unsupported version: Port #",
85         [0x029] = "INFO: Verify started: Unit #",
86         [0x02A] = "ERROR: Verify failed: Port #",
87         [0x02B] = "INFO: Verify complete: Unit #",
88         [0x02C] = "WARNING: Overwrote bad sector during rebuild: Port #",
89         [0x02D] = "ERROR: Encountered bad sector during rebuild: Port #",
90         [0x02E] = "ERROR: Replacement drive is too small: Port #",
91         [0x02F] = "WARNING: Verify error: Unit not previously initialized: Unit #",
92         [0x030] = "ERROR: Drive not supported: Port #"
93 };
94
95 /*
96    Sense key lookup table
97    Format: ESDC/flags,SenseKey,AdditionalSenseCode,AdditionalSenseCodeQualifier
98 */
99 static unsigned char tw_sense_table[][4] =
100 {
101   /* Codes for newer firmware */
102                             // ATA Error                    SCSI Error
103   {0x01, 0x03, 0x13, 0x00}, // Address mark not found       Address mark not found for data field
104   {0x04, 0x0b, 0x00, 0x00}, // Aborted command              Aborted command
105   {0x10, 0x0b, 0x14, 0x00}, // ID not found                 Recorded entity not found
106   {0x40, 0x03, 0x11, 0x00}, // Uncorrectable ECC error      Unrecovered read error
107   {0x61, 0x04, 0x00, 0x00}, // Device fault                 Hardware error
108   {0x84, 0x0b, 0x47, 0x00}, // Data CRC error               SCSI parity error
109   {0xd0, 0x0b, 0x00, 0x00}, // Device busy                  Aborted command
110   {0xd1, 0x0b, 0x00, 0x00}, // Device busy                  Aborted command
111   {0x37, 0x02, 0x04, 0x00}, // Unit offline                 Not ready
112   {0x09, 0x02, 0x04, 0x00}, // Unrecovered disk error       Not ready
113
114   /* Codes for older firmware */
115                             // 3ware Error                  SCSI Error
116   {0x51, 0x0b, 0x00, 0x00}  // Unspecified                  Aborted command
117 };
118
119 /* Control register bit definitions */
120 #define TW_CONTROL_CLEAR_HOST_INTERRUPT        0x00080000
121 #define TW_CONTROL_CLEAR_ATTENTION_INTERRUPT   0x00040000
122 #define TW_CONTROL_MASK_COMMAND_INTERRUPT      0x00020000
123 #define TW_CONTROL_MASK_RESPONSE_INTERRUPT     0x00010000
124 #define TW_CONTROL_UNMASK_COMMAND_INTERRUPT    0x00008000
125 #define TW_CONTROL_UNMASK_RESPONSE_INTERRUPT   0x00004000
126 #define TW_CONTROL_CLEAR_ERROR_STATUS          0x00000200
127 #define TW_CONTROL_ISSUE_SOFT_RESET            0x00000100
128 #define TW_CONTROL_ENABLE_INTERRUPTS           0x00000080
129 #define TW_CONTROL_DISABLE_INTERRUPTS          0x00000040
130 #define TW_CONTROL_ISSUE_HOST_INTERRUPT        0x00000020
131 #define TW_CONTROL_CLEAR_PARITY_ERROR          0x00800000
132 #define TW_CONTROL_CLEAR_QUEUE_ERROR           0x00400000
133 #define TW_CONTROL_CLEAR_PCI_ABORT             0x00100000
134 #define TW_CONTROL_CLEAR_SBUF_WRITE_ERROR      0x00000008
135
136 /* Status register bit definitions */
137 #define TW_STATUS_MAJOR_VERSION_MASK           0xF0000000
138 #define TW_STATUS_MINOR_VERSION_MASK           0x0F000000
139 #define TW_STATUS_PCI_PARITY_ERROR             0x00800000
140 #define TW_STATUS_QUEUE_ERROR                  0x00400000
141 #define TW_STATUS_MICROCONTROLLER_ERROR        0x00200000
142 #define TW_STATUS_PCI_ABORT                    0x00100000
143 #define TW_STATUS_HOST_INTERRUPT               0x00080000
144 #define TW_STATUS_ATTENTION_INTERRUPT          0x00040000
145 #define TW_STATUS_COMMAND_INTERRUPT            0x00020000
146 #define TW_STATUS_RESPONSE_INTERRUPT           0x00010000
147 #define TW_STATUS_COMMAND_QUEUE_FULL           0x00008000
148 #define TW_STATUS_RESPONSE_QUEUE_EMPTY         0x00004000
149 #define TW_STATUS_MICROCONTROLLER_READY        0x00002000
150 #define TW_STATUS_COMMAND_QUEUE_EMPTY          0x00001000
151 #define TW_STATUS_ALL_INTERRUPTS               0x000F0000
152 #define TW_STATUS_CLEARABLE_BITS               0x00D00000
153 #define TW_STATUS_EXPECTED_BITS                0x00002000
154 #define TW_STATUS_UNEXPECTED_BITS              0x00F00008
155 #define TW_STATUS_SBUF_WRITE_ERROR             0x00000008
156 #define TW_STATUS_VALID_INTERRUPT              0x00DF0008
157
158 /* RESPONSE QUEUE BIT DEFINITIONS */
159 #define TW_RESPONSE_ID_MASK                    0x00000FF0
160
161 /* PCI related defines */
162 #define TW_IO_ADDRESS_RANGE                    0x10
163 #define TW_DEVICE_NAME                         "3ware Storage Controller"
164 #define TW_VENDOR_ID (0x13C1)   /* 3ware */
165 #define TW_DEVICE_ID (0x1000)   /* Storage Controller */
166 #define TW_DEVICE_ID2 (0x1001)  /* 7000 series controller */
167 #define TW_NUMDEVICES 2
168 #define TW_PCI_CLEAR_PARITY_ERRORS 0xc100
169 #define TW_PCI_CLEAR_PCI_ABORT     0x2000
170
171 /* Command packet opcodes */
172 #define TW_OP_NOP             0x0
173 #define TW_OP_INIT_CONNECTION 0x1
174 #define TW_OP_READ            0x2
175 #define TW_OP_WRITE           0x3
176 #define TW_OP_VERIFY          0x4
177 #define TW_OP_GET_PARAM       0x12
178 #define TW_OP_SET_PARAM       0x13
179 #define TW_OP_SECTOR_INFO     0x1a
180 #define TW_OP_AEN_LISTEN      0x1c
181 #define TW_OP_FLUSH_CACHE     0x0e
182 #define TW_CMD_PACKET         0x1d
183 #define TW_ATA_PASSTHRU       0x1e
184 #define TW_CMD_PACKET_WITH_DATA 0x1f
185
186 /* Asynchronous Event Notification (AEN) Codes */
187 #define TW_AEN_QUEUE_EMPTY       0x0000
188 #define TW_AEN_SOFT_RESET        0x0001
189 #define TW_AEN_DEGRADED_MIRROR   0x0002
190 #define TW_AEN_CONTROLLER_ERROR  0x0003
191 #define TW_AEN_REBUILD_FAIL      0x0004
192 #define TW_AEN_REBUILD_DONE      0x0005
193 #define TW_AEN_QUEUE_FULL        0x00ff
194 #define TW_AEN_TABLE_UNDEFINED   0x15
195 #define TW_AEN_APORT_TIMEOUT     0x0009
196 #define TW_AEN_DRIVE_ERROR       0x000A
197 #define TW_AEN_SMART_FAIL        0x000F
198 #define TW_AEN_SBUF_FAIL         0x0024
199
200 /* Misc defines */
201 #define TW_ALIGNMENT_6000                     64 /* 64 bytes */
202 #define TW_ALIGNMENT_7000                     4  /* 4 bytes */
203 #define TW_MAX_UNITS                          16
204 #define TW_COMMAND_ALIGNMENT_MASK             0x1ff
205 #define TW_INIT_MESSAGE_CREDITS               0x100
206 #define TW_INIT_COMMAND_PACKET_SIZE           0x3
207 #define TW_POLL_MAX_RETRIES                   20000
208 #define TW_MAX_SGL_LENGTH                     62
209 #define TW_ATA_PASS_SGL_MAX                   60
210 #define TW_MAX_PASSTHRU_BYTES                 4096
211 #define TW_Q_LENGTH                           256
212 #define TW_Q_START                            0
213 #define TW_MAX_SLOT                           32
214 #define TW_MAX_PCI_BUSES                      255
215 #define TW_MAX_RESET_TRIES                    3
216 #define TW_UNIT_INFORMATION_TABLE_BASE        0x300
217 #define TW_MAX_CMDS_PER_LUN                   254 /* 254 for io, 1 for
218                                                      chrdev ioctl, one for
219                                                      internal aen post */
220 #define TW_BLOCK_SIZE                         0x200 /* 512-byte blocks */
221 #define TW_IOCTL                              0x80
222 #define TW_UNIT_ONLINE                        1
223 #define TW_IN_INTR                            1
224 #define TW_IN_IOCTL                           2
225 #define TW_IN_CHRDEV_IOCTL                    3
226 #define TW_MAX_SECTORS                        256
227 #define TW_AEN_WAIT_TIME                      1000
228 #define TW_IOCTL_WAIT_TIME                    (1 * HZ) /* 1 second */
229 #define TW_ISR_DONT_COMPLETE                  2
230 #define TW_ISR_DONT_RESULT                    3
231 #define TW_IOCTL_TIMEOUT                      25 /* 25 seconds */
232 #define TW_IOCTL_CHRDEV_TIMEOUT               60 /* 60 seconds */
233 #define TW_IOCTL_CHRDEV_FREE                  -1
234
235 /* Macros */
236 #define TW_STATUS_ERRORS(x) \
237         (((x & TW_STATUS_PCI_ABORT) || \
238         (x & TW_STATUS_PCI_PARITY_ERROR) || \
239         (x & TW_STATUS_QUEUE_ERROR) || \
240         (x & TW_STATUS_MICROCONTROLLER_ERROR)) && \
241         (x & TW_STATUS_MICROCONTROLLER_READY))
242
243 #ifdef TW_DEBUG
244 #define dprintk(msg...) printk(msg)
245 #else
246 #define dprintk(msg...) do { } while(0)
247 #endif
248
249 #pragma pack(1)
250
251 /* Scatter Gather List Entry */
252 typedef struct TAG_TW_SG_Entry {
253         u32 address;
254         u32 length;
255 } TW_SG_Entry;
256
257 typedef unsigned char TW_Sector[512];
258
259 /* Command Packet */
260 typedef struct TW_Command {
261         /* First DWORD */
262         struct {
263                 unsigned char opcode:5;
264                 unsigned char sgl_offset:3;
265         } byte0;
266         unsigned char size;
267         unsigned char request_id;
268         struct {
269                 unsigned char unit:4;
270                 unsigned char host_id:4;
271         } byte3;
272         /* Second DWORD */
273         unsigned char status;
274         unsigned char flags;
275         union {
276                 unsigned short block_count;
277                 unsigned short parameter_count;
278                 unsigned short message_credits;
279         } byte6;
280         union {
281                 struct {
282                         u32 lba;
283                         TW_SG_Entry sgl[TW_MAX_SGL_LENGTH];
284                         u32 padding;    /* pad to 512 bytes */
285                 } io;
286                 struct {
287                         TW_SG_Entry sgl[TW_MAX_SGL_LENGTH];
288                         u32 padding[2];
289                 } param;
290                 struct {
291                         u32 response_queue_pointer;
292                         u32 padding[125];
293                 } init_connection;
294                 struct {
295                         char version[504];
296                 } ioctl_miniport_version;
297         } byte8;
298 } TW_Command;
299
300 #pragma pack()
301
302 typedef struct TAG_TW_Ioctl {
303         unsigned char opcode;
304         unsigned short table_id;
305         unsigned char parameter_id;
306         unsigned char parameter_size_bytes;
307         unsigned char unit_index;
308         unsigned char data[1];
309 } TW_Ioctl;
310
311 #pragma pack(1)
312
313 /* Structure for new chardev ioctls */
314 typedef struct TAG_TW_New_Ioctl {
315         unsigned int data_buffer_length;
316         unsigned char padding [508];
317         TW_Command firmware_command;
318         char data_buffer[1];
319 } TW_New_Ioctl;
320
321 /* GetParam descriptor */
322 typedef struct {
323         unsigned short  table_id;
324         unsigned char   parameter_id;
325         unsigned char   parameter_size_bytes;
326         unsigned char   data[1];
327 } TW_Param, *PTW_Param;
328
329 /* Response queue */
330 typedef union TAG_TW_Response_Queue {
331         struct {
332                 u32 undefined_1: 4;
333                 u32 response_id: 8;
334                 u32 undefined_2: 20;
335         } u;
336         u32 value;
337 } TW_Response_Queue;
338
339 typedef struct TAG_TW_Registers {
340         u32 base_addr;
341         u32 control_reg_addr;
342         u32 status_reg_addr;
343         u32 command_que_addr;
344         u32 response_que_addr;
345 } TW_Registers;
346
347 typedef struct TAG_TW_Info {
348         char *buffer;
349         int length;
350         int offset;
351         int position;
352 } TW_Info;
353
354 typedef int TW_Cmd_State;
355
356 #define TW_S_INITIAL   0x1  /* Initial state */
357 #define TW_S_STARTED   0x2  /* Id in use */
358 #define TW_S_POSTED    0x4  /* Posted to the controller */
359 #define TW_S_PENDING   0x8  /* Waiting to be posted in isr */
360 #define TW_S_COMPLETED 0x10 /* Completed by isr */
361 #define TW_S_FINISHED  0x20 /* I/O completely done */
362 #define TW_START_MASK (TW_S_STARTED | TW_S_POSTED | TW_S_PENDING | TW_S_COMPLETED)
363
364 /* Command header for ATA pass-thru */
365 typedef struct TAG_TW_Passthru
366 {
367         struct {
368                 unsigned char opcode:5;
369                 unsigned char sgloff:3;
370         } byte0;
371         unsigned char size;
372         unsigned char request_id;
373         struct {
374                 unsigned char aport:4;
375                 unsigned char host_id:4;
376         } byte3;
377         unsigned char status;
378         unsigned char flags;
379         unsigned short param;
380         unsigned short features;
381         unsigned short sector_count;
382         unsigned short sector_num;
383         unsigned short cylinder_lo;
384         unsigned short cylinder_hi;
385         unsigned char drive_head;
386         unsigned char command;
387         TW_SG_Entry sg_list[TW_ATA_PASS_SGL_MAX];
388         unsigned char padding[12];
389 } TW_Passthru;
390
391 typedef struct TAG_TW_Device_Extension {
392         TW_Registers            registers;
393         unsigned long           *alignment_virtual_address[TW_Q_LENGTH];
394         unsigned long           alignment_physical_address[TW_Q_LENGTH];
395         int                     is_unit_present[TW_MAX_UNITS];
396         int                     num_units;
397         unsigned long           *command_packet_virtual_address[TW_Q_LENGTH];
398         unsigned long           command_packet_physical_address[TW_Q_LENGTH];
399         struct pci_dev          *tw_pci_dev;
400         Scsi_Cmnd               *srb[TW_Q_LENGTH];
401         unsigned char           free_queue[TW_Q_LENGTH];
402         unsigned char           free_head;
403         unsigned char           free_tail;
404         unsigned char           free_wrap;
405         unsigned char           pending_queue[TW_Q_LENGTH];
406         unsigned char           pending_head;
407         unsigned char           pending_tail;
408         TW_Cmd_State            state[TW_Q_LENGTH];
409         u32                     posted_request_count;
410         u32                     max_posted_request_count;
411         u32                     request_count_marked_pending;
412         u32                     pending_request_count;
413         u32                     max_pending_request_count;
414         u32                     max_sgl_entries;
415         u32                     sgl_entries;
416         u32                     num_aborts;
417         u32                     num_resets;
418         u32                     sector_count;
419         u32                     max_sector_count;
420         u32                     aen_count;
421         struct Scsi_Host        *host;
422         spinlock_t              tw_lock;
423         struct semaphore        ioctl_sem;
424         int                     ioctl_size[TW_Q_LENGTH];
425         unsigned short          aen_queue[TW_Q_LENGTH];
426         unsigned char           aen_head;
427         unsigned char           aen_tail;
428         volatile long           flags; /* long req'd for set_bit --RR */
429         unsigned long           *ioctl_data[TW_Q_LENGTH];
430         int                     reset_print;
431         char                    online;
432         volatile int            chrdev_request_id;
433         wait_queue_head_t       ioctl_wqueue;
434 } TW_Device_Extension;
435
436 #pragma pack()
437
438 /* Function prototypes */
439 int tw_aen_complete(TW_Device_Extension *tw_dev, int request_id);
440 int tw_aen_drain_queue(TW_Device_Extension *tw_dev);
441 int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
442 int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which);
443 int tw_check_bits(u32 status_reg_value);
444 int tw_check_errors(TW_Device_Extension *tw_dev);
445 void tw_clear_all_interrupts(TW_Device_Extension *tw_dev);
446 void tw_clear_attention_interrupt(TW_Device_Extension *tw_dev);
447 void tw_clear_host_interrupt(TW_Device_Extension *tw_dev);
448 int tw_decode_bits(TW_Device_Extension *tw_dev, u32 status_reg_value, int print_host);
449 int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill_sense);
450 void tw_disable_interrupts(TW_Device_Extension *tw_dev);
451 void tw_empty_response_que(TW_Device_Extension *tw_dev);
452 void tw_enable_interrupts(TW_Device_Extension *tw_dev);
453 void tw_enable_and_clear_interrupts(TW_Device_Extension *tw_dev);
454 int tw_findcards(Scsi_Host_Template *tw_host);
455 void tw_free_device_extension(TW_Device_Extension *tw_dev);
456 int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits);
457 int tw_initialize_device_extension(TW_Device_Extension *tw_dev);
458 int tw_initialize_units(TW_Device_Extension *tw_dev);
459 int tw_ioctl(TW_Device_Extension *tw_dev, int request_id);
460 int tw_ioctl_complete(TW_Device_Extension *tw_dev, int request_id);
461 void tw_mask_command_interrupt(TW_Device_Extension *tw_dev);
462 int tw_poll_status(TW_Device_Extension *tw_dev, u32 flag, int seconds);
463 int tw_poll_status_gone(TW_Device_Extension *tw_dev, u32 flag, int seconds);
464 int tw_post_command_packet(TW_Device_Extension *tw_dev, int request_id);
465 int tw_reset_device_extension(TW_Device_Extension *tw_dev);
466 int tw_reset_sequence(TW_Device_Extension *tw_dev);
467 int tw_scsi_biosparam(struct scsi_device *sdev, struct block_device *bdev,
468                 sector_t capacity, int geom[]);
469 int tw_scsi_detect(Scsi_Host_Template *tw_host);
470 int tw_scsi_eh_abort(Scsi_Cmnd *SCpnt);
471 int tw_scsi_eh_reset(Scsi_Cmnd *SCpnt);
472 int tw_scsi_queue(Scsi_Cmnd *cmd, void (*done) (Scsi_Cmnd *));
473 int tw_scsi_release(struct Scsi_Host *tw_host);
474 int tw_scsiop_inquiry(TW_Device_Extension *tw_dev, int request_id);
475 int tw_scsiop_inquiry_complete(TW_Device_Extension *tw_dev, int request_id);
476 int tw_scsiop_mode_sense(TW_Device_Extension *tw_dev, int request_id);
477 int tw_scsiop_mode_sense_complete(TW_Device_Extension *tw_dev, int request_id);
478 int tw_scsiop_read_capacity(TW_Device_Extension *tw_dev, int request_id);
479 int tw_scsiop_read_capacity_complete(TW_Device_Extension *tw_dev, int request_id);
480 int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id);
481 int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id);
482 int tw_scsiop_synchronize_cache(TW_Device_Extension *tw_dev, int request_id);
483 int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id);
484 int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int request_id);
485 int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size, 
486                   unsigned char *val);
487 int tw_setup_irq(TW_Device_Extension *tw_dev);
488 int tw_shutdown_device(TW_Device_Extension *tw_dev);
489 int tw_slave_configure(Scsi_Device *SDptr);
490 void tw_soft_reset(TW_Device_Extension *tw_dev);
491 int tw_state_request_finish(TW_Device_Extension *tw_dev,int request_id);
492 int tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id);
493 void tw_unmask_command_interrupt(TW_Device_Extension *tw_dev);
494
495 #endif /* _3W_XXXX_H */