patch-2.4.20 linux-2.4.20/drivers/scsi/3w-xxxx.h
Next file: linux-2.4.20/drivers/scsi/53c700.c
Previous file: linux-2.4.20/drivers/scsi/3w-xxxx.c
Back to the patch index
Back to the overall index
- Lines: 189
- Date:
Thu Nov 28 15:53:14 2002
- Orig file:
linux-2.4.19/drivers/scsi/3w-xxxx.h
- Orig date:
Fri Aug 2 17:39:44 2002
diff -urN linux-2.4.19/drivers/scsi/3w-xxxx.h linux-2.4.20/drivers/scsi/3w-xxxx.h
@@ -91,14 +91,13 @@
"INFO: Verify started: Unit #", // 0x029
"ERROR: Verify failed: Port #", // 0x02A
"INFO: Verify complete: Unit #", // 0x02B
- "ERROR: Overwrote bad sector during rebuild: Port #", //0x02C
- "ERROR: Encountered bad sector during rebuild: Port #", //0x02D
- "INFO: Replacement drive is too small: Port #", //0x02E
- "WARNING: Verify error: Unit not previously initialized: Unit #" //0x02F
+ "WARNING: Overwrote bad sector during rebuild: Port #", //0x02C
+ "ERROR: Encountered bad sector during rebuild: Port #", //0x02D
+ "ERROR: Replacement drive is too small: Port #", //0x02E
+ "WARNING: Verify error: Unit not previously initialized: Unit #", //0x02F
+ "ERROR: Drive not supported: Port #" // 0x030
};
-#define TW_AEN_STRING_MAX 0x030
-
/*
Sense key lookup table
Format: ESDC/flags,SenseKey,AdditionalSenseCode,AdditionalSenseCodeQualifier
@@ -166,7 +165,7 @@
#define TW_RESPONSE_ID_MASK 0x00000FF0
/* PCI related defines */
-#define TW_IO_ADDRESS_RANGE 0xD
+#define TW_IO_ADDRESS_RANGE 0x10
#define TW_DEVICE_NAME "3ware Storage Controller"
#define TW_VENDOR_ID (0x13C1) /* 3ware */
#define TW_DEVICE_ID (0x1000) /* Storage Controller */
@@ -185,6 +184,7 @@
#define TW_OP_SET_PARAM 0x13
#define TW_OP_SECTOR_INFO 0x1a
#define TW_OP_AEN_LISTEN 0x1c
+#define TW_OP_FLUSH_CACHE 0x0e
#define TW_CMD_PACKET 0x1d
#define TW_ATA_PASSTHRU 0x1e
#define TW_CMD_PACKET_WITH_DATA 0x1f
@@ -224,7 +224,6 @@
#define TW_MAX_CMDS_PER_LUN 255
#define TW_BLOCK_SIZE 0x200 /* 512-byte blocks */
#define TW_IOCTL 0x80
-#define TW_MAX_AEN_TRIES 100
#define TW_UNIT_ONLINE 1
#define TW_IN_INTR 1
#define TW_IN_IOCTL 2
@@ -253,8 +252,8 @@
/* Scatter Gather List Entry */
typedef struct TAG_TW_SG_Entry {
- unsigned long address;
- unsigned long length;
+ u32 address;
+ u32 length;
} TW_SG_Entry;
typedef unsigned char TW_Sector[512];
@@ -282,17 +281,17 @@
} byte6;
union {
struct {
- unsigned long lba;
+ u32 lba;
TW_SG_Entry sgl[TW_MAX_SGL_LENGTH];
- unsigned long padding; /* pad to 512 bytes */
+ u32 padding; /* pad to 512 bytes */
} io;
struct {
TW_SG_Entry sgl[TW_MAX_SGL_LENGTH];
- unsigned long padding[2];
+ u32 padding[2];
} param;
struct {
- unsigned long response_queue_pointer;
- unsigned long padding[125];
+ u32 response_queue_pointer;
+ u32 padding[125];
} init_connection;
struct {
char version[504];
@@ -384,15 +383,16 @@
typedef struct TAG_TW_Device_Extension {
TW_Registers registers;
- u32 *alignment_virtual_address[TW_Q_LENGTH];
- u32 alignment_physical_address[TW_Q_LENGTH];
- u32 *bounce_buffer[TW_Q_LENGTH];
+ unsigned long *alignment_virtual_address[TW_Q_LENGTH];
+ unsigned long alignment_physical_address[TW_Q_LENGTH];
+ unsigned long *bounce_buffer[TW_Q_LENGTH];
+ unsigned long bounce_buffer_phys[TW_Q_LENGTH];
int is_unit_present[TW_MAX_UNITS];
int is_raid_five[TW_MAX_UNITS];
int num_units;
int num_raid_five;
- u32 *command_packet_virtual_address[TW_Q_LENGTH];
- u32 command_packet_physical_address[TW_Q_LENGTH];
+ unsigned long *command_packet_virtual_address[TW_Q_LENGTH];
+ unsigned long command_packet_physical_address[TW_Q_LENGTH];
struct pci_dev *tw_pci_dev;
Scsi_Cmnd *srb[TW_Q_LENGTH];
unsigned char free_queue[TW_Q_LENGTH];
@@ -422,15 +422,16 @@
unsigned char aen_head;
unsigned char aen_tail;
volatile long flags; /* long req'd for set_bit --RR */
- char *ioctl_data[TW_Q_LENGTH];
+ unsigned long *ioctl_data[TW_Q_LENGTH];
int reset_print;
+ char online;
} TW_Device_Extension;
/* Function prototypes */
int tw_aen_complete(TW_Device_Extension *tw_dev, int request_id);
int tw_aen_drain_queue(TW_Device_Extension *tw_dev);
int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
-int tw_allocate_memory(TW_Device_Extension *tw_dev, int request_id, int size, int which);
+int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which);
int tw_check_bits(u32 status_reg_value);
int tw_check_errors(TW_Device_Extension *tw_dev);
void tw_clear_all_interrupts(TW_Device_Extension *tw_dev);
@@ -451,6 +452,7 @@
int tw_ioctl_complete(TW_Device_Extension *tw_dev, int request_id);
void tw_mask_command_interrupt(TW_Device_Extension *tw_dev);
int tw_poll_status(TW_Device_Extension *tw_dev, u32 flag, int seconds);
+int tw_poll_status_gone(TW_Device_Extension *tw_dev, u32 flag, int seconds);
int tw_post_command_packet(TW_Device_Extension *tw_dev, int request_id);
int tw_reset_device_extension(TW_Device_Extension *tw_dev);
int tw_reset_sequence(TW_Device_Extension *tw_dev);
@@ -463,10 +465,13 @@
int tw_scsi_release(struct Scsi_Host *tw_host);
int tw_scsiop_inquiry(TW_Device_Extension *tw_dev, int request_id);
int tw_scsiop_inquiry_complete(TW_Device_Extension *tw_dev, int request_id);
+int tw_scsiop_mode_sense(TW_Device_Extension *tw_dev, int request_id);
+int tw_scsiop_mode_sense_complete(TW_Device_Extension *tw_dev, int request_id);
int tw_scsiop_read_capacity(TW_Device_Extension *tw_dev, int request_id);
int tw_scsiop_read_capacity_complete(TW_Device_Extension *tw_dev, int request_id);
int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id);
int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id);
+int tw_scsiop_synchronize_cache(TW_Device_Extension *tw_dev, int request_id);
int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id);
int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size,
unsigned char *val);
@@ -478,6 +483,40 @@
void tw_unmask_command_interrupt(TW_Device_Extension *tw_dev);
/* Scsi_Host_Template Initializer */
+#ifdef BLK_BOUNCE_HIGH
+#define TWXXXX { \
+ next : NULL, \
+ module : NULL, \
+ proc_name : "3w-xxxx", \
+ proc_info : tw_scsi_proc_info, \
+ name : "3ware Storage Controller", \
+ detect : tw_scsi_detect, \
+ release : tw_scsi_release, \
+ info : NULL, \
+ ioctl : NULL, \
+ command : NULL, \
+ queuecommand : tw_scsi_queue, \
+ eh_strategy_handler : NULL, \
+ eh_abort_handler : tw_scsi_eh_abort, \
+ eh_device_reset_handler : NULL, \
+ eh_bus_reset_handler : NULL, \
+ eh_host_reset_handler : tw_scsi_eh_reset, \
+ abort : NULL, \
+ reset : NULL, \
+ slave_attach : NULL, \
+ bios_param : tw_scsi_biosparam, \
+ can_queue : TW_Q_LENGTH-1, \
+ this_id: -1, \
+ sg_tablesize : TW_MAX_SGL_LENGTH, \
+ cmd_per_lun: TW_MAX_CMDS_PER_LUN, \
+ present : 0, \
+ unchecked_isa_dma : 0, \
+ use_clustering : ENABLE_CLUSTERING, \
+ use_new_eh_code : 1, \
+ emulated : 1, \
+ highmem_io : 1 \
+}
+#else
#define TWXXXX { \
next : NULL, \
module : NULL, \
@@ -509,4 +548,5 @@
use_new_eh_code : 1, \
emulated : 1 \
}
+#endif /* BLK_BOUNCE_HIGH */
#endif /* _3W_XXXX_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)