You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This series consists of the usual driver updates (ufs, ibmvfc, qla2xxx, hisi_sas, pm80xx) plus the removal of the gdth driver (which is bound to cause conflicts with a trivial change somewhere). The only big major rework of note is the one from Hannes trying to clean up our result handling code in the drivers to make it consistent" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (194 commits) scsi: MAINTAINERS: Adjust to reflect gdth scsi driver removal scsi: ufs: Give clk scaling min gear a value scsi: lpfc: Fix 'physical' typos scsi: megaraid_mbox: Fix spelling of 'allocated' scsi: qla2xxx: Simplify the calculation of variables scsi: message: fusion: Fix 'physical' typos scsi: target: core: Change ASCQ for residual write scsi: target: core: Signal WRITE residuals scsi: target: core: Set residuals for 4Kn devices scsi: hisi_sas: Add trace FIFO debugfs support scsi: hisi_sas: Flush workqueue in hisi_sas_v3_remove() scsi: hisi_sas: Enable debugfs support by default scsi: hisi_sas: Don't check .nr_hw_queues in hisi_sas_task_prep() scsi: hisi_sas: Remove deferred probe check in hisi_sas_v2_probe() scsi: lpfc: Add auto select on IRQ_POLL scsi: ncr53c8xx: Fix typos scsi: lpfc: Fix ancient double free scsi: qla2xxx: Fix some memory corruption scsi: qla2xxx: Remove redundant NULL check scsi: megaraid: Fix ifnullfree.cocci warnings ...
This commit is contained in:
@@ -1161,3 +1161,14 @@ Description: This entry shows the configured size of WriteBooster buffer.
|
||||
0400h corresponds to 4GB.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/wb_on
|
||||
Date: January 2021
|
||||
Contact: Bean Huo <beanhuo@micron.com>
|
||||
Description: This node is used to set or display whether UFS WriteBooster is
|
||||
enabled. Echo 0 to this file to disable UFS WriteBooster or 1 to
|
||||
enable it. The WriteBooster is enabled after power-on/reset,
|
||||
however, it will be disabled/enable while CLK scaling down/up
|
||||
(if the platform supports UFSHCD_CAP_CLK_SCALING). For a
|
||||
platform that doesn't support UFSHCD_CAP_CLK_SCALING, we can
|
||||
disable/enable WriteBooster through this sysfs node.
|
||||
|
||||
@@ -461,10 +461,8 @@ more details, with real examples.
|
||||
|
||||
# drivers/scsi/Makefile
|
||||
CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF
|
||||
CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ \
|
||||
-DGDTH_STATISTICS
|
||||
|
||||
These two lines specify compilation flags for aha152x.o and gdth.o.
|
||||
This line specify compilation flags for aha152x.o.
|
||||
|
||||
$(AFLAGS_$@) is a similar feature for source files in assembly
|
||||
languages.
|
||||
|
||||
@@ -99,7 +99,6 @@ USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port ``drivers/usb/se
|
||||
CG_MAGIC 0x00090255 ufs_cylinder_group ``include/linux/ufs_fs.h``
|
||||
RPORT_MAGIC 0x00525001 r_port ``drivers/char/rocket_int.h``
|
||||
LSEMAGIC 0x05091998 lse ``drivers/fc4/fc.c``
|
||||
GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str ``drivers/scsi/gdth_ioctl.h``
|
||||
RIEBL_MAGIC 0x09051990 ``drivers/net/atarilance.c``
|
||||
NBD_REQUEST_MAGIC 0x12560953 nbd_request ``include/linux/nbd.h``
|
||||
RED_MAGIC2 0x170fc2a5 (any) ``mm/slab.c``
|
||||
@@ -142,7 +141,6 @@ PWC_MAGIC 0x89DC10AB pwc_device ``drivers/usb/me
|
||||
NBD_REPLY_MAGIC 0x96744668 nbd_reply ``include/linux/nbd.h``
|
||||
ENI155_MAGIC 0xa54b872d midway_eprom ``drivers/atm/eni.h``
|
||||
CODA_MAGIC 0xC0DAC0DA coda_file_info ``fs/coda/coda_fs_i.h``
|
||||
DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram ``drivers/scsi/gdth.h``
|
||||
YAM_MAGIC 0xF10A7654 yam_port ``drivers/net/hamradio/yam.c``
|
||||
CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c``
|
||||
QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c``
|
||||
|
||||
@@ -189,13 +189,8 @@ num_phys
|
||||
The event interface::
|
||||
|
||||
/* LLDD calls these to notify the class of an event. */
|
||||
void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event);
|
||||
void (*notify_port_event)(struct sas_phy *, enum port_event);
|
||||
void (*notify_phy_event)(struct sas_phy *, enum phy_event);
|
||||
|
||||
When sas_register_ha() returns, those are set and can be
|
||||
called by the LLDD to notify the SAS layer of such events
|
||||
the SAS layer.
|
||||
void sas_notify_port_event(struct sas_phy *, enum port_event, gfp_t);
|
||||
void sas_notify_phy_event(struct sas_phy *, enum phy_event, gfp_t);
|
||||
|
||||
The port notification::
|
||||
|
||||
|
||||
@@ -38,9 +38,6 @@ parameters may be changed at runtime by the command
|
||||
See drivers/scsi/BusLogic.c, comment before function
|
||||
BusLogic_ParseDriverOptions().
|
||||
|
||||
gdth= [HW,SCSI]
|
||||
See header of drivers/scsi/gdth.c.
|
||||
|
||||
gvp11= [HW,SCSI]
|
||||
|
||||
ips= [HW,SCSI] Adaptec / IBM ServeRAID controller
|
||||
|
||||
@@ -157,7 +157,6 @@ Code Seq# Include File Comments
|
||||
'I' all linux/isdn.h conflict!
|
||||
'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
|
||||
'I' 40-4F linux/mISDNif.h conflict!
|
||||
'J' 00-1F drivers/scsi/gdth_ioctl.h
|
||||
'K' all linux/kd.h
|
||||
'L' 00-1F linux/loop.h conflict!
|
||||
'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
|
||||
|
||||
@@ -7363,13 +7363,6 @@ M: Kieran Bingham <kbingham@kernel.org>
|
||||
S: Supported
|
||||
F: scripts/gdb/
|
||||
|
||||
GDT SCSI DISK ARRAY CONTROLLER DRIVER
|
||||
M: Achim Leubner <achim_leubner@adaptec.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Supported
|
||||
W: http://www.icp-vortex.com/
|
||||
F: drivers/scsi/gdt*
|
||||
|
||||
GEMTEK FM RADIO RECEIVER DRIVER
|
||||
M: Hans Verkuil <hverkuil@xs4all.nl>
|
||||
L: linux-media@vger.kernel.org
|
||||
@@ -8864,7 +8857,6 @@ F: drivers/mfd/intel_pmc_bxt.c
|
||||
F: include/linux/mfd/intel_pmc_bxt.h
|
||||
|
||||
INTEL C600 SERIES SAS CONTROLLER DRIVER
|
||||
M: Intel SCU Linux support <intel-linux-scu@intel.com>
|
||||
M: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Supported
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
* define.
|
||||
* Added BIOS Page 4 structure.
|
||||
* Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID
|
||||
* Physcial Disk Page 1.
|
||||
* Physical Disk Page 1.
|
||||
* 01-15-07 01.05.17 Added additional bit defines for ExtFlags field of
|
||||
* Manufacturing Page 4.
|
||||
* Added Solid State Drives Supported bit to IOC Page 6
|
||||
|
||||
@@ -513,7 +513,7 @@ mpi_cnfg.h
|
||||
* define.
|
||||
* Added BIOS Page 4 structure.
|
||||
* Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID
|
||||
* Physcial Disk Page 1.
|
||||
* Physical Disk Page 1.
|
||||
* 01-15-07 01.05.17 Added additional bit defines for ExtFlags field of
|
||||
* Manufacturing Page 4.
|
||||
* Added Solid State Drives Supported bit to IOC Page 6
|
||||
|
||||
@@ -275,7 +275,6 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_resp_with_ext *fcp_rsp,
|
||||
u32 sense_len, resid;
|
||||
u8 rsp_flags;
|
||||
|
||||
set_msg_byte(scsi, COMMAND_COMPLETE);
|
||||
scsi->result |= fcp_rsp->resp.fr_status;
|
||||
|
||||
rsp_flags = fcp_rsp->resp.fr_flags;
|
||||
|
||||
@@ -128,14 +128,14 @@ static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_
|
||||
static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
|
||||
static void twa_get_request_id(TW_Device_Extension *tw_dev, int *request_id);
|
||||
static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
u32 set_features, unsigned short current_fw_srl,
|
||||
unsigned short current_fw_arch_id,
|
||||
unsigned short current_fw_branch,
|
||||
unsigned short current_fw_build,
|
||||
unsigned short *fw_on_ctlr_srl,
|
||||
unsigned short *fw_on_ctlr_arch_id,
|
||||
unsigned short *fw_on_ctlr_branch,
|
||||
unsigned short *fw_on_ctlr_build,
|
||||
u32 set_features, unsigned short current_fw_srl,
|
||||
unsigned short current_fw_arch_id,
|
||||
unsigned short current_fw_branch,
|
||||
unsigned short current_fw_build,
|
||||
unsigned short *fw_on_ctlr_srl,
|
||||
unsigned short *fw_on_ctlr_arch_id,
|
||||
unsigned short *fw_on_ctlr_branch,
|
||||
unsigned short *fw_on_ctlr_build,
|
||||
u32 *init_connect_result);
|
||||
static void twa_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_command_packet, int request_id, dma_addr_t dma_handle, int length);
|
||||
static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds);
|
||||
@@ -171,7 +171,7 @@ static ssize_t twa_show_stats(struct device *dev,
|
||||
"Last sector count: %4d\n"
|
||||
"Max sector count: %4d\n"
|
||||
"SCSI Host Resets: %4d\n"
|
||||
"AEN's: %4d\n",
|
||||
"AEN's: %4d\n",
|
||||
TW_DRIVER_VERSION,
|
||||
tw_dev->posted_request_count,
|
||||
tw_dev->max_posted_request_count,
|
||||
@@ -190,7 +190,7 @@ static ssize_t twa_show_stats(struct device *dev,
|
||||
/* Create sysfs 'stats' entry */
|
||||
static struct device_attribute twa_host_stats_attr = {
|
||||
.attr = {
|
||||
.name = "stats",
|
||||
.name = "stats",
|
||||
.mode = S_IRUGO,
|
||||
},
|
||||
.show = twa_show_stats
|
||||
@@ -242,7 +242,7 @@ static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id)
|
||||
/* Keep reading the queue in case there are more aen's */
|
||||
if (twa_aen_read_queue(tw_dev, request_id))
|
||||
goto out2;
|
||||
else {
|
||||
else {
|
||||
retval = 0;
|
||||
goto out;
|
||||
}
|
||||
@@ -497,7 +497,7 @@ static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id)
|
||||
param->parameter_id = cpu_to_le16(0x3); /* SchedulerTime */
|
||||
param->parameter_size_bytes = cpu_to_le16(4);
|
||||
|
||||
/* Convert system time in UTC to local time seconds since last
|
||||
/* Convert system time in UTC to local time seconds since last
|
||||
Sunday 12:00AM */
|
||||
local_time = (ktime_get_real_seconds() - (sys_tz.tz_minuteswest * 60));
|
||||
div_u64_rem(local_time - (3 * 86400), 604800, &schedulertime);
|
||||
@@ -729,7 +729,7 @@ static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long
|
||||
|
||||
/* Now copy in the command packet response */
|
||||
memcpy(&(tw_ioctl->firmware_command), tw_dev->command_packet_virt[request_id], sizeof(TW_Command_Full));
|
||||
|
||||
|
||||
/* Now complete the io */
|
||||
spin_lock_irqsave(tw_dev->host->host_lock, flags);
|
||||
tw_dev->posted_request_count--;
|
||||
@@ -766,7 +766,7 @@ static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long
|
||||
if (tw_dev->aen_clobber) {
|
||||
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_AEN_CLOBBER;
|
||||
tw_dev->aen_clobber = 0;
|
||||
} else
|
||||
} else
|
||||
tw_ioctl->driver_command.status = 0;
|
||||
event_index = tw_dev->error_index;
|
||||
} else {
|
||||
@@ -1067,8 +1067,8 @@ static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int tabl
|
||||
command_packet = &full_command_packet->command.oldcommand;
|
||||
|
||||
command_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);
|
||||
command_packet->size = TW_COMMAND_SIZE;
|
||||
command_packet->request_id = request_id;
|
||||
command_packet->size = TW_COMMAND_SIZE;
|
||||
command_packet->request_id = request_id;
|
||||
command_packet->byte6_offset.block_count = cpu_to_le16(1);
|
||||
|
||||
/* Now setup the param */
|
||||
@@ -1106,14 +1106,14 @@ static void twa_get_request_id(TW_Device_Extension *tw_dev, int *request_id)
|
||||
|
||||
/* This function will send an initconnection command to controller */
|
||||
static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
u32 set_features, unsigned short current_fw_srl,
|
||||
unsigned short current_fw_arch_id,
|
||||
unsigned short current_fw_branch,
|
||||
unsigned short current_fw_build,
|
||||
unsigned short *fw_on_ctlr_srl,
|
||||
unsigned short *fw_on_ctlr_arch_id,
|
||||
unsigned short *fw_on_ctlr_branch,
|
||||
unsigned short *fw_on_ctlr_build,
|
||||
u32 set_features, unsigned short current_fw_srl,
|
||||
unsigned short current_fw_arch_id,
|
||||
unsigned short current_fw_branch,
|
||||
unsigned short current_fw_build,
|
||||
unsigned short *fw_on_ctlr_srl,
|
||||
unsigned short *fw_on_ctlr_arch_id,
|
||||
unsigned short *fw_on_ctlr_branch,
|
||||
unsigned short *fw_on_ctlr_build,
|
||||
u32 *init_connect_result)
|
||||
{
|
||||
TW_Command_Full *full_command_packet;
|
||||
@@ -1124,7 +1124,7 @@ static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
full_command_packet = tw_dev->command_packet_virt[request_id];
|
||||
memset(full_command_packet, 0, sizeof(TW_Command_Full));
|
||||
full_command_packet->header.header_desc.size_header = 128;
|
||||
|
||||
|
||||
tw_initconnect = (TW_Initconnect *)&full_command_packet->command.oldcommand;
|
||||
tw_initconnect->opcode__reserved = TW_OPRES_IN(0, TW_OP_INIT_CONNECTION);
|
||||
tw_initconnect->request_id = request_id;
|
||||
@@ -1142,7 +1142,7 @@ static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
tw_initconnect->fw_arch_id = cpu_to_le16(current_fw_arch_id);
|
||||
tw_initconnect->fw_branch = cpu_to_le16(current_fw_branch);
|
||||
tw_initconnect->fw_build = cpu_to_le16(current_fw_build);
|
||||
} else
|
||||
} else
|
||||
tw_initconnect->size = TW_INIT_COMMAND_PACKET_SIZE;
|
||||
|
||||
/* Send command packet to the board */
|
||||
@@ -1455,7 +1455,7 @@ out:
|
||||
/* This function will poll the status register for a flag */
|
||||
static int twa_poll_status(TW_Device_Extension *tw_dev, u32 flag, int seconds)
|
||||
{
|
||||
u32 status_reg_value;
|
||||
u32 status_reg_value;
|
||||
unsigned long before;
|
||||
int retval = 1;
|
||||
|
||||
@@ -1770,7 +1770,7 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_
|
||||
|
||||
/* Save done function into scsi_cmnd struct */
|
||||
SCpnt->scsi_done = done;
|
||||
|
||||
|
||||
/* Get a free request id */
|
||||
twa_get_request_id(tw_dev, &request_id);
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
|
||||
/* AEN string type */
|
||||
typedef struct TAG_twa_message_type {
|
||||
unsigned int code;
|
||||
char* text;
|
||||
unsigned int code;
|
||||
char* text;
|
||||
} twa_message_type;
|
||||
|
||||
/* AEN strings */
|
||||
@@ -263,9 +263,9 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_CONTROL_ENABLE_INTERRUPTS 0x00000080
|
||||
#define TW_CONTROL_DISABLE_INTERRUPTS 0x00000040
|
||||
#define TW_CONTROL_ISSUE_HOST_INTERRUPT 0x00000020
|
||||
#define TW_CONTROL_CLEAR_PARITY_ERROR 0x00800000
|
||||
#define TW_CONTROL_CLEAR_QUEUE_ERROR 0x00400000
|
||||
#define TW_CONTROL_CLEAR_PCI_ABORT 0x00100000
|
||||
#define TW_CONTROL_CLEAR_PARITY_ERROR 0x00800000
|
||||
#define TW_CONTROL_CLEAR_QUEUE_ERROR 0x00400000
|
||||
#define TW_CONTROL_CLEAR_PCI_ABORT 0x00100000
|
||||
|
||||
/* Status register bit definitions */
|
||||
#define TW_STATUS_MAJOR_VERSION_MASK 0xF0000000
|
||||
@@ -284,25 +284,25 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_STATUS_COMMAND_QUEUE_EMPTY 0x00001000
|
||||
#define TW_STATUS_EXPECTED_BITS 0x00002000
|
||||
#define TW_STATUS_UNEXPECTED_BITS 0x00F00000
|
||||
#define TW_STATUS_VALID_INTERRUPT 0x00DF0000
|
||||
#define TW_STATUS_VALID_INTERRUPT 0x00DF0000
|
||||
|
||||
/* PCI related defines */
|
||||
#define TW_PCI_CLEAR_PARITY_ERRORS 0xc100
|
||||
#define TW_PCI_CLEAR_PCI_ABORT 0x2000
|
||||
|
||||
/* Command packet opcodes used by the driver */
|
||||
#define TW_OP_INIT_CONNECTION 0x1
|
||||
#define TW_OP_GET_PARAM 0x12
|
||||
#define TW_OP_SET_PARAM 0x13
|
||||
#define TW_OP_EXECUTE_SCSI 0x10
|
||||
#define TW_OP_INIT_CONNECTION 0x1
|
||||
#define TW_OP_GET_PARAM 0x12
|
||||
#define TW_OP_SET_PARAM 0x13
|
||||
#define TW_OP_EXECUTE_SCSI 0x10
|
||||
#define TW_OP_DOWNLOAD_FIRMWARE 0x16
|
||||
#define TW_OP_RESET 0x1C
|
||||
#define TW_OP_RESET 0x1C
|
||||
|
||||
/* Asynchronous Event Notification (AEN) codes used by the driver */
|
||||
#define TW_AEN_QUEUE_EMPTY 0x0000
|
||||
#define TW_AEN_SOFT_RESET 0x0001
|
||||
#define TW_AEN_QUEUE_EMPTY 0x0000
|
||||
#define TW_AEN_SOFT_RESET 0x0001
|
||||
#define TW_AEN_SYNC_TIME_WITH_HOST 0x031
|
||||
#define TW_AEN_SEVERITY_ERROR 0x1
|
||||
#define TW_AEN_SEVERITY_ERROR 0x1
|
||||
#define TW_AEN_SEVERITY_DEBUG 0x4
|
||||
#define TW_AEN_NOT_RETRIEVED 0x1
|
||||
#define TW_AEN_RETRIEVED 0x2
|
||||
@@ -323,9 +323,9 @@ static twa_message_type twa_error_table[] = {
|
||||
|
||||
/* Misc defines */
|
||||
#define TW_9550SX_DRAIN_COMPLETED 0xFFFF
|
||||
#define TW_SECTOR_SIZE 512
|
||||
#define TW_ALIGNMENT_9000 4 /* 4 bytes */
|
||||
#define TW_ALIGNMENT_9000_SGL 0x3
|
||||
#define TW_SECTOR_SIZE 512
|
||||
#define TW_ALIGNMENT_9000 4 /* 4 bytes */
|
||||
#define TW_ALIGNMENT_9000_SGL 0x3
|
||||
#define TW_MAX_UNITS 16
|
||||
#define TW_MAX_UNITS_9650SE 32
|
||||
#define TW_INIT_MESSAGE_CREDITS 0x100
|
||||
@@ -338,7 +338,7 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_BASE_FW_SRL 24
|
||||
#define TW_BASE_FW_BRANCH 0
|
||||
#define TW_BASE_FW_BUILD 1
|
||||
#define TW_FW_SRL_LUNS_SUPPORTED 28
|
||||
#define TW_FW_SRL_LUNS_SUPPORTED 28
|
||||
#define TW_Q_LENGTH 256
|
||||
#define TW_Q_START 0
|
||||
#define TW_MAX_SLOT 32
|
||||
@@ -346,19 +346,19 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_MAX_CMDS_PER_LUN 254
|
||||
#define TW_MAX_RESPONSE_DRAIN 256
|
||||
#define TW_MAX_AEN_DRAIN 255
|
||||
#define TW_IN_RESET 2
|
||||
#define TW_IN_RESET 2
|
||||
#define TW_USING_MSI 3
|
||||
#define TW_IN_ATTENTION_LOOP 4
|
||||
#define TW_MAX_SECTORS 256
|
||||
#define TW_AEN_WAIT_TIME 1000
|
||||
#define TW_IOCTL_WAIT_TIME (1 * HZ) /* 1 second */
|
||||
#define TW_MAX_CDB_LEN 16
|
||||
#define TW_ISR_DONT_COMPLETE 2
|
||||
#define TW_ISR_DONT_RESULT 3
|
||||
#define TW_IOCTL_CHRDEV_TIMEOUT 60 /* 60 seconds */
|
||||
#define TW_IOCTL_CHRDEV_FREE -1
|
||||
#define TW_COMMAND_OFFSET 128 /* 128 bytes */
|
||||
#define TW_VERSION_TABLE 0x0402
|
||||
#define TW_MAX_SECTORS 256
|
||||
#define TW_AEN_WAIT_TIME 1000
|
||||
#define TW_IOCTL_WAIT_TIME (1 * HZ) /* 1 second */
|
||||
#define TW_MAX_CDB_LEN 16
|
||||
#define TW_ISR_DONT_COMPLETE 2
|
||||
#define TW_ISR_DONT_RESULT 3
|
||||
#define TW_IOCTL_CHRDEV_TIMEOUT 60 /* 60 seconds */
|
||||
#define TW_IOCTL_CHRDEV_FREE -1
|
||||
#define TW_COMMAND_OFFSET 128 /* 128 bytes */
|
||||
#define TW_VERSION_TABLE 0x0402
|
||||
#define TW_TIMEKEEP_TABLE 0x040A
|
||||
#define TW_INFORMATION_TABLE 0x0403
|
||||
#define TW_PARAM_FWVER 3
|
||||
@@ -367,22 +367,22 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_PARAM_BIOSVER_LENGTH 16
|
||||
#define TW_PARAM_PORTCOUNT 3
|
||||
#define TW_PARAM_PORTCOUNT_LENGTH 1
|
||||
#define TW_MIN_SGL_LENGTH 0x200 /* 512 bytes */
|
||||
#define TW_MAX_SENSE_LENGTH 256
|
||||
#define TW_EVENT_SOURCE_AEN 0x1000
|
||||
#define TW_EVENT_SOURCE_COMMAND 0x1001
|
||||
#define TW_EVENT_SOURCE_PCHIP 0x1002
|
||||
#define TW_EVENT_SOURCE_DRIVER 0x1003
|
||||
#define TW_MIN_SGL_LENGTH 0x200 /* 512 bytes */
|
||||
#define TW_MAX_SENSE_LENGTH 256
|
||||
#define TW_EVENT_SOURCE_AEN 0x1000
|
||||
#define TW_EVENT_SOURCE_COMMAND 0x1001
|
||||
#define TW_EVENT_SOURCE_PCHIP 0x1002
|
||||
#define TW_EVENT_SOURCE_DRIVER 0x1003
|
||||
#define TW_IOCTL_GET_COMPATIBILITY_INFO 0x101
|
||||
#define TW_IOCTL_GET_LAST_EVENT 0x102
|
||||
#define TW_IOCTL_GET_FIRST_EVENT 0x103
|
||||
#define TW_IOCTL_GET_NEXT_EVENT 0x104
|
||||
#define TW_IOCTL_GET_PREVIOUS_EVENT 0x105
|
||||
#define TW_IOCTL_GET_LOCK 0x106
|
||||
#define TW_IOCTL_RELEASE_LOCK 0x107
|
||||
#define TW_IOCTL_FIRMWARE_PASS_THROUGH 0x108
|
||||
#define TW_IOCTL_GET_LAST_EVENT 0x102
|
||||
#define TW_IOCTL_GET_FIRST_EVENT 0x103
|
||||
#define TW_IOCTL_GET_NEXT_EVENT 0x104
|
||||
#define TW_IOCTL_GET_PREVIOUS_EVENT 0x105
|
||||
#define TW_IOCTL_GET_LOCK 0x106
|
||||
#define TW_IOCTL_RELEASE_LOCK 0x107
|
||||
#define TW_IOCTL_FIRMWARE_PASS_THROUGH 0x108
|
||||
#define TW_IOCTL_ERROR_STATUS_NOT_LOCKED 0x1001 // Not locked
|
||||
#define TW_IOCTL_ERROR_STATUS_LOCKED 0x1002 // Already locked
|
||||
#define TW_IOCTL_ERROR_STATUS_LOCKED 0x1002 // Already locked
|
||||
#define TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS 0x1003 // No more events
|
||||
#define TW_IOCTL_ERROR_STATUS_AEN_CLOBBER 0x1004 // AEN clobber occurred
|
||||
#define TW_IOCTL_ERROR_OS_EFAULT -EFAULT // Bad address
|
||||
@@ -397,12 +397,12 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_SENSE_DATA_LENGTH 18
|
||||
#define TW_STATUS_CHECK_CONDITION 2
|
||||
#define TW_ERROR_LOGICAL_UNIT_NOT_SUPPORTED 0x10a
|
||||
#define TW_ERROR_UNIT_OFFLINE 0x128
|
||||
#define TW_ERROR_UNIT_OFFLINE 0x128
|
||||
#define TW_MESSAGE_SOURCE_CONTROLLER_ERROR 3
|
||||
#define TW_MESSAGE_SOURCE_CONTROLLER_EVENT 4
|
||||
#define TW_MESSAGE_SOURCE_LINUX_DRIVER 6
|
||||
#define TW_MESSAGE_SOURCE_LINUX_DRIVER 6
|
||||
#define TW_DRIVER TW_MESSAGE_SOURCE_LINUX_DRIVER
|
||||
#define TW_MESSAGE_SOURCE_LINUX_OS 9
|
||||
#define TW_MESSAGE_SOURCE_LINUX_OS 9
|
||||
#define TW_OS TW_MESSAGE_SOURCE_LINUX_OS
|
||||
#ifndef PCI_DEVICE_ID_3WARE_9000
|
||||
#define PCI_DEVICE_ID_3WARE_9000 0x1002
|
||||
@@ -434,24 +434,38 @@ static twa_message_type twa_error_table[] = {
|
||||
#define TW_RESID_OUT(x) ((x >> 4) & 0xff)
|
||||
|
||||
/* request_id: 12, lun: 4 */
|
||||
#define TW_REQ_LUN_IN(lun, request_id) (((lun << 12) & 0xf000) | (request_id & 0xfff))
|
||||
#define TW_REQ_LUN_IN(lun, request_id) \
|
||||
(((lun << 12) & 0xf000) | (request_id & 0xfff))
|
||||
#define TW_LUN_OUT(lun) ((lun >> 12) & 0xf)
|
||||
|
||||
/* Macros */
|
||||
#define TW_CONTROL_REG_ADDR(x) (x->base_addr)
|
||||
#define TW_STATUS_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + 0x4)
|
||||
#define TW_COMMAND_QUEUE_REG_ADDR(x) (sizeof(dma_addr_t) > 4 ? ((unsigned char __iomem *)x->base_addr + 0x20) : ((unsigned char __iomem *)x->base_addr + 0x8))
|
||||
#define TW_COMMAND_QUEUE_REG_ADDR_LARGE(x) ((unsigned char __iomem *)x->base_addr + 0x20)
|
||||
#define TW_RESPONSE_QUEUE_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + 0xC)
|
||||
#define TW_RESPONSE_QUEUE_REG_ADDR_LARGE(x) ((unsigned char __iomem *)x->base_addr + 0x30)
|
||||
#define TW_CLEAR_ALL_INTERRUPTS(x) (writel(TW_STATUS_VALID_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_ATTENTION_INTERRUPT(x) (writel(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_HOST_INTERRUPT(x) (writel(TW_CONTROL_CLEAR_HOST_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_DISABLE_INTERRUPTS(x) (writel(TW_CONTROL_DISABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_ENABLE_AND_CLEAR_INTERRUPTS(x) (writel(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | TW_CONTROL_UNMASK_RESPONSE_INTERRUPT | TW_CONTROL_ENABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_MASK_COMMAND_INTERRUPT(x) (writel(TW_CONTROL_MASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_UNMASK_COMMAND_INTERRUPT(x) (writel(TW_CONTROL_UNMASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_SOFT_RESET(x) (writel(TW_CONTROL_ISSUE_SOFT_RESET | \
|
||||
#define TW_COMMAND_QUEUE_REG_ADDR(x) \
|
||||
(sizeof(dma_addr_t) > 4 ? ((unsigned char __iomem *)x->base_addr + 0x20) : ((unsigned char __iomem *)x->base_addr + 0x8))
|
||||
#define TW_COMMAND_QUEUE_REG_ADDR_LARGE(x) \
|
||||
((unsigned char __iomem *)x->base_addr + 0x20)
|
||||
#define TW_RESPONSE_QUEUE_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + 0xC)
|
||||
#define TW_RESPONSE_QUEUE_REG_ADDR_LARGE(x) \
|
||||
((unsigned char __iomem *)x->base_addr + 0x30)
|
||||
#define TW_CLEAR_ALL_INTERRUPTS(x) \
|
||||
(writel(TW_STATUS_VALID_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_ATTENTION_INTERRUPT(x) \
|
||||
(writel(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_HOST_INTERRUPT(x) \
|
||||
(writel(TW_CONTROL_CLEAR_HOST_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_DISABLE_INTERRUPTS(x) \
|
||||
(writel(TW_CONTROL_DISABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_ENABLE_AND_CLEAR_INTERRUPTS(x) \
|
||||
(writel(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | \
|
||||
TW_CONTROL_UNMASK_RESPONSE_INTERRUPT | \
|
||||
TW_CONTROL_ENABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_MASK_COMMAND_INTERRUPT(x) \
|
||||
(writel(TW_CONTROL_MASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_UNMASK_COMMAND_INTERRUPT(x) \
|
||||
(writel(TW_CONTROL_UNMASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_SOFT_RESET(x) (writel(TW_CONTROL_ISSUE_SOFT_RESET | \
|
||||
TW_CONTROL_CLEAR_HOST_INTERRUPT | \
|
||||
TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | \
|
||||
TW_CONTROL_MASK_COMMAND_INTERRUPT | \
|
||||
@@ -586,7 +600,7 @@ typedef struct TAG_TW_Ioctl_Driver_Command {
|
||||
|
||||
typedef struct TAG_TW_Ioctl_Apache {
|
||||
TW_Ioctl_Driver_Command driver_command;
|
||||
char padding[488];
|
||||
char padding[488];
|
||||
TW_Command_Full firmware_command;
|
||||
char data_buffer[1];
|
||||
} TW_Ioctl_Buf_Apache;
|
||||
@@ -634,10 +648,10 @@ typedef struct TAG_TW_Compatibility_Info
|
||||
#pragma pack()
|
||||
|
||||
typedef struct TAG_TW_Device_Extension {
|
||||
u32 __iomem *base_addr;
|
||||
unsigned long *generic_buffer_virt[TW_Q_LENGTH];
|
||||
dma_addr_t generic_buffer_phys[TW_Q_LENGTH];
|
||||
TW_Command_Full *command_packet_virt[TW_Q_LENGTH];
|
||||
u32 __iomem *base_addr;
|
||||
unsigned long *generic_buffer_virt[TW_Q_LENGTH];
|
||||
dma_addr_t generic_buffer_phys[TW_Q_LENGTH];
|
||||
TW_Command_Full *command_packet_virt[TW_Q_LENGTH];
|
||||
dma_addr_t command_packet_phys[TW_Q_LENGTH];
|
||||
struct pci_dev *tw_pci_dev;
|
||||
struct scsi_cmnd *srb[TW_Q_LENGTH];
|
||||
@@ -647,10 +661,10 @@ typedef struct TAG_TW_Device_Extension {
|
||||
unsigned char pending_queue[TW_Q_LENGTH];
|
||||
unsigned char pending_head;
|
||||
unsigned char pending_tail;
|
||||
int state[TW_Q_LENGTH];
|
||||
int state[TW_Q_LENGTH];
|
||||
unsigned int posted_request_count;
|
||||
unsigned int max_posted_request_count;
|
||||
unsigned int pending_request_count;
|
||||
unsigned int pending_request_count;
|
||||
unsigned int max_pending_request_count;
|
||||
unsigned int max_sgl_entries;
|
||||
unsigned int sgl_entries;
|
||||
@@ -661,12 +675,12 @@ typedef struct TAG_TW_Device_Extension {
|
||||
struct Scsi_Host *host;
|
||||
long flags;
|
||||
int reset_print;
|
||||
TW_Event *event_queue[TW_Q_LENGTH];
|
||||
unsigned char error_index;
|
||||
TW_Event *event_queue[TW_Q_LENGTH];
|
||||
unsigned char error_index;
|
||||
unsigned char event_queue_wrapped;
|
||||
unsigned int error_sequence_id;
|
||||
int ioctl_sem_lock;
|
||||
ktime_t ioctl_time;
|
||||
unsigned int error_sequence_id;
|
||||
int ioctl_sem_lock;
|
||||
ktime_t ioctl_time;
|
||||
int chrdev_request_id;
|
||||
wait_queue_head_t ioctl_wqueue;
|
||||
struct mutex ioctl_lock;
|
||||
|
||||
@@ -120,7 +120,7 @@ static struct bin_attribute twl_sysfs_aen_read_attr = {
|
||||
.attr = {
|
||||
.name = "3ware_aen_read",
|
||||
.mode = S_IRUSR,
|
||||
},
|
||||
},
|
||||
.size = 0,
|
||||
.read = twl_sysfs_aen_read
|
||||
};
|
||||
@@ -151,7 +151,7 @@ static struct bin_attribute twl_sysfs_compat_info_attr = {
|
||||
.attr = {
|
||||
.name = "3ware_compat_info",
|
||||
.mode = S_IRUSR,
|
||||
},
|
||||
},
|
||||
.size = 0,
|
||||
.read = twl_sysfs_compat_info
|
||||
};
|
||||
@@ -174,7 +174,7 @@ static ssize_t twl_show_stats(struct device *dev,
|
||||
"Last sector count: %4d\n"
|
||||
"Max sector count: %4d\n"
|
||||
"SCSI Host Resets: %4d\n"
|
||||
"AEN's: %4d\n",
|
||||
"AEN's: %4d\n",
|
||||
TW_DRIVER_VERSION,
|
||||
tw_dev->posted_request_count,
|
||||
tw_dev->max_posted_request_count,
|
||||
@@ -191,7 +191,7 @@ static ssize_t twl_show_stats(struct device *dev,
|
||||
/* stats sysfs attribute initializer */
|
||||
static struct device_attribute twl_host_stats_attr = {
|
||||
.attr = {
|
||||
.name = "3ware_stats",
|
||||
.name = "3ware_stats",
|
||||
.mode = S_IRUGO,
|
||||
},
|
||||
.show = twl_show_stats
|
||||
@@ -432,7 +432,7 @@ static void twl_aen_sync_time(TW_Device_Extension *tw_dev, int request_id)
|
||||
param->parameter_id = cpu_to_le16(0x3); /* SchedulerTime */
|
||||
param->parameter_size_bytes = cpu_to_le16(4);
|
||||
|
||||
/* Convert system time in UTC to local time seconds since last
|
||||
/* Convert system time in UTC to local time seconds since last
|
||||
Sunday 12:00AM */
|
||||
local_time = (ktime_get_real_seconds() - (sys_tz.tz_minuteswest * 60));
|
||||
div_u64_rem(local_time - (3 * 86400), 604800, &schedulertime);
|
||||
@@ -483,7 +483,7 @@ static int twl_aen_complete(TW_Device_Extension *tw_dev, int request_id)
|
||||
/* Keep reading the queue in case there are more aen's */
|
||||
if (twl_aen_read_queue(tw_dev, request_id))
|
||||
goto out2;
|
||||
else {
|
||||
else {
|
||||
retval = 0;
|
||||
goto out;
|
||||
}
|
||||
@@ -548,7 +548,7 @@ static int twl_poll_response(TW_Device_Extension *tw_dev, int request_id, int se
|
||||
msleep(50);
|
||||
}
|
||||
retval = 0;
|
||||
out:
|
||||
out:
|
||||
return retval;
|
||||
} /* End twl_poll_response() */
|
||||
|
||||
@@ -802,7 +802,7 @@ static long twl_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long
|
||||
|
||||
/* Now copy in the command packet response */
|
||||
memcpy(&(tw_ioctl->firmware_command), tw_dev->command_packet_virt[request_id], sizeof(TW_Command_Full));
|
||||
|
||||
|
||||
/* Now complete the io */
|
||||
spin_lock_irqsave(tw_dev->host->host_lock, flags);
|
||||
tw_dev->posted_request_count--;
|
||||
@@ -879,7 +879,7 @@ static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, in
|
||||
tw_dev->host->host_no,
|
||||
TW_MESSAGE_SOURCE_CONTROLLER_ERROR,
|
||||
header->status_block.error,
|
||||
error_str,
|
||||
error_str,
|
||||
header->err_specific_desc);
|
||||
else
|
||||
printk(KERN_WARNING "3w-sas: ERROR: (0x%02X:0x%04X): %s:%s.\n",
|
||||
@@ -937,8 +937,8 @@ static void *twl_get_param(TW_Device_Extension *tw_dev, int request_id, int tabl
|
||||
command_packet = &full_command_packet->command.oldcommand;
|
||||
|
||||
command_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);
|
||||
command_packet->size = TW_COMMAND_SIZE;
|
||||
command_packet->request_id = request_id;
|
||||
command_packet->size = TW_COMMAND_SIZE;
|
||||
command_packet->request_id = request_id;
|
||||
command_packet->byte6_offset.block_count = cpu_to_le16(1);
|
||||
|
||||
/* Now setup the param */
|
||||
@@ -968,14 +968,14 @@ static void *twl_get_param(TW_Device_Extension *tw_dev, int request_id, int tabl
|
||||
|
||||
/* This function will send an initconnection command to controller */
|
||||
static int twl_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
u32 set_features, unsigned short current_fw_srl,
|
||||
unsigned short current_fw_arch_id,
|
||||
unsigned short current_fw_branch,
|
||||
unsigned short current_fw_build,
|
||||
unsigned short *fw_on_ctlr_srl,
|
||||
unsigned short *fw_on_ctlr_arch_id,
|
||||
unsigned short *fw_on_ctlr_branch,
|
||||
unsigned short *fw_on_ctlr_build,
|
||||
u32 set_features, unsigned short current_fw_srl,
|
||||
unsigned short current_fw_arch_id,
|
||||
unsigned short current_fw_branch,
|
||||
unsigned short current_fw_build,
|
||||
unsigned short *fw_on_ctlr_srl,
|
||||
unsigned short *fw_on_ctlr_arch_id,
|
||||
unsigned short *fw_on_ctlr_branch,
|
||||
unsigned short *fw_on_ctlr_build,
|
||||
u32 *init_connect_result)
|
||||
{
|
||||
TW_Command_Full *full_command_packet;
|
||||
@@ -986,7 +986,7 @@ static int twl_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
full_command_packet = tw_dev->command_packet_virt[request_id];
|
||||
memset(full_command_packet, 0, sizeof(TW_Command_Full));
|
||||
full_command_packet->header.header_desc.size_header = 128;
|
||||
|
||||
|
||||
tw_initconnect = (TW_Initconnect *)&full_command_packet->command.oldcommand;
|
||||
tw_initconnect->opcode__reserved = TW_OPRES_IN(0, TW_OP_INIT_CONNECTION);
|
||||
tw_initconnect->request_id = request_id;
|
||||
@@ -1004,7 +1004,7 @@ static int twl_initconnection(TW_Device_Extension *tw_dev, int message_credits,
|
||||
tw_initconnect->fw_arch_id = cpu_to_le16(current_fw_arch_id);
|
||||
tw_initconnect->fw_branch = cpu_to_le16(current_fw_branch);
|
||||
tw_initconnect->fw_build = cpu_to_le16(current_fw_build);
|
||||
} else
|
||||
} else
|
||||
tw_initconnect->size = TW_INIT_COMMAND_PACKET_SIZE;
|
||||
|
||||
/* Send command packet to the board */
|
||||
@@ -1211,7 +1211,7 @@ static irqreturn_t twl_interrupt(int irq, void *dev_instance)
|
||||
|
||||
if (!error)
|
||||
cmd->result = (DID_OK << 16);
|
||||
|
||||
|
||||
/* Report residual bytes for single sgl */
|
||||
if ((scsi_sg_count(cmd) <= 1) && (full_command_packet->command.newcommand.status == 0)) {
|
||||
if (full_command_packet->command.newcommand.sg_list[0].length < scsi_bufflen(tw_dev->srb[request_id]))
|
||||
@@ -1245,7 +1245,7 @@ static int twl_poll_register(TW_Device_Extension *tw_dev, void *reg, u32 value,
|
||||
reg_value = readl(reg);
|
||||
before = jiffies;
|
||||
|
||||
while ((reg_value & value) != result) {
|
||||
while ((reg_value & value) != result) {
|
||||
reg_value = readl(reg);
|
||||
if (time_after(jiffies, before + HZ * seconds))
|
||||
goto out;
|
||||
@@ -1470,7 +1470,7 @@ static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_
|
||||
|
||||
/* Save done function into scsi_cmnd struct */
|
||||
SCpnt->scsi_done = done;
|
||||
|
||||
|
||||
/* Get a free request id */
|
||||
twl_get_request_id(tw_dev, &request_id);
|
||||
|
||||
@@ -1524,7 +1524,7 @@ static void twl_shutdown(struct pci_dev *pdev)
|
||||
|
||||
tw_dev = (TW_Device_Extension *)host->hostdata;
|
||||
|
||||
if (tw_dev->online)
|
||||
if (tw_dev->online)
|
||||
__twl_shutdown(tw_dev);
|
||||
} /* End twl_shutdown() */
|
||||
|
||||
@@ -1675,7 +1675,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
|
||||
/* Re-enable interrupts on the card */
|
||||
TWL_UNMASK_INTERRUPTS(tw_dev);
|
||||
|
||||
|
||||
/* Finally, scan the host */
|
||||
scsi_scan_host(host);
|
||||
|
||||
|
||||
@@ -52,17 +52,17 @@ static char *twl_aen_severity_table[] =
|
||||
};
|
||||
|
||||
/* Liberator register offsets */
|
||||
#define TWL_STATUS 0x0 /* Status */
|
||||
#define TWL_HIBDB 0x20 /* Inbound doorbell */
|
||||
#define TWL_HISTAT 0x30 /* Host interrupt status */
|
||||
#define TWL_HIMASK 0x34 /* Host interrupt mask */
|
||||
#define TWL_STATUS 0x0 /* Status */
|
||||
#define TWL_HIBDB 0x20 /* Inbound doorbell */
|
||||
#define TWL_HISTAT 0x30 /* Host interrupt status */
|
||||
#define TWL_HIMASK 0x34 /* Host interrupt mask */
|
||||
#define TWL_HOBDB 0x9C /* Outbound doorbell */
|
||||
#define TWL_HOBDBC 0xA0 /* Outbound doorbell clear */
|
||||
#define TWL_SCRPD3 0xBC /* Scratchpad */
|
||||
#define TWL_HIBQPL 0xC0 /* Host inbound Q low */
|
||||
#define TWL_HIBQPH 0xC4 /* Host inbound Q high */
|
||||
#define TWL_HOBQPL 0xC8 /* Host outbound Q low */
|
||||
#define TWL_HOBQPH 0xCC /* Host outbound Q high */
|
||||
#define TWL_HOBDBC 0xA0 /* Outbound doorbell clear */
|
||||
#define TWL_SCRPD3 0xBC /* Scratchpad */
|
||||
#define TWL_HIBQPL 0xC0 /* Host inbound Q low */
|
||||
#define TWL_HIBQPH 0xC4 /* Host inbound Q high */
|
||||
#define TWL_HOBQPL 0xC8 /* Host outbound Q low */
|
||||
#define TWL_HOBQPH 0xCC /* Host outbound Q high */
|
||||
#define TWL_HISTATUS_VALID_INTERRUPT 0xC
|
||||
#define TWL_HISTATUS_ATTENTION_INTERRUPT 0x4
|
||||
#define TWL_HISTATUS_RESPONSE_INTERRUPT 0x8
|
||||
@@ -80,12 +80,12 @@ static char *twl_aen_severity_table[] =
|
||||
#define TW_OP_EXECUTE_SCSI 0x10
|
||||
|
||||
/* Asynchronous Event Notification (AEN) codes used by the driver */
|
||||
#define TW_AEN_QUEUE_EMPTY 0x0000
|
||||
#define TW_AEN_SOFT_RESET 0x0001
|
||||
#define TW_AEN_QUEUE_EMPTY 0x0000
|
||||
#define TW_AEN_SOFT_RESET 0x0001
|
||||
#define TW_AEN_SYNC_TIME_WITH_HOST 0x031
|
||||
#define TW_AEN_SEVERITY_ERROR 0x1
|
||||
#define TW_AEN_SEVERITY_DEBUG 0x4
|
||||
#define TW_AEN_NOT_RETRIEVED 0x1
|
||||
#define TW_AEN_SEVERITY_ERROR 0x1
|
||||
#define TW_AEN_SEVERITY_DEBUG 0x4
|
||||
#define TW_AEN_NOT_RETRIEVED 0x1
|
||||
|
||||
/* Command state defines */
|
||||
#define TW_S_INITIAL 0x1 /* Initial state */
|
||||
@@ -101,7 +101,7 @@ static char *twl_aen_severity_table[] =
|
||||
#define TW_CURRENT_DRIVER_BRANCH 0
|
||||
|
||||
/* Misc defines */
|
||||
#define TW_SECTOR_SIZE 512
|
||||
#define TW_SECTOR_SIZE 512
|
||||
#define TW_MAX_UNITS 32
|
||||
#define TW_INIT_MESSAGE_CREDITS 0x100
|
||||
#define TW_INIT_COMMAND_PACKET_SIZE 0x3
|
||||
@@ -116,15 +116,15 @@ static char *twl_aen_severity_table[] =
|
||||
#define TW_MAX_RESET_TRIES 2
|
||||
#define TW_MAX_CMDS_PER_LUN 254
|
||||
#define TW_MAX_AEN_DRAIN 255
|
||||
#define TW_IN_RESET 2
|
||||
#define TW_IN_RESET 2
|
||||
#define TW_USING_MSI 3
|
||||
#define TW_IN_ATTENTION_LOOP 4
|
||||
#define TW_MAX_SECTORS 256
|
||||
#define TW_MAX_CDB_LEN 16
|
||||
#define TW_IOCTL_CHRDEV_TIMEOUT 60 /* 60 seconds */
|
||||
#define TW_IOCTL_CHRDEV_FREE -1
|
||||
#define TW_COMMAND_OFFSET 128 /* 128 bytes */
|
||||
#define TW_VERSION_TABLE 0x0402
|
||||
#define TW_MAX_SECTORS 256
|
||||
#define TW_MAX_CDB_LEN 16
|
||||
#define TW_IOCTL_CHRDEV_TIMEOUT 60 /* 60 seconds */
|
||||
#define TW_IOCTL_CHRDEV_FREE -1
|
||||
#define TW_COMMAND_OFFSET 128 /* 128 bytes */
|
||||
#define TW_VERSION_TABLE 0x0402
|
||||
#define TW_TIMEKEEP_TABLE 0x040A
|
||||
#define TW_INFORMATION_TABLE 0x0403
|
||||
#define TW_PARAM_FWVER 3
|
||||
@@ -136,15 +136,15 @@ static char *twl_aen_severity_table[] =
|
||||
#define TW_PARAM_PHY_SUMMARY_TABLE 1
|
||||
#define TW_PARAM_PHYCOUNT 2
|
||||
#define TW_PARAM_PHYCOUNT_LENGTH 1
|
||||
#define TW_IOCTL_FIRMWARE_PASS_THROUGH 0x108 // Used by smartmontools
|
||||
#define TW_IOCTL_FIRMWARE_PASS_THROUGH 0x108 // Used by smartmontools
|
||||
#define TW_ALLOCATION_LENGTH 128
|
||||
#define TW_SENSE_DATA_LENGTH 18
|
||||
#define TW_ERROR_LOGICAL_UNIT_NOT_SUPPORTED 0x10a
|
||||
#define TW_ERROR_INVALID_FIELD_IN_CDB 0x10d
|
||||
#define TW_ERROR_UNIT_OFFLINE 0x128
|
||||
#define TW_ERROR_UNIT_OFFLINE 0x128
|
||||
#define TW_MESSAGE_SOURCE_CONTROLLER_ERROR 3
|
||||
#define TW_MESSAGE_SOURCE_CONTROLLER_EVENT 4
|
||||
#define TW_DRIVER 6
|
||||
#define TW_DRIVER 6
|
||||
#ifndef PCI_DEVICE_ID_3WARE_9750
|
||||
#define PCI_DEVICE_ID_3WARE_9750 0x1010
|
||||
#endif
|
||||
@@ -167,25 +167,41 @@ static char *twl_aen_severity_table[] =
|
||||
#define TW_NOTMFA_OUT(x) (x & 0x1)
|
||||
|
||||
/* request_id: 12, lun: 4 */
|
||||
#define TW_REQ_LUN_IN(lun, request_id) (((lun << 12) & 0xf000) | (request_id & 0xfff))
|
||||
#define TW_REQ_LUN_IN(lun, request_id) \
|
||||
(((lun << 12) & 0xf000) | (request_id & 0xfff))
|
||||
#define TW_LUN_OUT(lun) ((lun >> 12) & 0xf)
|
||||
|
||||
/* Register access macros */
|
||||
#define TWL_STATUS_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_STATUS)
|
||||
#define TWL_HOBQPL_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HOBQPL)
|
||||
#define TWL_HOBQPH_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HOBQPH)
|
||||
#define TWL_HOBDB_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HOBDB)
|
||||
#define TWL_HOBDBC_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HOBDBC)
|
||||
#define TWL_HIMASK_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HIMASK)
|
||||
#define TWL_HISTAT_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HISTAT)
|
||||
#define TWL_HIBQPH_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HIBQPH)
|
||||
#define TWL_HIBQPL_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HIBQPL)
|
||||
#define TWL_HIBDB_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_HIBDB)
|
||||
#define TWL_SCRPD3_REG_ADDR(x) ((unsigned char __iomem *)x->base_addr + TWL_SCRPD3)
|
||||
#define TWL_MASK_INTERRUPTS(x) (writel(~0, TWL_HIMASK_REG_ADDR(tw_dev)))
|
||||
#define TWL_UNMASK_INTERRUPTS(x) (writel(~TWL_HISTATUS_VALID_INTERRUPT, TWL_HIMASK_REG_ADDR(tw_dev)))
|
||||
#define TWL_CLEAR_DB_INTERRUPT(x) (writel(~0, TWL_HOBDBC_REG_ADDR(tw_dev)))
|
||||
#define TWL_SOFT_RESET(x) (writel(TWL_ISSUE_SOFT_RESET, TWL_HIBDB_REG_ADDR(tw_dev)))
|
||||
#define TWL_STATUS_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_STATUS)
|
||||
#define TWL_HOBQPL_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HOBQPL)
|
||||
#define TWL_HOBQPH_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HOBQPH)
|
||||
#define TWL_HOBDB_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HOBDB)
|
||||
#define TWL_HOBDBC_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HOBDBC)
|
||||
#define TWL_HIMASK_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HIMASK)
|
||||
#define TWL_HISTAT_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HISTAT)
|
||||
#define TWL_HIBQPH_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HIBQPH)
|
||||
#define TWL_HIBQPL_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HIBQPL)
|
||||
#define TWL_HIBDB_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_HIBDB)
|
||||
#define TWL_SCRPD3_REG_ADDR(x) \
|
||||
((unsigned char __iomem *)x->base_addr + TWL_SCRPD3)
|
||||
#define TWL_MASK_INTERRUPTS(x) \
|
||||
(writel(~0, TWL_HIMASK_REG_ADDR(tw_dev)))
|
||||
#define TWL_UNMASK_INTERRUPTS(x) \
|
||||
(writel(~TWL_HISTATUS_VALID_INTERRUPT, TWL_HIMASK_REG_ADDR(tw_dev)))
|
||||
#define TWL_CLEAR_DB_INTERRUPT(x) \
|
||||
(writel(~0, TWL_HOBDBC_REG_ADDR(tw_dev)))
|
||||
#define TWL_SOFT_RESET(x) \
|
||||
(writel(TWL_ISSUE_SOFT_RESET, TWL_HIBDB_REG_ADDR(tw_dev)))
|
||||
|
||||
/* Macros */
|
||||
#define TW_PRINTK(h,a,b,c) { \
|
||||
@@ -317,7 +333,7 @@ typedef struct TAG_TW_Ioctl_Driver_Command {
|
||||
|
||||
typedef struct TAG_TW_Ioctl_Apache {
|
||||
TW_Ioctl_Driver_Command driver_command;
|
||||
char padding[488];
|
||||
char padding[488];
|
||||
TW_Command_Full firmware_command;
|
||||
char data_buffer[1];
|
||||
} TW_Ioctl_Buf_Apache;
|
||||
@@ -352,10 +368,10 @@ typedef struct TAG_TW_Compatibility_Info
|
||||
#pragma pack()
|
||||
|
||||
typedef struct TAG_TW_Device_Extension {
|
||||
void __iomem *base_addr;
|
||||
unsigned long *generic_buffer_virt[TW_Q_LENGTH];
|
||||
dma_addr_t generic_buffer_phys[TW_Q_LENGTH];
|
||||
TW_Command_Full *command_packet_virt[TW_Q_LENGTH];
|
||||
void __iomem *base_addr;
|
||||
unsigned long *generic_buffer_virt[TW_Q_LENGTH];
|
||||
dma_addr_t generic_buffer_phys[TW_Q_LENGTH];
|
||||
TW_Command_Full *command_packet_virt[TW_Q_LENGTH];
|
||||
dma_addr_t command_packet_phys[TW_Q_LENGTH];
|
||||
TW_Command_Apache_Header *sense_buffer_virt[TW_Q_LENGTH];
|
||||
dma_addr_t sense_buffer_phys[TW_Q_LENGTH];
|
||||
@@ -364,7 +380,7 @@ typedef struct TAG_TW_Device_Extension {
|
||||
unsigned char free_queue[TW_Q_LENGTH];
|
||||
unsigned char free_head;
|
||||
unsigned char free_tail;
|
||||
int state[TW_Q_LENGTH];
|
||||
int state[TW_Q_LENGTH];
|
||||
unsigned int posted_request_count;
|
||||
unsigned int max_posted_request_count;
|
||||
unsigned int max_sgl_entries;
|
||||
@@ -375,9 +391,9 @@ typedef struct TAG_TW_Device_Extension {
|
||||
unsigned int aen_count;
|
||||
struct Scsi_Host *host;
|
||||
long flags;
|
||||
TW_Event *event_queue[TW_Q_LENGTH];
|
||||
unsigned char error_index;
|
||||
unsigned int error_sequence_id;
|
||||
TW_Event *event_queue[TW_Q_LENGTH];
|
||||
unsigned char error_index;
|
||||
unsigned int error_sequence_id;
|
||||
int chrdev_request_id;
|
||||
wait_queue_head_t ioctl_wqueue;
|
||||
struct mutex ioctl_lock;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
/*
|
||||
3w-xxxx.h -- 3ware Storage Controller device driver for Linux.
|
||||
|
||||
|
||||
Written By: Adam Radford <aradford@gmail.com>
|
||||
Modifications By: Joel Jacobson <linux@3ware.com>
|
||||
Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
||||
Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
||||
Brad Strand <linux@3ware.com>
|
||||
|
||||
Copyright (C) 1999-2010 3ware Inc.
|
||||
@@ -15,39 +15,39 @@
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
NO WARRANTY
|
||||
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
|
||||
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
|
||||
solely responsible for determining the appropriateness of using and
|
||||
distributing the Program and assumes all risks associated with its
|
||||
exercise of rights under this Agreement, including but not limited to
|
||||
the risks and costs of program errors, damage to or loss of data,
|
||||
programs or equipment, and unavailability or interruption of operations.
|
||||
NO WARRANTY
|
||||
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
|
||||
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
|
||||
solely responsible for determining the appropriateness of using and
|
||||
distributing the Program and assumes all risks associated with its
|
||||
exercise of rights under this Agreement, including but not limited to
|
||||
the risks and costs of program errors, damage to or loss of data,
|
||||
programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
DISCLAIMER OF LIABILITY
|
||||
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
|
||||
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
|
||||
DISCLAIMER OF LIABILITY
|
||||
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
|
||||
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Bugs/Comments/Suggestions should be mailed to:
|
||||
Bugs/Comments/Suggestions should be mailed to:
|
||||
|
||||
aradford@gmail.com
|
||||
|
||||
|
||||
For more information, goto:
|
||||
http://www.lsi.com
|
||||
*/
|
||||
@@ -99,21 +99,21 @@ static char *tw_aen_string[] = {
|
||||
static unsigned char tw_sense_table[][4] =
|
||||
{
|
||||
/* Codes for newer firmware */
|
||||
// ATA Error SCSI Error
|
||||
{0x01, 0x03, 0x13, 0x00}, // Address mark not found Address mark not found for data field
|
||||
{0x04, 0x0b, 0x00, 0x00}, // Aborted command Aborted command
|
||||
{0x10, 0x0b, 0x14, 0x00}, // ID not found Recorded entity not found
|
||||
{0x40, 0x03, 0x11, 0x00}, // Uncorrectable ECC error Unrecovered read error
|
||||
{0x61, 0x04, 0x00, 0x00}, // Device fault Hardware error
|
||||
{0x84, 0x0b, 0x47, 0x00}, // Data CRC error SCSI parity error
|
||||
{0xd0, 0x0b, 0x00, 0x00}, // Device busy Aborted command
|
||||
{0xd1, 0x0b, 0x00, 0x00}, // Device busy Aborted command
|
||||
{0x37, 0x02, 0x04, 0x00}, // Unit offline Not ready
|
||||
{0x09, 0x02, 0x04, 0x00}, // Unrecovered disk error Not ready
|
||||
// ATA Error SCSI Error
|
||||
{0x01, 0x03, 0x13, 0x00}, // Address mark not found Address mark not found for data field
|
||||
{0x04, 0x0b, 0x00, 0x00}, // Aborted command Aborted command
|
||||
{0x10, 0x0b, 0x14, 0x00}, // ID not found Recorded entity not found
|
||||
{0x40, 0x03, 0x11, 0x00}, // Uncorrectable ECC error Unrecovered read error
|
||||
{0x61, 0x04, 0x00, 0x00}, // Device fault Hardware error
|
||||
{0x84, 0x0b, 0x47, 0x00}, // Data CRC error SCSI parity error
|
||||
{0xd0, 0x0b, 0x00, 0x00}, // Device busy Aborted command
|
||||
{0xd1, 0x0b, 0x00, 0x00}, // Device busy Aborted command
|
||||
{0x37, 0x02, 0x04, 0x00}, // Unit offline Not ready
|
||||
{0x09, 0x02, 0x04, 0x00}, // Unrecovered disk error Not ready
|
||||
|
||||
/* Codes for older firmware */
|
||||
// 3ware Error SCSI Error
|
||||
{0x51, 0x0b, 0x00, 0x00} // Unspecified Aborted command
|
||||
/* Codes for older firmware */
|
||||
// 3ware Error SCSI Error
|
||||
{0x51, 0x0b, 0x00, 0x00} // Unspecified Aborted command
|
||||
};
|
||||
|
||||
/* Control register bit definitions */
|
||||
@@ -128,9 +128,9 @@ static unsigned char tw_sense_table[][4] =
|
||||
#define TW_CONTROL_ENABLE_INTERRUPTS 0x00000080
|
||||
#define TW_CONTROL_DISABLE_INTERRUPTS 0x00000040
|
||||
#define TW_CONTROL_ISSUE_HOST_INTERRUPT 0x00000020
|
||||
#define TW_CONTROL_CLEAR_PARITY_ERROR 0x00800000
|
||||
#define TW_CONTROL_CLEAR_QUEUE_ERROR 0x00400000
|
||||
#define TW_CONTROL_CLEAR_PCI_ABORT 0x00100000
|
||||
#define TW_CONTROL_CLEAR_PARITY_ERROR 0x00800000
|
||||
#define TW_CONTROL_CLEAR_QUEUE_ERROR 0x00400000
|
||||
#define TW_CONTROL_CLEAR_PCI_ABORT 0x00100000
|
||||
#define TW_CONTROL_CLEAR_SBUF_WRITE_ERROR 0x00000008
|
||||
|
||||
/* Status register bit definitions */
|
||||
@@ -152,8 +152,8 @@ static unsigned char tw_sense_table[][4] =
|
||||
#define TW_STATUS_CLEARABLE_BITS 0x00D00000
|
||||
#define TW_STATUS_EXPECTED_BITS 0x00002000
|
||||
#define TW_STATUS_UNEXPECTED_BITS 0x00F00008
|
||||
#define TW_STATUS_SBUF_WRITE_ERROR 0x00000008
|
||||
#define TW_STATUS_VALID_INTERRUPT 0x00DF0008
|
||||
#define TW_STATUS_SBUF_WRITE_ERROR 0x00000008
|
||||
#define TW_STATUS_VALID_INTERRUPT 0x00DF0008
|
||||
|
||||
/* RESPONSE QUEUE BIT DEFINITIONS */
|
||||
#define TW_RESPONSE_ID_MASK 0x00000FF0
|
||||
@@ -179,33 +179,33 @@ static unsigned char tw_sense_table[][4] =
|
||||
#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_CMD_PACKET 0x1d
|
||||
#define TW_CMD_PACKET_WITH_DATA 0x1f
|
||||
|
||||
/* Asynchronous Event Notification (AEN) Codes */
|
||||
#define TW_AEN_QUEUE_EMPTY 0x0000
|
||||
#define TW_AEN_SOFT_RESET 0x0001
|
||||
#define TW_AEN_SOFT_RESET 0x0001
|
||||
#define TW_AEN_DEGRADED_MIRROR 0x0002
|
||||
#define TW_AEN_CONTROLLER_ERROR 0x0003
|
||||
#define TW_AEN_REBUILD_FAIL 0x0004
|
||||
#define TW_AEN_REBUILD_DONE 0x0005
|
||||
#define TW_AEN_QUEUE_FULL 0x00ff
|
||||
#define TW_AEN_QUEUE_FULL 0x00ff
|
||||
#define TW_AEN_TABLE_UNDEFINED 0x15
|
||||
#define TW_AEN_APORT_TIMEOUT 0x0009
|
||||
#define TW_AEN_DRIVE_ERROR 0x000A
|
||||
#define TW_AEN_SMART_FAIL 0x000F
|
||||
#define TW_AEN_SBUF_FAIL 0x0024
|
||||
#define TW_AEN_SMART_FAIL 0x000F
|
||||
#define TW_AEN_SBUF_FAIL 0x0024
|
||||
|
||||
/* Misc defines */
|
||||
#define TW_ALIGNMENT_6000 64 /* 64 bytes */
|
||||
#define TW_ALIGNMENT_7000 4 /* 4 bytes */
|
||||
#define TW_ALIGNMENT_7000 4 /* 4 bytes */
|
||||
#define TW_MAX_UNITS 16
|
||||
#define TW_COMMAND_ALIGNMENT_MASK 0x1ff
|
||||
#define TW_INIT_MESSAGE_CREDITS 0x100
|
||||
#define TW_INIT_COMMAND_PACKET_SIZE 0x3
|
||||
#define TW_POLL_MAX_RETRIES 20000
|
||||
#define TW_POLL_MAX_RETRIES 20000
|
||||
#define TW_MAX_SGL_LENGTH 62
|
||||
#define TW_ATA_PASS_SGL_MAX 60
|
||||
#define TW_ATA_PASS_SGL_MAX 60
|
||||
#define TW_Q_LENGTH 256
|
||||
#define TW_Q_START 0
|
||||
#define TW_MAX_SLOT 32
|
||||
@@ -216,20 +216,20 @@ static unsigned char tw_sense_table[][4] =
|
||||
chrdev ioctl, one for
|
||||
internal aen post */
|
||||
#define TW_BLOCK_SIZE 0x200 /* 512-byte blocks */
|
||||
#define TW_IOCTL 0x80
|
||||
#define TW_UNIT_ONLINE 1
|
||||
#define TW_IN_INTR 1
|
||||
#define TW_IN_RESET 2
|
||||
#define TW_IN_CHRDEV_IOCTL 3
|
||||
#define TW_MAX_SECTORS 256
|
||||
#define TW_IOCTL 0x80
|
||||
#define TW_UNIT_ONLINE 1
|
||||
#define TW_IN_INTR 1
|
||||
#define TW_IN_RESET 2
|
||||
#define TW_IN_CHRDEV_IOCTL 3
|
||||
#define TW_MAX_SECTORS 256
|
||||
#define TW_MAX_IOCTL_SECTORS 512
|
||||
#define TW_AEN_WAIT_TIME 1000
|
||||
#define TW_IOCTL_WAIT_TIME (1 * HZ) /* 1 second */
|
||||
#define TW_ISR_DONT_COMPLETE 2
|
||||
#define TW_ISR_DONT_RESULT 3
|
||||
#define TW_IOCTL_TIMEOUT 25 /* 25 seconds */
|
||||
#define TW_IOCTL_CHRDEV_TIMEOUT 60 /* 60 seconds */
|
||||
#define TW_IOCTL_CHRDEV_FREE -1
|
||||
#define TW_AEN_WAIT_TIME 1000
|
||||
#define TW_IOCTL_WAIT_TIME (1 * HZ) /* 1 second */
|
||||
#define TW_ISR_DONT_COMPLETE 2
|
||||
#define TW_ISR_DONT_RESULT 3
|
||||
#define TW_IOCTL_TIMEOUT 25 /* 25 seconds */
|
||||
#define TW_IOCTL_CHRDEV_TIMEOUT 60 /* 60 seconds */
|
||||
#define TW_IOCTL_CHRDEV_FREE -1
|
||||
#define TW_MAX_CDB_LEN 16
|
||||
|
||||
/* Bitmask macros to eliminate bitfields */
|
||||
@@ -250,26 +250,35 @@ static unsigned char tw_sense_table[][4] =
|
||||
#define TW_STATUS_REG_ADDR(x) (x->base_addr + 0x4)
|
||||
#define TW_COMMAND_QUEUE_REG_ADDR(x) (x->base_addr + 0x8)
|
||||
#define TW_RESPONSE_QUEUE_REG_ADDR(x) (x->base_addr + 0xC)
|
||||
#define TW_CLEAR_ALL_INTERRUPTS(x) (outl(TW_STATUS_VALID_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_ATTENTION_INTERRUPT(x) (outl(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_HOST_INTERRUPT(x) (outl(TW_CONTROL_CLEAR_HOST_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_DISABLE_INTERRUPTS(x) (outl(TW_CONTROL_DISABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_ENABLE_AND_CLEAR_INTERRUPTS(x) (outl(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | TW_CONTROL_UNMASK_RESPONSE_INTERRUPT | TW_CONTROL_ENABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_MASK_COMMAND_INTERRUPT(x) (outl(TW_CONTROL_MASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_UNMASK_COMMAND_INTERRUPT(x) (outl(TW_CONTROL_UNMASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_SOFT_RESET(x) (outl(TW_CONTROL_ISSUE_SOFT_RESET | \
|
||||
TW_CONTROL_CLEAR_HOST_INTERRUPT | \
|
||||
TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | \
|
||||
TW_CONTROL_MASK_COMMAND_INTERRUPT | \
|
||||
TW_CONTROL_MASK_RESPONSE_INTERRUPT | \
|
||||
TW_CONTROL_CLEAR_ERROR_STATUS | \
|
||||
TW_CONTROL_DISABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_STATUS_ERRORS(x) \
|
||||
(((x & TW_STATUS_PCI_ABORT) || \
|
||||
(x & TW_STATUS_PCI_PARITY_ERROR) || \
|
||||
(x & TW_STATUS_QUEUE_ERROR) || \
|
||||
(x & TW_STATUS_MICROCONTROLLER_ERROR)) && \
|
||||
(x & TW_STATUS_MICROCONTROLLER_READY))
|
||||
#define TW_CLEAR_ALL_INTERRUPTS(x) \
|
||||
(outl(TW_STATUS_VALID_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_ATTENTION_INTERRUPT(x) \
|
||||
(outl(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_CLEAR_HOST_INTERRUPT(x) \
|
||||
(outl(TW_CONTROL_CLEAR_HOST_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_DISABLE_INTERRUPTS(x) \
|
||||
(outl(TW_CONTROL_DISABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_ENABLE_AND_CLEAR_INTERRUPTS(x) \
|
||||
(outl(TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | \
|
||||
TW_CONTROL_UNMASK_RESPONSE_INTERRUPT | \
|
||||
TW_CONTROL_ENABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_MASK_COMMAND_INTERRUPT(x) \
|
||||
(outl(TW_CONTROL_MASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_UNMASK_COMMAND_INTERRUPT(x) \
|
||||
(outl(TW_CONTROL_UNMASK_COMMAND_INTERRUPT, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_SOFT_RESET(x) (outl(TW_CONTROL_ISSUE_SOFT_RESET | \
|
||||
TW_CONTROL_CLEAR_HOST_INTERRUPT | \
|
||||
TW_CONTROL_CLEAR_ATTENTION_INTERRUPT | \
|
||||
TW_CONTROL_MASK_COMMAND_INTERRUPT | \
|
||||
TW_CONTROL_MASK_RESPONSE_INTERRUPT | \
|
||||
TW_CONTROL_CLEAR_ERROR_STATUS | \
|
||||
TW_CONTROL_DISABLE_INTERRUPTS, TW_CONTROL_REG_ADDR(x)))
|
||||
#define TW_STATUS_ERRORS(x) \
|
||||
(((x & TW_STATUS_PCI_ABORT) || \
|
||||
(x & TW_STATUS_PCI_PARITY_ERROR) || \
|
||||
(x & TW_STATUS_QUEUE_ERROR) || \
|
||||
(x & TW_STATUS_MICROCONTROLLER_ERROR)) && \
|
||||
(x & TW_STATUS_MICROCONTROLLER_READY))
|
||||
|
||||
#ifdef TW_DEBUG
|
||||
#define dprintk(msg...) printk(msg)
|
||||
|
||||
@@ -669,20 +669,6 @@ config SCSI_FDOMAIN_ISA
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called fdomain_isa.
|
||||
|
||||
config SCSI_GDTH
|
||||
tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
|
||||
depends on PCI && SCSI
|
||||
help
|
||||
Formerly called GDT SCSI Disk Array Controller Support.
|
||||
|
||||
This is a driver for RAID/SCSI Disk Array Controllers (EISA/ISA/PCI)
|
||||
manufactured by Intel Corporation/ICP vortex GmbH. It is documented
|
||||
in the kernel source in <file:drivers/scsi/gdth.c> and
|
||||
<file:drivers/scsi/gdth.h>.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called gdth.
|
||||
|
||||
config SCSI_ISCI
|
||||
tristate "Intel(R) C600 Series Chipset SAS Controller"
|
||||
depends on PCI && SCSI
|
||||
@@ -1159,6 +1145,7 @@ config SCSI_LPFC
|
||||
depends on NVME_TARGET_FC || NVME_TARGET_FC=n
|
||||
depends on NVME_FC || NVME_FC=n
|
||||
select CRC_T10DIF
|
||||
select IRQ_POLL
|
||||
help
|
||||
This lpfc driver supports the Emulex LightPulse
|
||||
Family of Fibre Channel PCI host adapters.
|
||||
@@ -1182,6 +1169,7 @@ config SCSI_SIM710
|
||||
config SCSI_DC395x
|
||||
tristate "Tekram DC395(U/UW/F) and DC315(U) SCSI support"
|
||||
depends on PCI && SCSI
|
||||
select SCSI_SPI_ATTRS
|
||||
help
|
||||
This driver supports PCI SCSI host adapters based on the ASIC
|
||||
TRM-S1040 chip, e.g Tekram DC395(U/UW/F) and DC315(U) variants.
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
|
||||
CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF
|
||||
CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
|
||||
|
||||
obj-$(CONFIG_PCMCIA) += pcmcia/
|
||||
|
||||
@@ -103,7 +102,6 @@ obj-$(CONFIG_SCSI_MPT3SAS) += mpt3sas/
|
||||
obj-$(CONFIG_SCSI_UFSHCD) += ufs/
|
||||
obj-$(CONFIG_SCSI_ACARD) += atp870u.o
|
||||
obj-$(CONFIG_SCSI_SUNESP) += esp_scsi.o sun_esp.o
|
||||
obj-$(CONFIG_SCSI_GDTH) += gdth.o
|
||||
obj-$(CONFIG_SCSI_INITIO) += initio.o
|
||||
obj-$(CONFIG_SCSI_INIA100) += a100u2w.o
|
||||
obj-$(CONFIG_SCSI_QLOGICPTI) += qlogicpti.o
|
||||
|
||||
@@ -556,7 +556,7 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
|
||||
}
|
||||
}
|
||||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
|
||||
aac_fib_complete(fibptr);
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
@@ -1092,7 +1092,7 @@ static void get_container_serial_callback(void *context, struct fib * fibptr)
|
||||
}
|
||||
}
|
||||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
|
||||
aac_fib_complete(fibptr);
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
@@ -1191,8 +1191,7 @@ static int aac_bounds_32(struct aac_dev * dev, struct scsi_cmnd * cmd, u64 lba)
|
||||
if (lba & 0xffffffff00000000LL) {
|
||||
int cid = scmd_id(cmd);
|
||||
dprintk((KERN_DEBUG "aacraid: Illegal lba\n"));
|
||||
cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
cmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE,
|
||||
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
|
||||
@@ -2364,13 +2363,11 @@ static void io_callback(void *context, struct fib * fibptr)
|
||||
readreply = (struct aac_read_reply *)fib_data(fibptr);
|
||||
switch (le32_to_cpu(readreply->status)) {
|
||||
case ST_OK:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
dev->fsa_dev[cid].sense_data.sense_key = NO_SENSE;
|
||||
break;
|
||||
case ST_NOT_READY:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data, NOT_READY,
|
||||
SENCODE_BECOMING_READY, ASENCODE_BECOMING_READY, 0, 0);
|
||||
memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
|
||||
@@ -2378,8 +2375,7 @@ static void io_callback(void *context, struct fib * fibptr)
|
||||
SCSI_SENSE_BUFFERSIZE));
|
||||
break;
|
||||
case ST_MEDERR:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data, MEDIUM_ERROR,
|
||||
SENCODE_UNRECOVERED_READ_ERROR, ASENCODE_NO_SENSE, 0, 0);
|
||||
memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
|
||||
@@ -2391,8 +2387,7 @@ static void io_callback(void *context, struct fib * fibptr)
|
||||
printk(KERN_WARNING "io_callback: io failed, status = %d\n",
|
||||
le32_to_cpu(readreply->status));
|
||||
#endif
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE,
|
||||
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
|
||||
@@ -2467,8 +2462,7 @@ static int aac_read(struct scsi_cmnd * scsicmd)
|
||||
if ((lba + count) > (dev->fsa_dev[scmd_id(scsicmd)].size)) {
|
||||
cid = scmd_id(scsicmd);
|
||||
dprintk((KERN_DEBUG "aacraid: Illegal lba\n"));
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
ILLEGAL_REQUEST, SENCODE_LBA_OUT_OF_RANGE,
|
||||
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
|
||||
@@ -2500,7 +2494,7 @@ static int aac_read(struct scsi_cmnd * scsicmd)
|
||||
/*
|
||||
* For some reason, the Fib didn't queue, return QUEUE_FULL
|
||||
*/
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_TASK_SET_FULL;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
@@ -2559,8 +2553,7 @@ static int aac_write(struct scsi_cmnd * scsicmd)
|
||||
if ((lba + count) > (dev->fsa_dev[scmd_id(scsicmd)].size)) {
|
||||
cid = scmd_id(scsicmd);
|
||||
dprintk((KERN_DEBUG "aacraid: Illegal lba\n"));
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
ILLEGAL_REQUEST, SENCODE_LBA_OUT_OF_RANGE,
|
||||
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
|
||||
@@ -2592,7 +2585,7 @@ static int aac_write(struct scsi_cmnd * scsicmd)
|
||||
/*
|
||||
* For some reason, the Fib didn't queue, return QUEUE_FULL
|
||||
*/
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_TASK_SET_FULL;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
@@ -2615,8 +2608,7 @@ static void synchronize_callback(void *context, struct fib *fibptr)
|
||||
|
||||
synchronizereply = fib_data(fibptr);
|
||||
if (le32_to_cpu(synchronizereply->status) == CT_OK)
|
||||
cmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
|
||||
cmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
else {
|
||||
struct scsi_device *sdev = cmd->device;
|
||||
struct aac_dev *dev = fibptr->dev;
|
||||
@@ -2624,8 +2616,7 @@ static void synchronize_callback(void *context, struct fib *fibptr)
|
||||
printk(KERN_WARNING
|
||||
"synchronize_callback: synchronize failed, status = %d\n",
|
||||
le32_to_cpu(synchronizereply->status));
|
||||
cmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
|
||||
cmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE,
|
||||
ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
|
||||
@@ -2699,7 +2690,7 @@ static void aac_start_stop_callback(void *context, struct fib *fibptr)
|
||||
|
||||
BUG_ON(fibptr == NULL);
|
||||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
@@ -2716,8 +2707,7 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)
|
||||
|
||||
if (!(aac->supplement_adapter_info.supported_options2 &
|
||||
AAC_OPTION_POWER_MANAGEMENT)) {
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
return 0;
|
||||
}
|
||||
@@ -2848,7 +2838,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
(scsicmd->cmnd[0] != TEST_UNIT_READY))
|
||||
{
|
||||
dprintk((KERN_WARNING "Only INQUIRY & TUR command supported for controller, rcvd = 0x%x.\n", scsicmd->cmnd[0]));
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND,
|
||||
ASENCODE_INVALID_COMMAND, 0, 0);
|
||||
@@ -2877,8 +2867,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
|
||||
case SYNCHRONIZE_CACHE:
|
||||
if (((aac_cache & 6) == 6) && dev->cache_protected) {
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
}
|
||||
/* Issue FIB to tell Firmware to flush it's cache */
|
||||
@@ -2907,9 +2896,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
arr[1] = scsicmd->cmnd[2];
|
||||
scsi_sg_copy_from_buffer(scsicmd, &inq_data,
|
||||
sizeof(inq_data));
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
} else if (scsicmd->cmnd[2] == 0x80) {
|
||||
/* unit serial number page */
|
||||
arr[3] = setinqserial(dev, &arr[4],
|
||||
@@ -2920,9 +2907,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
if (aac_wwn != 2)
|
||||
return aac_get_container_serial(
|
||||
scsicmd);
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
} else if (scsicmd->cmnd[2] == 0x83) {
|
||||
/* vpd page 0x83 - Device Identification Page */
|
||||
char *sno = (char *)&inq_data;
|
||||
@@ -2931,14 +2916,10 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
if (aac_wwn != 2)
|
||||
return aac_get_container_serial(
|
||||
scsicmd);
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
} else {
|
||||
/* vpd page not implemented */
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
ILLEGAL_REQUEST, SENCODE_INVALID_CDB_FIELD,
|
||||
ASENCODE_NO_SENSE, 7, 2);
|
||||
@@ -2964,8 +2945,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */
|
||||
scsi_sg_copy_from_buffer(scsicmd, &inq_data,
|
||||
sizeof(inq_data));
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
}
|
||||
if (dev->in_reset)
|
||||
@@ -3014,8 +2994,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
/* Do not cache partition table for arrays */
|
||||
scsicmd->device->removable = 1;
|
||||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3041,8 +3020,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
scsi_sg_copy_from_buffer(scsicmd, cp, sizeof(cp));
|
||||
/* Do not cache partition table for arrays */
|
||||
scsicmd->device->removable = 1;
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3121,8 +3099,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
scsi_sg_copy_from_buffer(scsicmd,
|
||||
(char *)&mpd,
|
||||
mode_buf_length);
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
}
|
||||
case MODE_SENSE_10:
|
||||
@@ -3199,8 +3176,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
(char *)&mpd10,
|
||||
mode_buf_length);
|
||||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
}
|
||||
case REQUEST_SENSE:
|
||||
@@ -3209,8 +3185,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
sizeof(struct sense_data));
|
||||
memset(&dev->fsa_dev[cid].sense_data, 0,
|
||||
sizeof(struct sense_data));
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
|
||||
case ALLOW_MEDIUM_REMOVAL:
|
||||
@@ -3220,16 +3195,14 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
else
|
||||
fsa_dev_ptr[cid].locked = 0;
|
||||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
/*
|
||||
* These commands are all No-Ops
|
||||
*/
|
||||
case TEST_UNIT_READY:
|
||||
if (fsa_dev_ptr[cid].sense_data.sense_key == NOT_READY) {
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
NOT_READY, SENCODE_BECOMING_READY,
|
||||
ASENCODE_BECOMING_READY, 0, 0);
|
||||
@@ -3246,8 +3219,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
case REZERO_UNIT:
|
||||
case REASSIGN_BLOCKS:
|
||||
case SEEK_10:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_GOOD;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_GOOD;
|
||||
break;
|
||||
|
||||
case START_STOP:
|
||||
@@ -3259,8 +3231,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
||||
*/
|
||||
dprintk((KERN_WARNING "Unhandled SCSI Command: 0x%x.\n",
|
||||
scsicmd->cmnd[0]));
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
|
||||
SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
set_sense(&dev->fsa_dev[cid].sense_data,
|
||||
ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND,
|
||||
ASENCODE_INVALID_COMMAND, 0, 0);
|
||||
@@ -3441,9 +3412,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
||||
le32_to_cpu(srbreply->status));
|
||||
len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
|
||||
SCSI_SENSE_BUFFERSIZE);
|
||||
scsicmd->result = DID_ERROR << 16
|
||||
| COMMAND_COMPLETE << 8
|
||||
| SAM_STAT_CHECK_CONDITION;
|
||||
scsicmd->result = DID_ERROR << 16 | SAM_STAT_CHECK_CONDITION;
|
||||
memcpy(scsicmd->sense_buffer,
|
||||
srbreply->sense_data, len);
|
||||
}
|
||||
@@ -3455,7 +3424,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
||||
case SRB_STATUS_ERROR_RECOVERY:
|
||||
case SRB_STATUS_PENDING:
|
||||
case SRB_STATUS_SUCCESS:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
break;
|
||||
case SRB_STATUS_DATA_OVERRUN:
|
||||
switch (scsicmd->cmnd[0]) {
|
||||
@@ -3472,60 +3441,52 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
||||
pr_warn("aacraid: SCSI CMD underflow\n");
|
||||
else
|
||||
pr_warn("aacraid: SCSI CMD Data Overrun\n");
|
||||
scsicmd->result = DID_ERROR << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
break;
|
||||
case INQUIRY:
|
||||
scsicmd->result = DID_OK << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
break;
|
||||
default:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SRB_STATUS_ABORTED:
|
||||
scsicmd->result = DID_ABORT << 16 | ABORT << 8;
|
||||
scsicmd->result = DID_ABORT << 16;
|
||||
break;
|
||||
case SRB_STATUS_ABORT_FAILED:
|
||||
/*
|
||||
* Not sure about this one - but assuming the
|
||||
* hba was trying to abort for some reason
|
||||
*/
|
||||
scsicmd->result = DID_ERROR << 16 | ABORT << 8;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
break;
|
||||
case SRB_STATUS_PARITY_ERROR:
|
||||
scsicmd->result = DID_PARITY << 16
|
||||
| MSG_PARITY_ERROR << 8;
|
||||
scsicmd->result = DID_PARITY << 16;
|
||||
break;
|
||||
case SRB_STATUS_NO_DEVICE:
|
||||
case SRB_STATUS_INVALID_PATH_ID:
|
||||
case SRB_STATUS_INVALID_TARGET_ID:
|
||||
case SRB_STATUS_INVALID_LUN:
|
||||
case SRB_STATUS_SELECTION_TIMEOUT:
|
||||
scsicmd->result = DID_NO_CONNECT << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_NO_CONNECT << 16;
|
||||
break;
|
||||
|
||||
case SRB_STATUS_COMMAND_TIMEOUT:
|
||||
case SRB_STATUS_TIMEOUT:
|
||||
scsicmd->result = DID_TIME_OUT << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_TIME_OUT << 16;
|
||||
break;
|
||||
|
||||
case SRB_STATUS_BUSY:
|
||||
scsicmd->result = DID_BUS_BUSY << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_BUS_BUSY << 16;
|
||||
break;
|
||||
|
||||
case SRB_STATUS_BUS_RESET:
|
||||
scsicmd->result = DID_RESET << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_RESET << 16;
|
||||
break;
|
||||
|
||||
case SRB_STATUS_MESSAGE_REJECTED:
|
||||
scsicmd->result = DID_ERROR << 16
|
||||
| MESSAGE_REJECT << 8;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
break;
|
||||
case SRB_STATUS_REQUEST_FLUSHED:
|
||||
case SRB_STATUS_ERROR:
|
||||
@@ -3561,19 +3522,14 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
||||
|| (scsicmd->cmnd[0] == ATA_16)) {
|
||||
|
||||
if (scsicmd->cmnd[2] & (0x01 << 5)) {
|
||||
scsicmd->result = DID_OK << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
break;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
} else {
|
||||
scsicmd->result = DID_ERROR << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
break;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
}
|
||||
} else {
|
||||
scsicmd->result = DID_ERROR << 16
|
||||
| COMMAND_COMPLETE << 8;
|
||||
break;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (le32_to_cpu(srbreply->scsi_status)
|
||||
== SAM_STAT_CHECK_CONDITION) {
|
||||
@@ -3609,7 +3565,7 @@ static void hba_resp_task_complete(struct aac_dev *dev,
|
||||
|
||||
switch (err->status) {
|
||||
case SAM_STAT_GOOD:
|
||||
scsicmd->result |= DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result |= DID_OK << 16;
|
||||
break;
|
||||
case SAM_STAT_CHECK_CONDITION:
|
||||
{
|
||||
@@ -3620,19 +3576,19 @@ static void hba_resp_task_complete(struct aac_dev *dev,
|
||||
if (len)
|
||||
memcpy(scsicmd->sense_buffer,
|
||||
err->sense_response_buf, len);
|
||||
scsicmd->result |= DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result |= DID_OK << 16;
|
||||
break;
|
||||
}
|
||||
case SAM_STAT_BUSY:
|
||||
scsicmd->result |= DID_BUS_BUSY << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result |= DID_BUS_BUSY << 16;
|
||||
break;
|
||||
case SAM_STAT_TASK_ABORTED:
|
||||
scsicmd->result |= DID_ABORT << 16 | ABORT << 8;
|
||||
scsicmd->result |= DID_ABORT << 16;
|
||||
break;
|
||||
case SAM_STAT_RESERVATION_CONFLICT:
|
||||
case SAM_STAT_TASK_SET_FULL:
|
||||
default:
|
||||
scsicmd->result |= DID_ERROR << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result |= DID_ERROR << 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3652,27 +3608,26 @@ static void hba_resp_task_failure(struct aac_dev *dev,
|
||||
dev->hba_map[bus][cid].devtype = AAC_DEVTYPE_ARC_RAW;
|
||||
dev->hba_map[bus][cid].rmw_nexus = 0xffffffff;
|
||||
}
|
||||
scsicmd->result = DID_NO_CONNECT << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_NO_CONNECT << 16;
|
||||
break;
|
||||
}
|
||||
case HBA_RESP_STAT_IO_ERROR:
|
||||
case HBA_RESP_STAT_NO_PATH_TO_DEVICE:
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8 | SAM_STAT_BUSY;
|
||||
scsicmd->result = DID_OK << 16 | SAM_STAT_BUSY;
|
||||
break;
|
||||
case HBA_RESP_STAT_IO_ABORTED:
|
||||
scsicmd->result = DID_ABORT << 16 | ABORT << 8;
|
||||
scsicmd->result = DID_ABORT << 16;
|
||||
break;
|
||||
case HBA_RESP_STAT_INVALID_DEVICE:
|
||||
scsicmd->result = DID_NO_CONNECT << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_NO_CONNECT << 16;
|
||||
break;
|
||||
case HBA_RESP_STAT_UNDERRUN:
|
||||
/* UNDERRUN is OK */
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
break;
|
||||
case HBA_RESP_STAT_OVERRUN:
|
||||
default:
|
||||
scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3705,7 +3660,7 @@ void aac_hba_callback(void *context, struct fib *fibptr)
|
||||
|
||||
if (fibptr->flags & FIB_CONTEXT_FLAG_FASTRESP) {
|
||||
/* fast response */
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -3717,17 +3672,17 @@ void aac_hba_callback(void *context, struct fib *fibptr)
|
||||
hba_resp_task_failure(dev, scsicmd, err);
|
||||
break;
|
||||
case HBA_RESP_SVCRES_TMF_REJECTED:
|
||||
scsicmd->result = DID_ERROR << 16 | MESSAGE_REJECT << 8;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
break;
|
||||
case HBA_RESP_SVCRES_TMF_LUN_INVALID:
|
||||
scsicmd->result = DID_NO_CONNECT << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_NO_CONNECT << 16;
|
||||
break;
|
||||
case HBA_RESP_SVCRES_TMF_COMPLETE:
|
||||
case HBA_RESP_SVCRES_TMF_SUCCEEDED:
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_OK << 16;
|
||||
break;
|
||||
default:
|
||||
scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8;
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -2085,12 +2085,6 @@ do { \
|
||||
#define ASC_BUSY 0
|
||||
#define ASC_ERROR (-1)
|
||||
|
||||
/* struct scsi_cmnd function return codes */
|
||||
#define STATUS_BYTE(byte) (byte)
|
||||
#define MSG_BYTE(byte) ((byte) << 8)
|
||||
#define HOST_BYTE(byte) ((byte) << 16)
|
||||
#define DRIVER_BYTE(byte) ((byte) << 24)
|
||||
|
||||
#define ASC_STATS(shost, counter) ASC_STATS_ADD(shost, counter, 1)
|
||||
#ifndef ADVANSYS_STATS
|
||||
#define ASC_STATS_ADD(shost, counter, count)
|
||||
@@ -5986,10 +5980,10 @@ static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
|
||||
/*
|
||||
* 'done_status' contains the command's ending status.
|
||||
*/
|
||||
scp->result = 0;
|
||||
switch (scsiqp->done_status) {
|
||||
case QD_NO_ERROR:
|
||||
ASC_DBG(2, "QD_NO_ERROR\n");
|
||||
scp->result = 0;
|
||||
|
||||
/*
|
||||
* Check for an underrun condition.
|
||||
@@ -6010,47 +6004,33 @@ static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
|
||||
ASC_DBG(2, "QD_WITH_ERROR\n");
|
||||
switch (scsiqp->host_status) {
|
||||
case QHSTA_NO_ERROR:
|
||||
set_status_byte(scp, scsiqp->scsi_status);
|
||||
if (scsiqp->scsi_status == SAM_STAT_CHECK_CONDITION) {
|
||||
ASC_DBG(2, "SAM_STAT_CHECK_CONDITION\n");
|
||||
ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
|
||||
SCSI_SENSE_BUFFERSIZE);
|
||||
/*
|
||||
* Note: The 'status_byte()' macro used by
|
||||
* target drivers defined in scsi.h shifts the
|
||||
* status byte returned by host drivers right
|
||||
* by 1 bit. This is why target drivers also
|
||||
* use right shifted status byte definitions.
|
||||
* For instance target drivers use
|
||||
* CHECK_CONDITION, defined to 0x1, instead of
|
||||
* the SCSI defined check condition value of
|
||||
* 0x2. Host drivers are supposed to return
|
||||
* the status byte as it is defined by SCSI.
|
||||
*/
|
||||
scp->result = DRIVER_BYTE(DRIVER_SENSE) |
|
||||
STATUS_BYTE(scsiqp->scsi_status);
|
||||
} else {
|
||||
scp->result = STATUS_BYTE(scsiqp->scsi_status);
|
||||
set_driver_byte(scp, DRIVER_SENSE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Some other QHSTA error occurred. */
|
||||
ASC_DBG(1, "host_status 0x%x\n", scsiqp->host_status);
|
||||
scp->result = HOST_BYTE(DID_BAD_TARGET);
|
||||
set_host_byte(scp, DID_BAD_TARGET);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case QD_ABORTED_BY_HOST:
|
||||
ASC_DBG(1, "QD_ABORTED_BY_HOST\n");
|
||||
scp->result =
|
||||
HOST_BYTE(DID_ABORT) | STATUS_BYTE(scsiqp->scsi_status);
|
||||
set_status_byte(scp, scsiqp->scsi_status);
|
||||
set_host_byte(scp, DID_ABORT);
|
||||
break;
|
||||
|
||||
default:
|
||||
ASC_DBG(1, "done_status 0x%x\n", scsiqp->done_status);
|
||||
scp->result =
|
||||
HOST_BYTE(DID_ERROR) | STATUS_BYTE(scsiqp->scsi_status);
|
||||
set_status_byte(scp, scsiqp->scsi_status);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6752,10 +6732,10 @@ static void asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
|
||||
/*
|
||||
* 'qdonep' contains the command's ending status.
|
||||
*/
|
||||
scp->result = 0;
|
||||
switch (qdonep->d3.done_stat) {
|
||||
case QD_NO_ERROR:
|
||||
ASC_DBG(2, "QD_NO_ERROR\n");
|
||||
scp->result = 0;
|
||||
|
||||
/*
|
||||
* Check for an underrun condition.
|
||||
@@ -6775,51 +6755,35 @@ static void asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
|
||||
ASC_DBG(2, "QD_WITH_ERROR\n");
|
||||
switch (qdonep->d3.host_stat) {
|
||||
case QHSTA_NO_ERROR:
|
||||
set_status_byte(scp, qdonep->d3.scsi_stat);
|
||||
if (qdonep->d3.scsi_stat == SAM_STAT_CHECK_CONDITION) {
|
||||
ASC_DBG(2, "SAM_STAT_CHECK_CONDITION\n");
|
||||
ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
|
||||
SCSI_SENSE_BUFFERSIZE);
|
||||
/*
|
||||
* Note: The 'status_byte()' macro used by
|
||||
* target drivers defined in scsi.h shifts the
|
||||
* status byte returned by host drivers right
|
||||
* by 1 bit. This is why target drivers also
|
||||
* use right shifted status byte definitions.
|
||||
* For instance target drivers use
|
||||
* CHECK_CONDITION, defined to 0x1, instead of
|
||||
* the SCSI defined check condition value of
|
||||
* 0x2. Host drivers are supposed to return
|
||||
* the status byte as it is defined by SCSI.
|
||||
*/
|
||||
scp->result = DRIVER_BYTE(DRIVER_SENSE) |
|
||||
STATUS_BYTE(qdonep->d3.scsi_stat);
|
||||
} else {
|
||||
scp->result = STATUS_BYTE(qdonep->d3.scsi_stat);
|
||||
set_driver_byte(scp, DRIVER_SENSE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* QHSTA error occurred */
|
||||
ASC_DBG(1, "host_stat 0x%x\n", qdonep->d3.host_stat);
|
||||
scp->result = HOST_BYTE(DID_BAD_TARGET);
|
||||
set_host_byte(scp, DID_BAD_TARGET);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case QD_ABORTED_BY_HOST:
|
||||
ASC_DBG(1, "QD_ABORTED_BY_HOST\n");
|
||||
scp->result =
|
||||
HOST_BYTE(DID_ABORT) | MSG_BYTE(qdonep->d3.
|
||||
scsi_msg) |
|
||||
STATUS_BYTE(qdonep->d3.scsi_stat);
|
||||
set_status_byte(scp, qdonep->d3.scsi_stat);
|
||||
set_msg_byte(scp, qdonep->d3.scsi_msg);
|
||||
set_host_byte(scp, DID_ABORT);
|
||||
break;
|
||||
|
||||
default:
|
||||
ASC_DBG(1, "done_stat 0x%x\n", qdonep->d3.done_stat);
|
||||
scp->result =
|
||||
HOST_BYTE(DID_ERROR) | MSG_BYTE(qdonep->d3.
|
||||
scsi_msg) |
|
||||
STATUS_BYTE(qdonep->d3.scsi_stat);
|
||||
set_status_byte(scp, qdonep->d3.scsi_stat);
|
||||
set_msg_byte(scp, qdonep->d3.scsi_msg);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7558,7 +7522,7 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
|
||||
"sg_tablesize %d\n", use_sg,
|
||||
scp->device->host->sg_tablesize);
|
||||
scsi_dma_unmap(scp);
|
||||
scp->result = HOST_BYTE(DID_ERROR);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
return ASC_ERROR;
|
||||
}
|
||||
|
||||
@@ -7566,7 +7530,7 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
|
||||
use_sg * sizeof(struct asc_sg_list), GFP_ATOMIC);
|
||||
if (!asc_sg_head) {
|
||||
scsi_dma_unmap(scp);
|
||||
scp->result = HOST_BYTE(DID_SOFT_ERROR);
|
||||
set_host_byte(scp, DID_SOFT_ERROR);
|
||||
return ASC_ERROR;
|
||||
}
|
||||
|
||||
@@ -7809,7 +7773,7 @@ adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
|
||||
"ADV_MAX_SG_LIST %d\n", use_sg,
|
||||
scp->device->host->sg_tablesize);
|
||||
scsi_dma_unmap(scp);
|
||||
scp->result = HOST_BYTE(DID_ERROR);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
reqp->cmndp = NULL;
|
||||
scp->host_scribble = NULL;
|
||||
|
||||
@@ -7821,7 +7785,7 @@ adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
|
||||
ret = adv_get_sglist(boardp, reqp, scsiqp, scp, use_sg);
|
||||
if (ret != ADV_SUCCESS) {
|
||||
scsi_dma_unmap(scp);
|
||||
scp->result = HOST_BYTE(DID_ERROR);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
reqp->cmndp = NULL;
|
||||
scp->host_scribble = NULL;
|
||||
|
||||
@@ -8518,13 +8482,13 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
|
||||
scmd_printk(KERN_ERR, scp, "ExeScsiQueue() ASC_ERROR, "
|
||||
"err_code 0x%x\n", err_code);
|
||||
ASC_STATS(scp->device->host, exe_error);
|
||||
scp->result = HOST_BYTE(DID_ERROR);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
break;
|
||||
default:
|
||||
scmd_printk(KERN_ERR, scp, "ExeScsiQueue() unknown, "
|
||||
"err_code 0x%x\n", err_code);
|
||||
ASC_STATS(scp->device->host, exe_unknown);
|
||||
scp->result = HOST_BYTE(DID_ERROR);
|
||||
set_host_byte(scp, DID_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user