qla4xxx: add support for qla4032
Subsystems (2)
PATCH 1/1 qla4xxx: add support for qla4032
The following patch provides the following:
1. adds support for the next version of Qlogic's iSCSI HBA, qla4032 (PCI Device ID 4032).
2. removes dead code related to topcat chip and renames qla4010_soft_reset to qla4xxx_soft_reset (minor changes).
--- drivers/scsi/qla4xxx/ql4_dbg.c | 4 + drivers/scsi/qla4xxx/ql4_def.h | 105 ++++++++++++++++++++---------------- drivers/scsi/qla4xxx/ql4_fw.h | 7 ++ drivers/scsi/qla4xxx/ql4_glbl.h | 2 - drivers/scsi/qla4xxx/ql4_init.c | 45 +++------------ drivers/scsi/qla4xxx/ql4_inline.h | 4 + drivers/scsi/qla4xxx/ql4_iocb.c | 6 ++ drivers/scsi/qla4xxx/ql4_isr.c | 1 drivers/scsi/qla4xxx/ql4_nvram.c | 6 +- drivers/scsi/qla4xxx/ql4_nvram.h | 4 - drivers/scsi/qla4xxx/ql4_os.c | 80 ++++----------------------- drivers/scsi/qla4xxx/ql4_version.h | 4 - 12 files changed, 101 insertions(+), 167 deletions(-)
drivers/scsi/qla4xxx/ql4_dbg.c +2 -2
@@ -71,7 +71,7 @@ void __dump_registers(struct scsi_qla_ho readw(&ha->reg->u1.isp4010.nvram)); } -else if (is_qla4022 (ha)) { +else if (is_qla4022 (ha) |is_qla4032 (ha)) {printk (KERN_INFO "0x%02X intr_mask = 0x%08X\n" , (uint8_t ) offsetof(struct isp_reg , u1.isp4022.intr_mask),
@@ -119,7 +119,7 @@ void __dump_registers(struct scsi_qla_ho readw(&ha->reg->u2.isp4010.port_err_status)); } -else if (is_qla4022 (ha)) { +else if (is_qla4022 (ha) |is_qla4032 (ha)) {printk (KERN_INFO "Page 0 Registers:\n" ); printk(KERN_INFO "0x%02X ext_hw_conf = 0x%08X\n", (uint8_t) offsetof(struct isp_reg,
drivers/scsi/qla4xxx/ql4_def.h +57 -48
210 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_fw.h +6 -1
@@ -296,7 +296,6 @@ #define NVR_WRITE_ENABLE 0x00000010 /*/* ISP Semaphore definitions */ /* ISP General Purpose Output definitions */ -#define GPOR_TOPCAT_RESET 0x00000004/* shadow registers (DMA'd from HA to system memory. read only) */ struct shadow_regs {
@@ -339,10 +338,13 @@ union external_hw_config_reg {/* Mailbox command definitions */ #define MBOX_CMD_ABOUT_FW 0x0009#define MBOX_CMD_LUN_RESET 0x0016 +#define MBOX_CMD_GET_MANAGEMENT_DATA 0x001E#define MBOX_CMD_GET_FW_STATUS 0x001F#define MBOX_CMD_SET_ISNS_SERVICE 0x0021#define ISNS_DISABLE 0#define ISNS_ENABLE 1 +#define MBOX_CMD_COPY_FLASH 0x0024 +#define MBOX_CMD_WRITE_FLASH 0x0025#define MBOX_CMD_READ_FLASH 0x0026#define MBOX_CMD_CLEAR_DATABASE_ENTRY 0x0031#define MBOX_CMD_CONN_CLOSE_SESS_LOGOUT 0x0056
@@ -360,10 +362,13 @@ #define DDB_DS_SESSION_ACTIVE 0x04#define DDB_DS_SESSION_FAILED 0x06#define DDB_DS_LOGIN_IN_PROCESS 0x07#define MBOX_CMD_GET_FW_STATE 0x0069 +#define MBOX_CMD_GET_INIT_FW_CTRL_BLOCK_DEFAULTS 0x006A +#define MBOX_CMD_RESTORE_FACTORY_DEFAULTS 0x0087/* Mailbox 1 */ #define FW_STATE_READY 0x0000#define FW_STATE_CONFIG_WAIT 0x0001 +#define FW_STATE_WAIT_LOGIN 0x0002#define FW_STATE_ERROR 0x0004#define FW_STATE_DHCP_IN_PROGRESS 0x0008
drivers/scsi/qla4xxx/ql4_glbl.h +1 -1
@@ -75,4 +75,4 @@ int qla4xxx_process_ddb_changed(struct sextern int qla4_extended_error_logging;extern int ql4xdiscoverywait;extern int ql4xdontresethba; -#endif /* _QLA4x_GBL_H */ +#endif /* _QLA4x_GBL_H */
drivers/scsi/qla4xxx/ql4_init.c +10 -35
78 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_inline.h +2 -2
@@ -38,7 +38,7 @@ qla4xxx_lookup_ddb_by_fw_index(struct scstatic inline void __qla4xxx_enable_intrs (struct scsi_qla_host *ha) { -if (is_qla4022 (ha)) { +if (is_qla4022 (ha) |is_qla4032 (ha)) {writel (set_rmask (IMR_SCSI_INTR_ENABLE ), &ha->reg->u1.isp4022.intr_mask);readl (&ha->reg->u1.isp4022.intr_mask);
@@ -52,7 +52,7 @@ __qla4xxx_enable_intrs(struct scsi_qla_hstatic inline void __qla4xxx_disable_intrs (struct scsi_qla_host *ha) { -if (is_qla4022 (ha)) { +if (is_qla4022 (ha) |is_qla4032 (ha)) {writel (clr_rmask (IMR_SCSI_INTR_ENABLE ), &ha->reg->u1.isp4022.intr_mask);readl (&ha->reg->u1.isp4022.intr_mask);
drivers/scsi/qla4xxx/ql4_iocb.c +6 -0
@@ -294,6 +294,12 @@ int qla4xxx_send_command_to_isp(struct s cmd_entry->control_flags =CF_WRITE ; else if (cmd->sc_data_direction == DMA_FROM_DEVICE) cmd_entry->control_flags = CF_READ; + + ha->bytes_xfered += cmd->request_bufflen; +if (ha->bytes_xfered & ~0xFFFFF ){ + ha->total_mbytes_xferred += ha->bytes_xfered >>20 ; + ha->bytes_xfered &=0xFFFFF ; + } }/* Set tagged queueing control flags */
drivers/scsi/qla4xxx/ql4_isr.c +1 -0
@@ -627,6 +627,7 @@ irqreturn_t qla4xxx_intr_handler(int irqspin_lock_irqsave (&ha->hardware_lock, flags); + ha->isr_count++;/* * Repeatedly service interrupts up to a maximum of * MAX_REQS_SERVICED_PER_INTR
drivers/scsi/qla4xxx/ql4_nvram.c +3 -3
@@ -9,13 +9,13 @@ #include "ql4_def.h"static inline int eeprom_size (struct scsi_qla_host *ha) { -return is_qla4022 (ha) ?FM93C86A_SIZE_16 :FM93C66A_SIZE_16 ; +return is_qla4010 (ha) ?FM93C66A_SIZE_16 :FM93C86A_SIZE_16 ; }static inline int eeprom_no_addr_bits (struct scsi_qla_host *ha) { -return is_qla4022 (ha) ?FM93C86A_NO_ADDR_BITS_16 : -FM93C56A_NO_ADDR_BITS_16 ; +return is_qla4010 (ha) ?FM93C56A_NO_ADDR_BITS_16 : +FM93C86A_NO_ADDR_BITS_16 ; }static inline int eeprom_no_data_bits (struct scsi_qla_host *ha)
drivers/scsi/qla4xxx/ql4_nvram.h +1 -3
@@ -134,9 +134,7 @@ #define MAC_CONFIG_ENABLE_PAUSE 0x00u16 phyConfig;/* x36 */ #define PHY_CONFIG_PHY_ADDR_MASK 0x1f#define PHY_CONFIG_ENABLE_FW_MANAGEMENT_MASK 0x20 -u16 topcat;/* x38 */ -#define TOPCAT_PRESENT 0x0100 -#define TOPCAT_MASK 0xFF00 +u16 reserved_56;/* x38 */ #define EEPROM_UNUSED_1_SIZE 2u8 unused_1[EEPROM_UNUSED_1_SIZE ];/* x3A */
drivers/scsi/qla4xxx/ql4_os.c +12 -68
130 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_version.h +0 -4
@@ -7,7 +7,3 @@#define QLA4XXX_DRIVER_VERSION "5.00.05b9-k" -#define QL4_DRIVER_MAJOR_VER 5 -#define QL4_DRIVER_MINOR_VER 0 -#define QL4_DRIVER_PATCH_VER 5 -#define QL4_DRIVER_BETA_VER 9
Signature · 1 line
1.4.2.3
Quoted 6 lines · David C Somayajulu
The following patch provides the following:
1. adds support for the next version of Qlogic's iSCSI HBA, qla4032 (PCI Device ID 4032).
2. removes dead code related to topcat chip and renamesqla4010_soft_resettoqla4xxx_soft_reset(minor changes).
This patch adds some trailing whitespaces.
Adds trailing whitespace.
.dotest/patch:47:#endif
Adds trailing whitespace.
.dotest/patch:51:#endif
Could you clean that up?
Also this patch applied with fuzz. Was it made against the current upstream qla4xxx code or is this from another kernel?
Quoted 8 lines · Mike Christie
Quoted 6 lines · David C Somayajulu
The following patch provides the following:
1. adds support for the next version of Qlogic's iSCSI HBA, qla4032 (PCI Device ID 4032).
2. removes dead code related to topcat chip and renamesqla4010_soft_resettoqla4xxx_soft_reset(minor changes).
Quoted 8 lines
This patch adds some trailing whitespaces.
Adds trailing whitespace.
.dotest/patch:47:#endif
Adds trailing whitespace.
.dotest/patch:51:#endifCould you clean that up?
Will fix and repost.
Quoted 3 lines
Also this patch applied with fuzz. Was it made against the current upstream qla4xxx code or is this from another kernel?
I generated it against scsi-misc.
Quoted 15 lines · Mike Christie
Quoted 6 lines · David C Somayajulu
The following patch provides the following:
1. adds support for the next version of Qlogic's iSCSI HBA, qla4032 (PCI Device ID 4032).
2. removes dead code related to topcat chip and renamesqla4010_soft_resettoqla4xxx_soft_reset(minor changes).This patch adds some trailing whitespaces.
Adds trailing whitespace.
.dotest/patch:47:#endif
Adds trailing whitespace.
.dotest/patch:51:#endif
Quoted 4 lines
Could you clean that up?
Also this patch applied with fuzz. Was it made against the current upstream qla4xxx code or is this from another kernel?
Here it is with the fixes.
The patch has been generated with reference to scsi-misc-2.6.git
It also depends on the inclusion of patch titled
[PATCH] [SCSI] qla4xxx: bug fix: driver hardware semaphore needs to be grabbed before soft reset
http://marc.theaimsgroup.com/?l=linux-scsi&m=116363770318846&w=2
--- drivers/scsi/qla4xxx/ql4_dbg.c | 4 + drivers/scsi/qla4xxx/ql4_def.h | 105 ++++++++++++++++++++---------------- drivers/scsi/qla4xxx/ql4_fw.h | 7 ++ drivers/scsi/qla4xxx/ql4_glbl.h | 2 - drivers/scsi/qla4xxx/ql4_init.c | 45 +++------------ drivers/scsi/qla4xxx/ql4_inline.h | 4 + drivers/scsi/qla4xxx/ql4_iocb.c | 6 ++ drivers/scsi/qla4xxx/ql4_isr.c | 1 drivers/scsi/qla4xxx/ql4_nvram.c | 6 +- drivers/scsi/qla4xxx/ql4_nvram.h | 4 - drivers/scsi/qla4xxx/ql4_os.c | 75 +++----------------------- drivers/scsi/qla4xxx/ql4_version.h | 2 - 12 files changed, 98 insertions(+), 163 deletions(-)
drivers/scsi/qla4xxx/ql4_dbg.c +2 -2
@@ -71,7 +71,7 @@ void __dump_registers(struct scsi_qla_ho readw(&ha->reg->u1.isp4010.nvram)); } -else if (is_qla4022 (ha)) { +else if (is_qla4022 (ha) |is_qla4032 (ha)) {printk (KERN_INFO "0x%02X intr_mask = 0x%08X\n" , (uint8_t ) offsetof(struct isp_reg , u1.isp4022.intr_mask),
@@ -119,7 +119,7 @@ void __dump_registers(struct scsi_qla_ho readw(&ha->reg->u2.isp4010.port_err_status)); } -else if (is_qla4022 (ha)) { +else if (is_qla4022 (ha) |is_qla4032 (ha)) {printk (KERN_INFO "Page 0 Registers:\n" ); printk(KERN_INFO "0x%02X ext_hw_conf = 0x%08X\n", (uint8_t) offsetof(struct isp_reg,
drivers/scsi/qla4xxx/ql4_def.h +57 -48
210 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_fw.h +6 -1
@@ -296,7 +296,6 @@ #define NVR_WRITE_ENABLE 0x00000010 /*/* ISP Semaphore definitions */ /* ISP General Purpose Output definitions */ -#define GPOR_TOPCAT_RESET 0x00000004/* shadow registers (DMA'd from HA to system memory. read only) */ struct shadow_regs {
@@ -339,10 +338,13 @@ union external_hw_config_reg {/* Mailbox command definitions */ #define MBOX_CMD_ABOUT_FW 0x0009#define MBOX_CMD_LUN_RESET 0x0016 +#define MBOX_CMD_GET_MANAGEMENT_DATA 0x001E#define MBOX_CMD_GET_FW_STATUS 0x001F#define MBOX_CMD_SET_ISNS_SERVICE 0x0021#define ISNS_DISABLE 0#define ISNS_ENABLE 1 +#define MBOX_CMD_COPY_FLASH 0x0024 +#define MBOX_CMD_WRITE_FLASH 0x0025#define MBOX_CMD_READ_FLASH 0x0026#define MBOX_CMD_CLEAR_DATABASE_ENTRY 0x0031#define MBOX_CMD_CONN_CLOSE_SESS_LOGOUT 0x0056
@@ -360,10 +362,13 @@ #define DDB_DS_SESSION_ACTIVE 0x04#define DDB_DS_SESSION_FAILED 0x06#define DDB_DS_LOGIN_IN_PROCESS 0x07#define MBOX_CMD_GET_FW_STATE 0x0069 +#define MBOX_CMD_GET_INIT_FW_CTRL_BLOCK_DEFAULTS 0x006A +#define MBOX_CMD_RESTORE_FACTORY_DEFAULTS 0x0087/* Mailbox 1 */ #define FW_STATE_READY 0x0000#define FW_STATE_CONFIG_WAIT 0x0001 +#define FW_STATE_WAIT_LOGIN 0x0002#define FW_STATE_ERROR 0x0004#define FW_STATE_DHCP_IN_PROGRESS 0x0008
drivers/scsi/qla4xxx/ql4_glbl.h +1 -1
@@ -76,4 +76,4 @@ int qla4xxx_process_ddb_changed(struct sextern int qla4_extended_error_logging;extern int ql4xdiscoverywait;extern int ql4xdontresethba; -#endif /* _QLA4x_GBL_H */ +#endif /* _QLA4x_GBL_H */
drivers/scsi/qla4xxx/ql4_init.c +10 -35
78 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_inline.h +2 -2
@@ -38,7 +38,7 @@ qla4xxx_lookup_ddb_by_fw_index(struct scstatic inline void __qla4xxx_enable_intrs (struct scsi_qla_host *ha) { -if (is_qla4022 (ha)) { +if (is_qla4022 (ha) |is_qla4032 (ha)) {writel (set_rmask (IMR_SCSI_INTR_ENABLE ), &ha->reg->u1.isp4022.intr_mask);readl (&ha->reg->u1.isp4022.intr_mask);
@@ -52,7 +52,7 @@ __qla4xxx_enable_intrs(struct scsi_qla_hstatic inline void __qla4xxx_disable_intrs (struct scsi_qla_host *ha) { -if (is_qla4022 (ha)) { +if (is_qla4022 (ha) |is_qla4032 (ha)) {writel (clr_rmask (IMR_SCSI_INTR_ENABLE ), &ha->reg->u1.isp4022.intr_mask);readl (&ha->reg->u1.isp4022.intr_mask);
drivers/scsi/qla4xxx/ql4_iocb.c +6 -0
@@ -294,6 +294,12 @@ int qla4xxx_send_command_to_isp(struct s cmd_entry->control_flags =CF_WRITE ; else if (cmd->sc_data_direction == DMA_FROM_DEVICE) cmd_entry->control_flags = CF_READ; + + ha->bytes_xfered += cmd->request_bufflen; +if (ha->bytes_xfered & ~0xFFFFF ){ + ha->total_mbytes_xferred += ha->bytes_xfered >>20 ; + ha->bytes_xfered &=0xFFFFF ; + } }/* Set tagged queueing control flags */
drivers/scsi/qla4xxx/ql4_isr.c +1 -0
@@ -627,6 +627,7 @@ irqreturn_t qla4xxx_intr_handler(int irqspin_lock_irqsave (&ha->hardware_lock, flags); + ha->isr_count++;/* * Repeatedly service interrupts up to a maximum of * MAX_REQS_SERVICED_PER_INTR
drivers/scsi/qla4xxx/ql4_nvram.c +3 -3
@@ -9,13 +9,13 @@ #include "ql4_def.h"static inline int eeprom_size (struct scsi_qla_host *ha) { -return is_qla4022 (ha) ?FM93C86A_SIZE_16 :FM93C66A_SIZE_16 ; +return is_qla4010 (ha) ?FM93C66A_SIZE_16 :FM93C86A_SIZE_16 ; }static inline int eeprom_no_addr_bits (struct scsi_qla_host *ha) { -return is_qla4022 (ha) ?FM93C86A_NO_ADDR_BITS_16 : -FM93C56A_NO_ADDR_BITS_16 ; +return is_qla4010 (ha) ?FM93C56A_NO_ADDR_BITS_16 : +FM93C86A_NO_ADDR_BITS_16 ; }static inline int eeprom_no_data_bits (struct scsi_qla_host *ha)
drivers/scsi/qla4xxx/ql4_nvram.h +1 -3
@@ -134,9 +134,7 @@ #define MAC_CONFIG_ENABLE_PAUSE 0x00u16 phyConfig;/* x36 */ #define PHY_CONFIG_PHY_ADDR_MASK 0x1f#define PHY_CONFIG_ENABLE_FW_MANAGEMENT_MASK 0x20 -u16 topcat;/* x38 */ -#define TOPCAT_PRESENT 0x0100 -#define TOPCAT_MASK 0xFF00 +u16 reserved_56;/* x38 */ #define EEPROM_UNUSED_1_SIZE 2u8 unused_1[EEPROM_UNUSED_1_SIZE ];/* x3A */
drivers/scsi/qla4xxx/ql4_os.c +8 -67
113 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_version.h +1 -1
@@ -5,4 +5,4 @@* See LICENSE.qla4xxx for copyright and licensing details. */ -#define QLA4XXX_DRIVER_VERSION "5.00.06-k" +#define QLA4XXX_DRIVER_VERSION "5.00.07-k"
Signature · 1 line
1.4.2.3