From patchwork Tue Jan 26 17:10:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 8125591 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E1899F1C0 for ; Tue, 26 Jan 2016 17:54:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 500FC20166 for ; Tue, 26 Jan 2016 17:54:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60B9920256 for ; Tue, 26 Jan 2016 17:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756956AbcAZRyR (ORCPT ); Tue, 26 Jan 2016 12:54:17 -0500 Received: from mx0b-0016ce01.pphosted.com ([67.231.156.153]:1037 "EHLO mx0b-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965300AbcAZRyK (ORCPT ); Tue, 26 Jan 2016 12:54:10 -0500 Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id u0QHrP9s006166; Tue, 26 Jan 2016 09:54:01 -0800 Received: from avcashub1.qlogic.com ([198.186.0.115]) by mx0b-0016ce01.pphosted.com with ESMTP id 20pdkk800u-3 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 26 Jan 2016 09:54:01 -0800 Received: from dut6217.mv.qlogic.com (172.29.56.217) by qlc.com (10.1.4.190) with Microsoft SMTP Server id 14.3.235.1; Tue, 26 Jan 2016 09:53:02 -0800 Received: by dut6217.mv.qlogic.com (Postfix, from userid 0) id 539615220BD; Tue, 26 Jan 2016 12:10:47 -0500 (EST) From: Himanshu Madhani To: , CC: , , Subject: [PATCH 08/11] qla2xxx: Provide mbx info in BBCR data after mbx failure Date: Tue, 26 Jan 2016 12:10:43 -0500 Message-ID: <1453828246-28686-9-git-send-email-himanshu.madhani@qlogic.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1453828246-28686-1-git-send-email-himanshu.madhani@qlogic.com> References: <1453828246-28686-1-git-send-email-himanshu.madhani@qlogic.com> MIME-Version: 1.0 disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8056 signatures=670683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1601100000 definitions=main-1601260296 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Harish Zunjarrao Signed-off-by: Harish Zunjarrao Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_bsg.c | 9 +++++++-- drivers/scsi/qla2xxx/qla_bsg.h | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 913fef2..392c147 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -2204,8 +2204,12 @@ qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job) if (bbcr.status == QLA_BBCR_STATUS_ENABLED) { rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa, &area, &domain, &topo, &sw_cap); - if (rval != QLA_SUCCESS) - return -EIO; + if (rval != QLA_SUCCESS) { + bbcr.status = QLA_BBCR_STATUS_UNKNOWN; + bbcr.state = QLA_BBCR_STATE_OFFLINE; + bbcr.mbx1 = loop_id; + goto done; + } state = (vha->bbcr >> 12) & 0x1; @@ -2220,6 +2224,7 @@ qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job) bbcr.configured_bbscn = vha->bbcr & 0xf; } +done: sg_copy_from_buffer(bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, &bbcr, sizeof(bbcr)); bsg_job->reply->reply_payload_rcv_len = sizeof(bbcr); diff --git a/drivers/scsi/qla2xxx/qla_bsg.h b/drivers/scsi/qla2xxx/qla_bsg.h index c40dd8b..c80192d 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.h +++ b/drivers/scsi/qla2xxx/qla_bsg.h @@ -245,6 +245,7 @@ struct qla_flash_update_caps { /* BB_CR Status */ #define QLA_BBCR_STATUS_DISABLED 0 #define QLA_BBCR_STATUS_ENABLED 1 +#define QLA_BBCR_STATUS_UNKNOWN 2 /* BB_CR State */ #define QLA_BBCR_STATE_OFFLINE 0 @@ -262,6 +263,7 @@ struct qla_bbcr_data { uint8_t configured_bbscn; /* 0-15 */ uint8_t negotiated_bbscn; /* 0-15 */ uint8_t offline_reason_code; - uint8_t reserved[11]; + uint16_t mbx1; /* Port state */ + uint8_t reserved[9]; } __packed; #endif