aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorHarihara Kadayam <harihara.kadayam@qlogic.com>2008-04-03 16:13:26 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:19:15 -0400
commit4d4df1932b6b116aecc81039066fec27f2050762 (patch)
treeee02f449a0bb456e40fcdb5287609b98e8e8f62f /drivers/scsi/qla2xxx
parentb93480e319654b8921364b49528532dff4822a45 (diff)
[SCSI] qla2xxx: Add ISP84XX support.
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com> Additional cleanups and Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.h8
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h26
-rw-r--r--drivers/scsi/qla2xxx/qla_fw.h123
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h8
-rw-r--r--drivers/scsi/qla2xxx/qla_gs.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c119
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c48
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c125
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c17
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c2
11 files changed, 454 insertions, 26 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 798cc613c44a..413d8cd6a324 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1291,7 +1291,7 @@ qla2x00_init_host_attr(scsi_qla_host_t *ha)
1291 if (IS_QLA25XX(ha)) 1291 if (IS_QLA25XX(ha))
1292 speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | 1292 speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT |
1293 FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT; 1293 FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT;
1294 else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) 1294 else if (IS_QLA24XX_TYPE(ha))
1295 speed = FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT | 1295 speed = FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
1296 FC_PORTSPEED_1GBIT; 1296 FC_PORTSPEED_1GBIT;
1297 else if (IS_QLA23XX(ha)) 1297 else if (IS_QLA23XX(ha))
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
index 2a4043b5b145..2e9c0c097f5e 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.h
+++ b/drivers/scsi/qla2xxx/qla_dbg.h
@@ -22,6 +22,7 @@
22/* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */ 22/* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */
23/* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */ 23/* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */
24/* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */ 24/* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */
25/* #define QL_DEBUG_LEVEL_16 */ /* Output ISP84XX trace msgs */
25 26
26/* 27/*
27* Macros use for debugging the driver. 28* Macros use for debugging the driver.
@@ -41,6 +42,7 @@
41#define DEBUG2_9_10(x) do { if (ql2xextended_error_logging) { x; } } while (0) 42#define DEBUG2_9_10(x) do { if (ql2xextended_error_logging) { x; } } while (0)
42#define DEBUG2_11(x) do { if (ql2xextended_error_logging) { x; } } while (0) 43#define DEBUG2_11(x) do { if (ql2xextended_error_logging) { x; } } while (0)
43#define DEBUG2_13(x) do { if (ql2xextended_error_logging) { x; } } while (0) 44#define DEBUG2_13(x) do { if (ql2xextended_error_logging) { x; } } while (0)
45#define DEBUG2_16(x) do { if (ql2xextended_error_logging) { x; } } while (0)
44 46
45#if defined(QL_DEBUG_LEVEL_3) 47#if defined(QL_DEBUG_LEVEL_3)
46#define DEBUG3(x) do {x;} while (0) 48#define DEBUG3(x) do {x;} while (0)
@@ -120,6 +122,12 @@
120#define DEBUG15(x) do {} while (0) 122#define DEBUG15(x) do {} while (0)
121#endif 123#endif
122 124
125#if defined(QL_DEBUG_LEVEL_16)
126#define DEBUG16(x) do {x;} while (0)
127#else
128#define DEBUG16(x) do {} while (0)
129#endif
130
123/* 131/*
124 * Firmware Dump structure definition 132 * Firmware Dump structure definition
125 */ 133 */
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index f7919d348ccd..b2f07649bd3d 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -24,6 +24,7 @@
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/firmware.h> 25#include <linux/firmware.h>
26#include <linux/aer.h> 26#include <linux/aer.h>
27#include <linux/mutex.h>
27#include <asm/semaphore.h> 28#include <asm/semaphore.h>
28 29
29#include <scsi/scsi.h> 30#include <scsi/scsi.h>
@@ -2142,6 +2143,21 @@ struct qla_work_evt {
2142 } u; 2143 } u;
2143}; 2144};
2144 2145
2146struct qla_chip_state_84xx {
2147 struct list_head list;
2148 struct kref kref;
2149
2150 void *bus;
2151 spinlock_t access_lock;
2152 struct mutex fw_update_mutex;
2153 uint32_t fw_update;
2154 uint32_t op_fw_version;
2155 uint32_t op_fw_size;
2156 uint32_t op_fw_seq_size;
2157 uint32_t diag_fw_version;
2158 uint32_t gold_fw_version;
2159};
2160
2145/* 2161/*
2146 * Linux Host Adapter structure 2162 * Linux Host Adapter structure
2147 */ 2163 */
@@ -2230,6 +2246,7 @@ typedef struct scsi_qla_host {
2230#define DFLG_NO_CABLE BIT_4 2246#define DFLG_NO_CABLE BIT_4
2231 2247
2232#define PCI_DEVICE_ID_QLOGIC_ISP2532 0x2532 2248#define PCI_DEVICE_ID_QLOGIC_ISP2532 0x2532
2249#define PCI_DEVICE_ID_QLOGIC_ISP8432 0x8432
2233 uint32_t device_type; 2250 uint32_t device_type;
2234#define DT_ISP2100 BIT_0 2251#define DT_ISP2100 BIT_0
2235#define DT_ISP2200 BIT_1 2252#define DT_ISP2200 BIT_1
@@ -2243,7 +2260,8 @@ typedef struct scsi_qla_host {
2243#define DT_ISP5422 BIT_9 2260#define DT_ISP5422 BIT_9
2244#define DT_ISP5432 BIT_10 2261#define DT_ISP5432 BIT_10
2245#define DT_ISP2532 BIT_11 2262#define DT_ISP2532 BIT_11
2246#define DT_ISP_LAST (DT_ISP2532 << 1) 2263#define DT_ISP8432 BIT_12
2264#define DT_ISP_LAST (DT_ISP8432 << 1)
2247 2265
2248#define DT_IIDMA BIT_26 2266#define DT_IIDMA BIT_26
2249#define DT_FWI2 BIT_27 2267#define DT_FWI2 BIT_27
@@ -2265,12 +2283,16 @@ typedef struct scsi_qla_host {
2265#define IS_QLA5422(ha) (DT_MASK(ha) & DT_ISP5422) 2283#define IS_QLA5422(ha) (DT_MASK(ha) & DT_ISP5422)
2266#define IS_QLA5432(ha) (DT_MASK(ha) & DT_ISP5432) 2284#define IS_QLA5432(ha) (DT_MASK(ha) & DT_ISP5432)
2267#define IS_QLA2532(ha) (DT_MASK(ha) & DT_ISP2532) 2285#define IS_QLA2532(ha) (DT_MASK(ha) & DT_ISP2532)
2286#define IS_QLA8432(ha) (DT_MASK(ha) & DT_ISP8432)
2268 2287
2269#define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \ 2288#define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \
2270 IS_QLA6312(ha) || IS_QLA6322(ha)) 2289 IS_QLA6312(ha) || IS_QLA6322(ha))
2271#define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha)) 2290#define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha))
2272#define IS_QLA54XX(ha) (IS_QLA5422(ha) || IS_QLA5432(ha)) 2291#define IS_QLA54XX(ha) (IS_QLA5422(ha) || IS_QLA5432(ha))
2273#define IS_QLA25XX(ha) (IS_QLA2532(ha)) 2292#define IS_QLA25XX(ha) (IS_QLA2532(ha))
2293#define IS_QLA84XX(ha) (IS_QLA8432(ha))
2294#define IS_QLA24XX_TYPE(ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \
2295 IS_QLA84XX(ha))
2274 2296
2275#define IS_IIDMA_CAPABLE(ha) ((ha)->device_type & DT_IIDMA) 2297#define IS_IIDMA_CAPABLE(ha) ((ha)->device_type & DT_IIDMA)
2276#define IS_FWI2_CAPABLE(ha) ((ha)->device_type & DT_FWI2) 2298#define IS_FWI2_CAPABLE(ha) ((ha)->device_type & DT_FWI2)
@@ -2575,6 +2597,8 @@ typedef struct scsi_qla_host {
2575#define VP_ERR_ADAP_NORESOURCES 5 2597#define VP_ERR_ADAP_NORESOURCES 5
2576 uint16_t max_npiv_vports; /* 63 or 125 per topoloty */ 2598 uint16_t max_npiv_vports; /* 63 or 125 per topoloty */
2577 int cur_vport_count; 2599 int cur_vport_count;
2600
2601 struct qla_chip_state_84xx *cs84xx;
2578} scsi_qla_host_t; 2602} scsi_qla_host_t;
2579 2603
2580 2604
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h
index c6a5e49a25be..078f2a15f40b 100644
--- a/drivers/scsi/qla2xxx/qla_fw.h
+++ b/drivers/scsi/qla2xxx/qla_fw.h
@@ -1218,4 +1218,127 @@ struct qla_fdt_layout {
1218 uint8_t protect_sec_cmd; 1218 uint8_t protect_sec_cmd;
1219 uint8_t unused2[65]; 1219 uint8_t unused2[65];
1220}; 1220};
1221
1222/* 84XX Support **************************************************************/
1223
1224#define MBA_ISP84XX_ALERT 0x800f /* Alert Notification. */
1225#define A84_PANIC_RECOVERY 0x1
1226#define A84_OP_LOGIN_COMPLETE 0x2
1227#define A84_DIAG_LOGIN_COMPLETE 0x3
1228#define A84_GOLD_LOGIN_COMPLETE 0x4
1229
1230#define MBC_ISP84XX_RESET 0x3a /* Reset. */
1231
1232#define FSTATE_REMOTE_FC_DOWN BIT_0
1233#define FSTATE_NSL_LINK_DOWN BIT_1
1234#define FSTATE_IS_DIAG_FW BIT_2
1235#define FSTATE_LOGGED_IN BIT_3
1236#define FSTATE_WAITING_FOR_VERIFY BIT_4
1237
1238#define VERIFY_CHIP_IOCB_TYPE 0x1B
1239struct verify_chip_entry_84xx {
1240 uint8_t entry_type;
1241 uint8_t entry_count;
1242 uint8_t sys_defined;
1243 uint8_t entry_status;
1244
1245 uint32_t handle;
1246
1247 uint16_t options;
1248#define VCO_DONT_UPDATE_FW BIT_0
1249#define VCO_FORCE_UPDATE BIT_1
1250#define VCO_DONT_RESET_UPDATE BIT_2
1251#define VCO_DIAG_FW BIT_3
1252#define VCO_END_OF_DATA BIT_14
1253#define VCO_ENABLE_DSD BIT_15
1254
1255 uint16_t reserved_1;
1256
1257 uint16_t data_seg_cnt;
1258 uint16_t reserved_2[3];
1259
1260 uint32_t fw_ver;
1261 uint32_t exchange_address;
1262
1263 uint32_t reserved_3[3];
1264 uint32_t fw_size;
1265 uint32_t fw_seq_size;
1266 uint32_t relative_offset;
1267
1268 uint32_t dseg_address[2];
1269 uint32_t dseg_length;
1270};
1271
1272struct verify_chip_rsp_84xx {
1273 uint8_t entry_type;
1274 uint8_t entry_count;
1275 uint8_t sys_defined;
1276 uint8_t entry_status;
1277
1278 uint32_t handle;
1279
1280 uint16_t comp_status;
1281#define CS_VCS_CHIP_FAILURE 0x3
1282#define CS_VCS_BAD_EXCHANGE 0x8
1283#define CS_VCS_SEQ_COMPLETEi 0x40
1284
1285 uint16_t failure_code;
1286#define VFC_CHECKSUM_ERROR 0x1
1287#define VFC_INVALID_LEN 0x2
1288#define VFC_ALREADY_IN_PROGRESS 0x8
1289
1290 uint16_t reserved_1[4];
1291
1292 uint32_t fw_ver;
1293 uint32_t exchange_address;
1294
1295 uint32_t reserved_2[6];
1296};
1297
1298#define ACCESS_CHIP_IOCB_TYPE 0x2B
1299struct access_chip_84xx {
1300 uint8_t entry_type;
1301 uint8_t entry_count;
1302 uint8_t sys_defined;
1303 uint8_t entry_status;
1304
1305 uint32_t handle;
1306
1307 uint16_t options;
1308#define ACO_DUMP_MEMORY 0x0
1309#define ACO_LOAD_MEMORY 0x1
1310#define ACO_CHANGE_CONFIG_PARAM 0x2
1311#define ACO_REQUEST_INFO 0x3
1312
1313 uint16_t reserved1;
1314
1315 uint16_t dseg_count;
1316 uint16_t reserved2[3];
1317
1318 uint32_t parameter1;
1319 uint32_t parameter2;
1320 uint32_t parameter3;
1321
1322 uint32_t reserved3[3];
1323 uint32_t total_byte_cnt;
1324 uint32_t reserved4;
1325
1326 uint32_t dseg_address[2];
1327 uint32_t dseg_length;
1328};
1329
1330struct access_chip_rsp_84xx {
1331 uint8_t entry_type;
1332 uint8_t entry_count;
1333 uint8_t sys_defined;
1334 uint8_t entry_status;
1335
1336 uint32_t handle;
1337
1338 uint16_t comp_status;
1339 uint16_t failure_code;
1340 uint32_t residual_count;
1341
1342 uint32_t reserved[12];
1343};
1221#endif 1344#endif
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index f2133647bf25..a9571c214a9e 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -47,6 +47,8 @@ extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
47extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *); 47extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *);
48extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *); 48extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *);
49 49
50extern void qla84xx_put_chip(struct scsi_qla_host *);
51
50/* 52/*
51 * Global Data in qla_os.c source file. 53 * Global Data in qla_os.c source file.
52 */ 54 */
@@ -150,6 +152,10 @@ extern int
150qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t); 152qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
151 153
152extern int 154extern int
155qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *, dma_addr_t, size_t,
156 uint32_t);
157
158extern int
153qla2x00_abort_command(scsi_qla_host_t *, srb_t *); 159qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
154 160
155extern int 161extern int
@@ -249,6 +255,8 @@ qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t);
249extern int 255extern int
250qla2x00_set_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t *); 256qla2x00_set_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t *);
251 257
258extern int qla84xx_verify_chip(struct scsi_qla_host *, uint16_t *);
259
252/* 260/*
253 * Global Function Prototypes in qla_isr.c source file. 261 * Global Function Prototypes in qla_isr.c source file.
254 */ 262 */
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 980ccb3eed33..750d7ef83aae 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -1532,7 +1532,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha)
1532 eiter->a.sup_speed = __constant_cpu_to_be32( 1532 eiter->a.sup_speed = __constant_cpu_to_be32(
1533 FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB| 1533 FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB|
1534 FDMI_PORT_SPEED_4GB|FDMI_PORT_SPEED_8GB); 1534 FDMI_PORT_SPEED_4GB|FDMI_PORT_SPEED_8GB);
1535 else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) 1535 else if (IS_QLA24XX_TYPE(ha))
1536 eiter->a.sup_speed = __constant_cpu_to_be32( 1536 eiter->a.sup_speed = __constant_cpu_to_be32(
1537 FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB| 1537 FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB|
1538 FDMI_PORT_SPEED_4GB); 1538 FDMI_PORT_SPEED_4GB);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 10e6995b39a7..916462ef1966 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -37,6 +37,9 @@ static int qla2x00_restart_isp(scsi_qla_host_t *);
37 37
38static int qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev); 38static int qla2x00_find_new_loop_id(scsi_qla_host_t *ha, fc_port_t *dev);
39 39
40static struct qla_chip_state_84xx *qla84xx_get_chip(struct scsi_qla_host *);
41static int qla84xx_init_chip(scsi_qla_host_t *);
42
40/****************************************************************************/ 43/****************************************************************************/
41/* QLogic ISP2x00 Hardware Support Functions. */ 44/* QLogic ISP2x00 Hardware Support Functions. */
42/****************************************************************************/ 45/****************************************************************************/
@@ -108,6 +111,14 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
108 return (rval); 111 return (rval);
109 qla2xxx_get_flash_info(ha); 112 qla2xxx_get_flash_info(ha);
110 } 113 }
114 if (IS_QLA84XX(ha)) {
115 ha->cs84xx = qla84xx_get_chip(ha);
116 if (!ha->cs84xx) {
117 qla_printk(KERN_ERR, ha,
118 "Unable to configure ISP84XX.\n");
119 return QLA_FUNCTION_FAILED;
120 }
121 }
111 rval = qla2x00_init_rings(ha); 122 rval = qla2x00_init_rings(ha);
112 123
113 return (rval); 124 return (rval);
@@ -1243,10 +1254,10 @@ static int
1243qla2x00_fw_ready(scsi_qla_host_t *ha) 1254qla2x00_fw_ready(scsi_qla_host_t *ha)
1244{ 1255{
1245 int rval; 1256 int rval;
1246 unsigned long wtime, mtime; 1257 unsigned long wtime, mtime, cs84xx_time;
1247 uint16_t min_wait; /* Minimum wait time if loop is down */ 1258 uint16_t min_wait; /* Minimum wait time if loop is down */
1248 uint16_t wait_time; /* Wait time if loop is coming ready */ 1259 uint16_t wait_time; /* Wait time if loop is coming ready */
1249 uint16_t fw_state; 1260 uint16_t state[3];
1250 1261
1251 rval = QLA_SUCCESS; 1262 rval = QLA_SUCCESS;
1252 1263
@@ -1275,12 +1286,34 @@ qla2x00_fw_ready(scsi_qla_host_t *ha)
1275 ha->host_no)); 1286 ha->host_no));
1276 1287
1277 do { 1288 do {
1278 rval = qla2x00_get_firmware_state(ha, &fw_state); 1289 rval = qla2x00_get_firmware_state(ha, state);
1279 if (rval == QLA_SUCCESS) { 1290 if (rval == QLA_SUCCESS) {
1280 if (fw_state < FSTATE_LOSS_OF_SYNC) { 1291 if (state[0] < FSTATE_LOSS_OF_SYNC) {
1281 ha->device_flags &= ~DFLG_NO_CABLE; 1292 ha->device_flags &= ~DFLG_NO_CABLE;
1282 } 1293 }
1283 if (fw_state == FSTATE_READY) { 1294 if (IS_QLA84XX(ha) && state[0] != FSTATE_READY) {
1295 DEBUG16(printk("scsi(%ld): fw_state=%x "
1296 "84xx=%x.\n", ha->host_no, state[0],
1297 state[2]));
1298 if ((state[2] & FSTATE_LOGGED_IN) &&
1299 (state[2] & FSTATE_WAITING_FOR_VERIFY)) {
1300 DEBUG16(printk("scsi(%ld): Sending "
1301 "verify iocb.\n", ha->host_no));
1302
1303 cs84xx_time = jiffies;
1304 rval = qla84xx_init_chip(ha);
1305 if (rval != QLA_SUCCESS)
1306 break;
1307
1308 /* Add time taken to initialize. */
1309 cs84xx_time = jiffies - cs84xx_time;
1310 wtime += cs84xx_time;
1311 mtime += cs84xx_time;
1312 DEBUG16(printk("scsi(%ld): Increasing "
1313 "wait time by %ld. New time %ld\n",
1314 ha->host_no, cs84xx_time, wtime));
1315 }
1316 } else if (state[0] == FSTATE_READY) {
1284 DEBUG(printk("scsi(%ld): F/W Ready - OK \n", 1317 DEBUG(printk("scsi(%ld): F/W Ready - OK \n",
1285 ha->host_no)); 1318 ha->host_no));
1286 1319
@@ -1294,7 +1327,7 @@ qla2x00_fw_ready(scsi_qla_host_t *ha)
1294 rval = QLA_FUNCTION_FAILED; 1327 rval = QLA_FUNCTION_FAILED;
1295 1328
1296 if (atomic_read(&ha->loop_down_timer) && 1329 if (atomic_read(&ha->loop_down_timer) &&
1297 fw_state != FSTATE_READY) { 1330 state[0] != FSTATE_READY) {
1298 /* Loop down. Timeout on min_wait for states 1331 /* Loop down. Timeout on min_wait for states
1299 * other than Wait for Login. 1332 * other than Wait for Login.
1300 */ 1333 */
@@ -1319,11 +1352,11 @@ qla2x00_fw_ready(scsi_qla_host_t *ha)
1319 msleep(500); 1352 msleep(500);
1320 1353
1321 DEBUG3(printk("scsi(%ld): fw_state=%x curr time=%lx.\n", 1354 DEBUG3(printk("scsi(%ld): fw_state=%x curr time=%lx.\n",
1322 ha->host_no, fw_state, jiffies)); 1355 ha->host_no, state[0], jiffies));
1323 } while (1); 1356 } while (1);
1324 1357
1325 DEBUG(printk("scsi(%ld): fw_state=%x curr time=%lx.\n", 1358 DEBUG(printk("scsi(%ld): fw_state=%x curr time=%lx.\n",
1326 ha->host_no, fw_state, jiffies)); 1359 ha->host_no, state[0], jiffies));
1327 1360
1328 if (rval) { 1361 if (rval) {
1329 DEBUG2_3(printk("scsi(%ld): Firmware ready **** FAILED ****.\n", 1362 DEBUG2_3(printk("scsi(%ld): Firmware ready **** FAILED ****.\n",
@@ -4038,3 +4071,73 @@ qla24xx_configure_vhba(scsi_qla_host_t *ha)
4038 4071
4039 return rval; 4072 return rval;
4040} 4073}
4074
4075/* 84XX Support **************************************************************/
4076
4077static LIST_HEAD(qla_cs84xx_list);
4078static DEFINE_MUTEX(qla_cs84xx_mutex);
4079
4080static struct qla_chip_state_84xx *
4081qla84xx_get_chip(struct scsi_qla_host *ha)
4082{
4083 struct qla_chip_state_84xx *cs84xx;
4084
4085 mutex_lock(&qla_cs84xx_mutex);
4086
4087 /* Find any shared 84xx chip. */
4088 list_for_each_entry(cs84xx, &qla_cs84xx_list, list) {
4089 if (cs84xx->bus == ha->pdev->bus) {
4090 kref_get(&cs84xx->kref);
4091 goto done;
4092 }
4093 }
4094
4095 cs84xx = kzalloc(sizeof(*cs84xx), GFP_KERNEL);
4096 if (!cs84xx)
4097 goto done;
4098
4099 kref_init(&cs84xx->kref);
4100 spin_lock_init(&cs84xx->access_lock);
4101 mutex_init(&cs84xx->fw_update_mutex);
4102 cs84xx->bus = ha->pdev->bus;
4103
4104 list_add_tail(&cs84xx->list, &qla_cs84xx_list);
4105done:
4106 mutex_unlock(&qla_cs84xx_mutex);
4107 return cs84xx;
4108}
4109
4110static void
4111__qla84xx_chip_release(struct kref *kref)
4112{
4113 struct qla_chip_state_84xx *cs84xx =
4114 container_of(kref, struct qla_chip_state_84xx, kref);
4115
4116 mutex_lock(&qla_cs84xx_mutex);
4117 list_del(&cs84xx->list);
4118 mutex_unlock(&qla_cs84xx_mutex);
4119 kfree(cs84xx);
4120}
4121
4122void
4123qla84xx_put_chip(struct scsi_qla_host *ha)
4124{
4125 if (ha->cs84xx)
4126 kref_put(&ha->cs84xx->kref, __qla84xx_chip_release);
4127}
4128
4129static int
4130qla84xx_init_chip(scsi_qla_host_t *ha)
4131{
4132 int rval;
4133 uint16_t status[2];
4134
4135 mutex_lock(&ha->cs84xx->fw_update_mutex);
4136
4137 rval = qla84xx_verify_chip(ha, status);
4138
4139 mutex_unlock(&ha->cs84xx->fw_update_mutex);
4140
4141 return rval != QLA_SUCCESS || status[0] ? QLA_FUNCTION_FAILED:
4142 QLA_SUCCESS;
4143}
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index e88600082c01..360af4e09d12 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -271,6 +271,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
271 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 271 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
272 uint32_t rscn_entry, host_pid; 272 uint32_t rscn_entry, host_pid;
273 uint8_t rscn_queue_index; 273 uint8_t rscn_queue_index;
274 unsigned long flags;
274 275
275 /* Setup to process RIO completion. */ 276 /* Setup to process RIO completion. */
276 handle_cnt = 0; 277 handle_cnt = 0;
@@ -432,9 +433,10 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
432 break; 433 break;
433 434
434 case MBA_LOOP_DOWN: /* Loop Down Event */ 435 case MBA_LOOP_DOWN: /* Loop Down Event */
435 DEBUG2(printk("scsi(%ld): Asynchronous LOOP DOWN (%x).\n", 436 DEBUG2(printk("scsi(%ld): Asynchronous LOOP DOWN "
436 ha->host_no, mb[1])); 437 "(%x %x %x).\n", ha->host_no, mb[1], mb[2], mb[3]));
437 qla_printk(KERN_INFO, ha, "LOOP DOWN detected (%x).\n", mb[1]); 438 qla_printk(KERN_INFO, ha, "LOOP DOWN detected (%x %x %x).\n",
439 mb[1], mb[2], mb[3]);
438 440
439 if (atomic_read(&ha->loop_state) != LOOP_DOWN) { 441 if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
440 atomic_set(&ha->loop_state, LOOP_DOWN); 442 atomic_set(&ha->loop_state, LOOP_DOWN);
@@ -640,6 +642,42 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
640 DEBUG2(printk("scsi(%ld): Trace Notification -- %04x %04x.\n", 642 DEBUG2(printk("scsi(%ld): Trace Notification -- %04x %04x.\n",
641 ha->host_no, mb[1], mb[2])); 643 ha->host_no, mb[1], mb[2]));
642 break; 644 break;
645
646 case MBA_ISP84XX_ALERT:
647 DEBUG2(printk("scsi(%ld): ISP84XX Alert Notification -- "
648 "%04x %04x %04x\n", ha->host_no, mb[1], mb[2], mb[3]));
649
650 spin_lock_irqsave(&ha->cs84xx->access_lock, flags);
651 switch (mb[1]) {
652 case A84_PANIC_RECOVERY:
653 qla_printk(KERN_INFO, ha, "Alert 84XX: panic recovery "
654 "%04x %04x\n", mb[2], mb[3]);
655 break;
656 case A84_OP_LOGIN_COMPLETE:
657 ha->cs84xx->op_fw_version = mb[3] << 16 | mb[2];
658 DEBUG2(qla_printk(KERN_INFO, ha, "Alert 84XX:"
659 "firmware version %x\n", ha->cs84xx->op_fw_version));
660 break;
661 case A84_DIAG_LOGIN_COMPLETE:
662 ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
663 DEBUG2(qla_printk(KERN_INFO, ha, "Alert 84XX:"
664 "diagnostic firmware version %x\n",
665 ha->cs84xx->diag_fw_version));
666 break;
667 case A84_GOLD_LOGIN_COMPLETE:
668 ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
669 ha->cs84xx->fw_update = 1;
670 DEBUG2(qla_printk(KERN_INFO, ha, "Alert 84XX: gold "
671 "firmware version %x\n",
672 ha->cs84xx->gold_fw_version));
673 break;
674 default:
675 qla_printk(KERN_ERR, ha,
676 "Alert 84xx: Invalid Alert %04x %04x %04x\n",
677 mb[1], mb[2], mb[3]);
678 }
679 spin_unlock_irqrestore(&ha->cs84xx->access_lock, flags);
680 break;
643 } 681 }
644 682
645 if (!ha->parent && ha->num_vhosts) 683 if (!ha->parent && ha->num_vhosts)
@@ -1747,7 +1785,7 @@ qla2x00_request_irqs(scsi_qla_host_t *ha)
1747 device_reg_t __iomem *reg = ha->iobase; 1785 device_reg_t __iomem *reg = ha->iobase;
1748 1786
1749 /* If possible, enable MSI-X. */ 1787 /* If possible, enable MSI-X. */
1750 if (!IS_QLA2432(ha) && !IS_QLA2532(ha)) 1788 if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha))
1751 goto skip_msix; 1789 goto skip_msix;
1752 1790
1753 if (IS_QLA2432(ha) && (ha->chip_revision < QLA_MSIX_CHIP_REV_24XX || 1791 if (IS_QLA2432(ha) && (ha->chip_revision < QLA_MSIX_CHIP_REV_24XX ||
@@ -1782,7 +1820,7 @@ qla2x00_request_irqs(scsi_qla_host_t *ha)
1782 "MSI-X: Falling back-to INTa mode -- %d.\n", ret); 1820 "MSI-X: Falling back-to INTa mode -- %d.\n", ret);
1783skip_msix: 1821skip_msix:
1784 1822
1785 if (!IS_QLA24XX(ha) && !IS_QLA2532(ha)) 1823 if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha))
1786 goto skip_msi; 1824 goto skip_msi;
1787 1825
1788 ret = pci_enable_msi(ha->pdev); 1826 ret = pci_enable_msi(ha->pdev);
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index beff743c536b..7d0a8a4c7719 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -682,8 +682,8 @@ qla2x00_verify_checksum(scsi_qla_host_t *ha, uint32_t risc_addr)
682 * Kernel context. 682 * Kernel context.
683 */ 683 */
684int 684int
685qla2x00_issue_iocb(scsi_qla_host_t *ha, void* buffer, dma_addr_t phys_addr, 685qla2x00_issue_iocb_timeout(scsi_qla_host_t *ha, void *buffer,
686 size_t size) 686 dma_addr_t phys_addr, size_t size, uint32_t tov)
687{ 687{
688 int rval; 688 int rval;
689 mbx_cmd_t mc; 689 mbx_cmd_t mc;
@@ -697,7 +697,7 @@ qla2x00_issue_iocb(scsi_qla_host_t *ha, void* buffer, dma_addr_t phys_addr,
697 mcp->mb[7] = LSW(MSD(phys_addr)); 697 mcp->mb[7] = LSW(MSD(phys_addr));
698 mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; 698 mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
699 mcp->in_mb = MBX_2|MBX_0; 699 mcp->in_mb = MBX_2|MBX_0;
700 mcp->tov = MBX_TOV_SECONDS; 700 mcp->tov = tov;
701 mcp->flags = 0; 701 mcp->flags = 0;
702 rval = qla2x00_mailbox_command(ha, mcp); 702 rval = qla2x00_mailbox_command(ha, mcp);
703 703
@@ -718,6 +718,14 @@ qla2x00_issue_iocb(scsi_qla_host_t *ha, void* buffer, dma_addr_t phys_addr,
718 return rval; 718 return rval;
719} 719}
720 720
721int
722qla2x00_issue_iocb(scsi_qla_host_t *ha, void *buffer, dma_addr_t phys_addr,
723 size_t size)
724{
725 return qla2x00_issue_iocb_timeout(ha, buffer, phys_addr, size,
726 MBX_TOV_SECONDS);
727}
728
721/* 729/*
722 * qla2x00_abort_command 730 * qla2x00_abort_command
723 * Abort command aborts a specified IOCB. 731 * Abort command aborts a specified IOCB.
@@ -1208,7 +1216,7 @@ gpd_error_out:
1208 * Kernel context. 1216 * Kernel context.
1209 */ 1217 */
1210int 1218int
1211qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr) 1219qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *states)
1212{ 1220{
1213 int rval; 1221 int rval;
1214 mbx_cmd_t mc; 1222 mbx_cmd_t mc;
@@ -1219,13 +1227,15 @@ qla2x00_get_firmware_state(scsi_qla_host_t *ha, uint16_t *dptr)
1219 1227
1220 mcp->mb[0] = MBC_GET_FIRMWARE_STATE; 1228 mcp->mb[0] = MBC_GET_FIRMWARE_STATE;
1221 mcp->out_mb = MBX_0; 1229 mcp->out_mb = MBX_0;
1222 mcp->in_mb = MBX_2|MBX_1|MBX_0; 1230 mcp->in_mb = MBX_3|MBX_2|MBX_1|MBX_0;
1223 mcp->tov = MBX_TOV_SECONDS; 1231 mcp->tov = MBX_TOV_SECONDS;
1224 mcp->flags = 0; 1232 mcp->flags = 0;
1225 rval = qla2x00_mailbox_command(ha, mcp); 1233 rval = qla2x00_mailbox_command(ha, mcp);
1226 1234
1227 /* Return firmware state. */ 1235 /* Return firmware states. */
1228 *dptr = mcp->mb[1]; 1236 states[0] = mcp->mb[1];
1237 states[1] = mcp->mb[2];
1238 states[2] = mcp->mb[3];
1229 1239
1230 if (rval != QLA_SUCCESS) { 1240 if (rval != QLA_SUCCESS) {
1231 /*EMPTY*/ 1241 /*EMPTY*/
@@ -2937,3 +2947,104 @@ qla2x00_dump_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t addr,
2937 2947
2938 return rval; 2948 return rval;
2939} 2949}
2950
2951/* 84XX Support **************************************************************/
2952
2953struct cs84xx_mgmt_cmd {
2954 union {
2955 struct verify_chip_entry_84xx req;
2956 struct verify_chip_rsp_84xx rsp;
2957 } p;
2958};
2959
2960int
2961qla84xx_verify_chip(struct scsi_qla_host *ha, uint16_t *status)
2962{
2963 int rval, retry;
2964 struct cs84xx_mgmt_cmd *mn;
2965 dma_addr_t mn_dma;
2966 uint16_t options;
2967 unsigned long flags;
2968
2969 DEBUG16(printk("%s(%ld): entered.\n", __func__, ha->host_no));
2970
2971 mn = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &mn_dma);
2972 if (mn == NULL) {
2973 DEBUG2_3(printk("%s(%ld): failed to allocate Verify ISP84XX "
2974 "IOCB.\n", __func__, ha->host_no));
2975 return QLA_MEMORY_ALLOC_FAILED;
2976 }
2977
2978 /* Force Update? */
2979 options = ha->cs84xx->fw_update ? VCO_FORCE_UPDATE : 0;
2980 /* Diagnostic firmware? */
2981 /* options |= MENLO_DIAG_FW; */
2982 /* We update the firmware with only one data sequence. */
2983 options |= VCO_END_OF_DATA;
2984
2985 retry = 0;
2986 do {
2987 memset(mn, 0, sizeof(*mn));
2988 mn->p.req.entry_type = VERIFY_CHIP_IOCB_TYPE;
2989 mn->p.req.entry_count = 1;
2990 mn->p.req.options = cpu_to_le16(options);
2991
2992 DEBUG16(printk("%s(%ld): Dump of Verify Request.\n", __func__,
2993 ha->host_no));
2994 DEBUG16(qla2x00_dump_buffer((uint8_t *)mn,
2995 sizeof(*mn)));
2996
2997 rval = qla2x00_issue_iocb_timeout(ha, mn, mn_dma, 0, 120);
2998 if (rval != QLA_SUCCESS) {
2999 DEBUG2_16(printk("%s(%ld): failed to issue Verify "
3000 "IOCB (%x).\n", __func__, ha->host_no, rval));
3001 goto verify_done;
3002 }
3003
3004 DEBUG16(printk("%s(%ld): Dump of Verify Response.\n", __func__,
3005 ha->host_no));
3006 DEBUG16(qla2x00_dump_buffer((uint8_t *)mn,
3007 sizeof(*mn)));
3008
3009 status[0] = le16_to_cpu(mn->p.rsp.comp_status);
3010 status[1] = status[0] == CS_VCS_CHIP_FAILURE ?
3011 le16_to_cpu(mn->p.rsp.failure_code) : 0;
3012 DEBUG2_16(printk("%s(%ld): cs=%x fc=%x\n", __func__,
3013 ha->host_no, status[0], status[1]));
3014
3015 if (status[0] != CS_COMPLETE) {
3016 rval = QLA_FUNCTION_FAILED;
3017 if (!(options & VCO_DONT_UPDATE_FW)) {
3018 DEBUG2_16(printk("%s(%ld): Firmware update "
3019 "failed. Retrying without update "
3020 "firmware.\n", __func__, ha->host_no));
3021 options |= VCO_DONT_UPDATE_FW;
3022 options &= ~VCO_FORCE_UPDATE;
3023 retry = 1;
3024 }
3025 } else {
3026 DEBUG2_16(printk("%s(%ld): firmware updated to %x.\n",
3027 __func__, ha->host_no,
3028 le32_to_cpu(mn->p.rsp.fw_ver)));
3029
3030 /* NOTE: we only update OP firmware. */
3031 spin_lock_irqsave(&ha->cs84xx->access_lock, flags);
3032 ha->cs84xx->op_fw_version =
3033 le32_to_cpu(mn->p.rsp.fw_ver);
3034 spin_unlock_irqrestore(&ha->cs84xx->access_lock,
3035 flags);
3036 }
3037 } while (retry);
3038
3039verify_done:
3040 dma_pool_free(ha->s_dma_pool, mn, mn_dma);
3041
3042 if (rval != QLA_SUCCESS) {
3043 DEBUG2_16(printk("%s(%ld): failed=%x.\n", __func__,
3044 ha->host_no, rval));
3045 } else {
3046 DEBUG16(printk("%s(%ld): done.\n", __func__, ha->host_no));
3047 }
3048
3049 return rval;
3050}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 5cddc503bd2b..4c50b9b53d23 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -339,6 +339,8 @@ qla24xx_fw_version_str(struct scsi_qla_host *ha, char *str)
339 strcat(str, "[T10 CRC] "); 339 strcat(str, "[T10 CRC] ");
340 if (ha->fw_attributes & BIT_5) 340 if (ha->fw_attributes & BIT_5)
341 strcat(str, "[VI] "); 341 strcat(str, "[VI] ");
342 if (ha->fw_attributes & BIT_10)
343 strcat(str, "[84XX] ");
342 if (ha->fw_attributes & BIT_13) 344 if (ha->fw_attributes & BIT_13)
343 strcat(str, "[Experimental]"); 345 strcat(str, "[Experimental]");
344 return str; 346 return str;
@@ -1378,6 +1380,13 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha)
1378 ha->device_type |= DT_IIDMA; 1380 ha->device_type |= DT_IIDMA;
1379 ha->fw_srisc_address = RISC_START_ADDRESS_2400; 1381 ha->fw_srisc_address = RISC_START_ADDRESS_2400;
1380 break; 1382 break;
1383 case PCI_DEVICE_ID_QLOGIC_ISP8432:
1384 ha->device_type |= DT_ISP8432;
1385 ha->device_type |= DT_ZIO_SUPPORTED;
1386 ha->device_type |= DT_FWI2;
1387 ha->device_type |= DT_IIDMA;
1388 ha->fw_srisc_address = RISC_START_ADDRESS_2400;
1389 break;
1381 case PCI_DEVICE_ID_QLOGIC_ISP5422: 1390 case PCI_DEVICE_ID_QLOGIC_ISP5422:
1382 ha->device_type |= DT_ISP5422; 1391 ha->device_type |= DT_ISP5422;
1383 ha->device_type |= DT_FWI2; 1392 ha->device_type |= DT_FWI2;
@@ -1501,6 +1510,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1501 sht = &qla2x00_driver_template; 1510 sht = &qla2x00_driver_template;
1502 if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || 1511 if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 ||
1503 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432 || 1512 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432 ||
1513 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP8432 ||
1504 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5422 || 1514 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5422 ||
1505 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5432 || 1515 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5432 ||
1506 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2532) { 1516 pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2532) {
@@ -1591,7 +1601,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1591 if (IS_QLA2322(ha) || IS_QLA6322(ha)) 1601 if (IS_QLA2322(ha) || IS_QLA6322(ha))
1592 ha->optrom_size = OPTROM_SIZE_2322; 1602 ha->optrom_size = OPTROM_SIZE_2322;
1593 ha->isp_ops = &qla2300_isp_ops; 1603 ha->isp_ops = &qla2300_isp_ops;
1594 } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { 1604 } else if (IS_QLA24XX_TYPE(ha)) {
1595 host->max_id = MAX_TARGETS_2200; 1605 host->max_id = MAX_TARGETS_2200;
1596 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1606 ha->mbx_count = MAILBOX_REGISTER_COUNT;
1597 ha->request_q_length = REQUEST_ENTRY_CNT_24XX; 1607 ha->request_q_length = REQUEST_ENTRY_CNT_24XX;
@@ -1736,6 +1746,8 @@ qla2x00_remove_one(struct pci_dev *pdev)
1736 1746
1737 qla2x00_dfs_remove(ha); 1747 qla2x00_dfs_remove(ha);
1738 1748
1749 qla84xx_put_chip(ha);
1750
1739 qla2x00_free_sysfs_attr(ha); 1751 qla2x00_free_sysfs_attr(ha);
1740 1752
1741 fc_remove_host(ha->host); 1753 fc_remove_host(ha->host);
@@ -2642,7 +2654,7 @@ qla2x00_request_firmware(scsi_qla_host_t *ha)
2642 blob = &qla_fw_blobs[FW_ISP2300]; 2654 blob = &qla_fw_blobs[FW_ISP2300];
2643 } else if (IS_QLA2322(ha) || IS_QLA6322(ha)) { 2655 } else if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
2644 blob = &qla_fw_blobs[FW_ISP2322]; 2656 blob = &qla_fw_blobs[FW_ISP2322];
2645 } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { 2657 } else if (IS_QLA24XX_TYPE(ha)) {
2646 blob = &qla_fw_blobs[FW_ISP24XX]; 2658 blob = &qla_fw_blobs[FW_ISP24XX];
2647 } else if (IS_QLA25XX(ha)) { 2659 } else if (IS_QLA25XX(ha)) {
2648 blob = &qla_fw_blobs[FW_ISP25XX]; 2660 blob = &qla_fw_blobs[FW_ISP25XX];
@@ -2792,6 +2804,7 @@ static struct pci_device_id qla2xxx_pci_tbl[] = {
2792 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322) }, 2804 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322) },
2793 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422) }, 2805 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422) },
2794 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) }, 2806 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) },
2807 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP8432) },
2795 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) }, 2808 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) },
2796 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) }, 2809 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) },
2797 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2532) }, 2810 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2532) },
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index eda11f6f5e52..1728ab3ccb20 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -553,7 +553,7 @@ qla2xxx_get_flash_info(scsi_qla_host_t *ha)
553 struct qla_fdt_layout *fdt; 553 struct qla_fdt_layout *fdt;
554 uint8_t man_id, flash_id; 554 uint8_t man_id, flash_id;
555 555
556 if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) 556 if (!IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha))
557 return; 557 return;
558 558
559 wptr = (uint16_t *)ha->request_ring; 559 wptr = (uint16_t *)ha->request_ring;