scsi: qla2xxx: Set bit 15 for DIAG_ECHO_TEST MBC
authorJoe Carnuccio <joe.carnuccio@cavium.com>
Thu, 25 May 2017 01:06:22 +0000 (18:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 13:06:02 +0000 (15:06 +0200)
commit 1d63496516c61e2e1351f10e6becbfc9ee511395 upstream.

Set bit (BIT_15) to send right ECHO payload information for Diagnostic
Echo Test command.

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_mbx.c

index 643014f..4a6e086 100644 (file)
@@ -721,6 +721,8 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
                return -EIO;
        }
 
+       memset(&elreq, 0, sizeof(elreq));
+
        elreq.req_sg_cnt = dma_map_sg(&ha->pdev->dev,
                bsg_job->request_payload.sg_list, bsg_job->request_payload.sg_cnt,
                DMA_TO_DEVICE);
@@ -786,10 +788,9 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
 
        if (atomic_read(&vha->loop_state) == LOOP_READY &&
            (ha->current_topology == ISP_CFG_F ||
-           ((IS_QLA81XX(ha) || IS_QLA8031(ha) || IS_QLA8044(ha)) &&
-           le32_to_cpu(*(uint32_t *)req_data) == ELS_OPCODE_BYTE
-           && req_data_len == MAX_ELS_FRAME_PAYLOAD)) &&
-               elreq.options == EXTERNAL_LOOPBACK) {
+           (le32_to_cpu(*(uint32_t *)req_data) == ELS_OPCODE_BYTE &&
+            req_data_len == MAX_ELS_FRAME_PAYLOAD)) &&
+           elreq.options == EXTERNAL_LOOPBACK) {
                type = "FC_BSG_HST_VENDOR_ECHO_DIAG";
                ql_dbg(ql_dbg_user, vha, 0x701e,
                    "BSG request type: %s.\n", type);
index 23698c9..a1b01d6 100644 (file)
@@ -4783,9 +4783,9 @@ qla2x00_echo_test(scsi_qla_host_t *vha, struct msg_echo_lb *mreq,
 
        memset(mcp->mb, 0 , sizeof(mcp->mb));
        mcp->mb[0] = MBC_DIAGNOSTIC_ECHO;
-       mcp->mb[1] = mreq->options | BIT_6;     /* BIT_6 specifies 64bit address */
+       /* BIT_6 specifies 64bit address */
+       mcp->mb[1] = mreq->options | BIT_15 | BIT_6;
        if (IS_CNA_CAPABLE(ha)) {
-               mcp->mb[1] |= BIT_15;
                mcp->mb[2] = vha->fcoe_fcf_idx;
        }
        mcp->mb[16] = LSW(mreq->rcv_dma);