From cb59aa6a7ca1ae40fd436c45dff568a83f3fab2f Mon Sep 17 00:00:00 2001 From: Sumant Patro Date: Wed, 25 Jan 2006 11:53:25 -0800 Subject: [SCSI] megaraid_sas: cleanup queue command path This patch (originally submitted by Christoph Hellwig) removes code duplication in megasas_build_cmd. It also defines MEGASAS_IOC_FIRMWARE32 to allow 64 bit compiled applications to work. Signed-off-by: Sumant Patro Rejections fixed and Signed-off-by: James Bottomley --- drivers/scsi/megaraid/megaraid_sas.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/scsi/megaraid/megaraid_sas.h') diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index eaec9d531424..67e07d30258f 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -18,10 +18,9 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.02.00-rc4" -#define MEGASAS_RELDATE "Sep 16, 2005" -#define MEGASAS_EXT_VERSION "Fri Sep 16 12:37:08 EDT 2005" - +#define MEGASAS_VERSION "00.00.02.01" +#define MEGASAS_RELDATE "Dec 19, 2005" +#define MEGASAS_EXT_VERSION "Mon Dec 19 14:36:26 PST 2005" /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -1125,11 +1124,10 @@ struct compat_megasas_iocpacket { struct compat_iovec sgl[MAX_IOCTL_SGE]; } __attribute__ ((packed)); -#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct compat_megasas_iocpacket) -#else -#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) #endif +#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) +#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen) struct megasas_mgmt_info { -- cgit v1.2.2 From 1341c939222f4d1cc8d9eb2b794f26f089fe0a61 Mon Sep 17 00:00:00 2001 From: Sumant Patro Date: Wed, 25 Jan 2006 12:02:40 -0800 Subject: [SCSI] megaraid_sas: new template defined to represent each type of controllers This patch defines a new template to represent each type of controllers (identified by the processor used). The template has members that is set with appropriate values during driver initialisation. This change is done to support new controllers with minimal change to existing code. In future, for a new controller support, a template will be declared and its members initialised appropriately. Signed-off-by: Sumant Patro Rejections fixed and Signed-off-by: James Bottomley --- drivers/scsi/megaraid/megaraid_sas.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/megaraid/megaraid_sas.h') diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 67e07d30258f..d6d166c0663f 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -18,9 +18,9 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.02.01" -#define MEGASAS_RELDATE "Dec 19, 2005" -#define MEGASAS_EXT_VERSION "Mon Dec 19 14:36:26 PST 2005" +#define MEGASAS_VERSION "00.00.02.02" +#define MEGASAS_RELDATE "Jan 23, 2006" +#define MEGASAS_EXT_VERSION "Mon Jan 23 14:09:01 PST 2006" /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -1012,6 +1012,16 @@ struct megasas_evt_detail { } __attribute__ ((packed)); + struct megasas_instance_template { + void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); + + void (*enable_intr)(struct megasas_register_set __iomem *) ; + + int (*clear_intr)(struct megasas_register_set __iomem *); + + u32 (*read_fw_status_reg)(struct megasas_register_set __iomem *); + }; + struct megasas_instance { u32 *producer; @@ -1055,6 +1065,8 @@ struct megasas_instance { u32 fw_outstanding; u32 hw_crit_error; spinlock_t instance_lock; + + struct megasas_instance_template *instancet; }; #define MEGASAS_IS_LOGICAL(scp) \ -- cgit v1.2.2 From 122da30223c06cee181044af6d32e88b256d10df Mon Sep 17 00:00:00 2001 From: Joshua Giles Date: Fri, 3 Feb 2006 15:34:17 -0800 Subject: [SCSI] megaraid_sas: register 16 byte CDB capability This patch properly registers the 16 byte command length capability of the megaraid_sas controlled hardware with the scsi midlayer. All megaraid_sas hardware supports 16 byte CDB's. Signed-off-by: Joshua Giles Signed-off-by: Sumant Patro Signed-off-by: James Bottomley --- drivers/scsi/megaraid/megaraid_sas.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/megaraid/megaraid_sas.h') diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index d6d166c0663f..917326f3770e 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -18,9 +18,9 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.02.02" -#define MEGASAS_RELDATE "Jan 23, 2006" -#define MEGASAS_EXT_VERSION "Mon Jan 23 14:09:01 PST 2006" +#define MEGASAS_VERSION "00.00.02.04" +#define MEGASAS_RELDATE "Feb 03, 2006" +#define MEGASAS_EXT_VERSION "Fri Feb 03 14:16:25 PST 2006" /* * ===================================== * MegaRAID SAS MFI firmware definitions -- cgit v1.2.2 From f9876f0b67c3f0b04ee2167602df54e7ae139ad7 Mon Sep 17 00:00:00 2001 From: Sumant Patro Date: Fri, 3 Feb 2006 15:34:35 -0800 Subject: [SCSI] megaraid_sas: support for 1078 type controller added This patch adds support for 1078 type controller (device id : 0x60). Signed-off-by: Sumant Patro Signed-off-by: James Bottomley --- drivers/scsi/megaraid/megaraid_sas.h | 49 +++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'drivers/scsi/megaraid/megaraid_sas.h') diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 917326f3770e..89639f0c38ef 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -20,7 +20,7 @@ */ #define MEGASAS_VERSION "00.00.02.04" #define MEGASAS_RELDATE "Feb 03, 2006" -#define MEGASAS_EXT_VERSION "Fri Feb 03 14:16:25 PST 2006" +#define MEGASAS_EXT_VERSION "Fri Feb 03 14:31:44 PST 2006" /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -553,31 +553,46 @@ struct megasas_ctrl_info { #define MFI_OB_INTR_STATUS_MASK 0x00000002 #define MFI_POLL_TIMEOUT_SECS 10 +#define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 +#define PCI_DEVICE_ID_LSI_SAS1078R 0x00000060 + struct megasas_register_set { + u32 reserved_0[4]; /*0000h*/ - u32 reserved_0[4]; /*0000h */ + u32 inbound_msg_0; /*0010h*/ + u32 inbound_msg_1; /*0014h*/ + u32 outbound_msg_0; /*0018h*/ + u32 outbound_msg_1; /*001Ch*/ - u32 inbound_msg_0; /*0010h */ - u32 inbound_msg_1; /*0014h */ - u32 outbound_msg_0; /*0018h */ - u32 outbound_msg_1; /*001Ch */ + u32 inbound_doorbell; /*0020h*/ + u32 inbound_intr_status; /*0024h*/ + u32 inbound_intr_mask; /*0028h*/ - u32 inbound_doorbell; /*0020h */ - u32 inbound_intr_status; /*0024h */ - u32 inbound_intr_mask; /*0028h */ + u32 outbound_doorbell; /*002Ch*/ + u32 outbound_intr_status; /*0030h*/ + u32 outbound_intr_mask; /*0034h*/ - u32 outbound_doorbell; /*002Ch */ - u32 outbound_intr_status; /*0030h */ - u32 outbound_intr_mask; /*0034h */ + u32 reserved_1[2]; /*0038h*/ - u32 reserved_1[2]; /*0038h */ + u32 inbound_queue_port; /*0040h*/ + u32 outbound_queue_port; /*0044h*/ - u32 inbound_queue_port; /*0040h */ - u32 outbound_queue_port; /*0044h */ + u32 reserved_2[22]; /*0048h*/ - u32 reserved_2; /*004Ch */ + u32 outbound_doorbell_clear; /*00A0h*/ - u32 index_registers[1004]; /*0050h */ + u32 reserved_3[3]; /*00A4h*/ + + u32 outbound_scratch_pad ; /*00B0h*/ + + u32 reserved_4[3]; /*00B4h*/ + + u32 inbound_low_queue_port ; /*00C0h*/ + + u32 inbound_high_queue_port ; /*00C4h*/ + + u32 reserved_5; /*00C8h*/ + u32 index_registers[820]; /*00CCh*/ } __attribute__ ((packed)); -- cgit v1.2.2