[SCSI] qla4xxx: Proper detection of firmware abort error code for ISP82xx
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>
Mon, 13 Feb 2012 13:00:45 +0000 (18:30 +0530)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 19 Feb 2012 15:33:01 +0000 (09:33 -0600)
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla4xxx/ql4_def.h
drivers/scsi/qla4xxx/ql4_nx.h
drivers/scsi/qla4xxx/ql4_os.c

index bfe68545203ff9123a58f1f9ae896b3b59293811..ec48dc30b9a2e134f55b11c231a25cbf9e43a081 100644 (file)
 #define QL4_SESS_RECOVERY_TMO          120     /* iSCSI session */
                                                /* recovery timeout */
 
-#define MSB(x) ((uint8_t)((uint16_t)(x) >> 8))
-#define LSW(x) ((uint16_t)(x))
 #define LSDW(x) ((u32)((u64)(x)))
 #define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16))
 
index dc45ac92369150eea7821fac2bacc24c8fe11311..dc7500e47b8b8e3a564cae69f4f158ec0e6a8a07 100644 (file)
@@ -623,6 +623,7 @@ struct crb_addr_pair {
 
 #define ADDR_ERROR     ((unsigned long) 0xffffffff)
 #define MAX_CTL_CHECK  1000
+#define QLA82XX_FWERROR_CODE(code)     ((code >> 8) & 0x1fffff)
 
 /***************************************************************************
  *             PCI related defines.
index 3339cc1e3390b0fb43a3761cba41e51c4b7d9477..2cd20775836f042756cd08fbe2da6a258f255e1b 100644 (file)
@@ -2165,7 +2165,7 @@ void qla4_8xxx_watchdog(struct scsi_qla_host *ha)
                                halt_status = qla4_8xxx_rd_32(ha,
                                                QLA82XX_PEG_HALT_STATUS1);
 
-                               if (LSW(MSB(halt_status)) == 0x67)
+                               if (QLA82XX_FWERROR_CODE(halt_status) == 0x67)
                                        ql4_printk(KERN_ERR, ha, "%s:"
                                                   " Firmware aborted with"
                                                   " error code 0x00006700."