qla2xxx: Add adapter checks for FAWWN functionality.
authorSaurav Kashyap <saurav.kashyap@qlogic.com>
Tue, 4 Aug 2015 17:37:55 +0000 (13:37 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 27 Aug 2015 00:43:59 +0000 (17:43 -0700)
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_mbx.c

index ac88c4e7cf13040f284d660e0b524b65364ad4e2..cbcc6fc9f5622b5e876cefc891f76e1d33220d66 100644 (file)
@@ -3164,6 +3164,7 @@ struct qla_hw_data {
 #define IS_TGT_MODE_CAPABLE(ha)        (ha->tgt.atio_q_length)
 #define IS_SHADOW_REG_CAPABLE(ha)  (IS_QLA27XX(ha))
 #define IS_DPORT_CAPABLE(ha)  (IS_QLA83XX(ha) || IS_QLA27XX(ha))
+#define IS_FAWWN_CAPABLE(ha)   (IS_QLA83XX(ha) || IS_QLA27XX(ha))
 
        /* HBA serial number */
        uint8_t         serial0;
index 6e22052afc89bf138815181a7cba8cdae66bd37f..62a83e39f6ed7888a21be63ebcdf1732ae53be45 100644 (file)
@@ -1135,20 +1135,22 @@ qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa,
                        vha->fcoe_vn_port_mac[0] = mcp->mb[13] & 0xff;
                }
                /* If FA-WWN supported */
-               if (mcp->mb[7] & BIT_14) {
-                       vha->port_name[0] = MSB(mcp->mb[16]);
-                       vha->port_name[1] = LSB(mcp->mb[16]);
-                       vha->port_name[2] = MSB(mcp->mb[17]);
-                       vha->port_name[3] = LSB(mcp->mb[17]);
-                       vha->port_name[4] = MSB(mcp->mb[18]);
-                       vha->port_name[5] = LSB(mcp->mb[18]);
-                       vha->port_name[6] = MSB(mcp->mb[19]);
-                       vha->port_name[7] = LSB(mcp->mb[19]);
-                       fc_host_port_name(vha->host) =
-                           wwn_to_u64(vha->port_name);
-                       ql_dbg(ql_dbg_mbx, vha, 0x10ca,
-                           "FA-WWN acquired %016llx\n",
-                           wwn_to_u64(vha->port_name));
+               if (IS_FAWWN_CAPABLE(vha->hw)) {
+                       if (mcp->mb[7] & BIT_14) {
+                               vha->port_name[0] = MSB(mcp->mb[16]);
+                               vha->port_name[1] = LSB(mcp->mb[16]);
+                               vha->port_name[2] = MSB(mcp->mb[17]);
+                               vha->port_name[3] = LSB(mcp->mb[17]);
+                               vha->port_name[4] = MSB(mcp->mb[18]);
+                               vha->port_name[5] = LSB(mcp->mb[18]);
+                               vha->port_name[6] = MSB(mcp->mb[19]);
+                               vha->port_name[7] = LSB(mcp->mb[19]);
+                               fc_host_port_name(vha->host) =
+                                   wwn_to_u64(vha->port_name);
+                               ql_dbg(ql_dbg_mbx, vha, 0x10ca,
+                                   "FA-WWN acquired %016llx\n",
+                                   wwn_to_u64(vha->port_name));
+                       }
                }
        }