From patchwork Fri Mar 8 23:11:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10845605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B3724B76 for ; Fri, 8 Mar 2019 23:13:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6693530647 for ; Fri, 8 Mar 2019 23:13:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B28A308AB; Fri, 8 Mar 2019 23:13:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E38E030647 for ; Fri, 8 Mar 2019 23:13:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbfCHXNR (ORCPT ); Fri, 8 Mar 2019 18:13:17 -0500 Received: from mail-eopbgr820052.outbound.protection.outlook.com ([40.107.82.52]:42240 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726286AbfCHXNM (ORCPT ); Fri, 8 Mar 2019 18:13:12 -0500 Received: from DM6PR07CA0070.namprd07.prod.outlook.com (2603:10b6:5:74::47) by SN2PR07MB2543.namprd07.prod.outlook.com (2603:10b6:804:7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.19; Fri, 8 Mar 2019 23:12:31 +0000 Received: from BY2NAM05FT061.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::203) by DM6PR07CA0070.outlook.office365.com (2603:10b6:5:74::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.18 via Frontend Transport; Fri, 8 Mar 2019 23:12:30 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT061.mail.protection.outlook.com (10.152.100.198) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1686.5 via Frontend Transport; Fri, 8 Mar 2019 23:12:30 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Fri, 8 Mar 2019 15:11:26 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x28NBRNS019267; Fri, 8 Mar 2019 15:11:27 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x28NBRte019266; Fri, 8 Mar 2019 15:11:27 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 01/14] qla2xxx: Add fw_attr and port_no SysFS node Date: Fri, 8 Mar 2019 15:11:10 -0800 Message-ID: <20190308231123.19228-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190308231123.19228-1-hmadhani@marvell.com> References: <20190308231123.19228-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131965603506630203;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(136003)(396003)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(5660300002)(68736007)(316002)(54906003)(50466002)(110136005)(36906005)(1076003)(336012)(42186006)(47776003)(50226002)(2906002)(51416003)(69596002)(16586007)(6666004)(356004)(80596001)(76176011)(86362001)(106466001)(26005)(486006)(87636003)(26826003)(305945005)(53936002)(105606002)(97736004)(446003)(4326008)(498600001)(126002)(48376002)(36756003)(85426001)(8676002)(8936002)(81156014)(81166006)(11346002)(476003)(2616005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR07MB2543;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f6d4ad2-e551-46bb-ce61-08d6a41b8a0a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:SN2PR07MB2543; X-MS-TrafficTypeDiagnostic: SN2PR07MB2543: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0970508454 X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2543;23:G4Rtn+neW29avHaxkI+gO5gIUy4p4S2ehQFpQZc85tc5GjzHvuckg8Sr9tm5lSUa8MFpfJxITrRjosKhrDwGkMICw7+Daebm6b5l3RaRcqAEcuS8Qc4KGfApcp4opvNEPreaNWNzLZyHLFodqmNLCucuBIMQpW9Te6V0w6R4QS2h2YqKfSlkpfzl8nz/c1iFd6dLy3Omf2vUVU+XanAidisrOYEir0gLXAnY+s8P9Nh38wXIZF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P0FPy+Lc5Tn4u59aZ1L0XDvG/YZ+a0pqmXX34++eIKqNf36ygF3g6TjkrLOM718JSF2iBbreQeUp6hFbQC6KHtI5E0eK+JTt1Wdu9c3CXJsAHPZPGkRG7RnVDv+6oC6hkCpUiIHNqejddUWQMAc/gxxFCH2UoYh4qQFB2cQxyyMfpyyJsQIiESHTJqzYtdnPE05g54GKwPZN86fbwrua0PkN4cKqGaRgt3va5YvIX85rnzmoFmvLNtFo2GrciA8pmLhkE2iMvicyXSYy+EmotecgBdhI6VmuYGN52+qmpbCkk8x+Et7f8GsYMfY9IzevtDdc8mZiq7A6rXvYdBbEr0fpTCpWThBFbYFW0dFwF79pjP6tUJkJAzv9q8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2019 23:12:30.3996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f6d4ad2-e551-46bb-ce61-08d6a41b8a0a X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2543 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joe Carnuccio This patch adds new SysFS node to display firmware attributes and port number Signed-off-by: Joe Carnuccio Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 2eb1ae721a7d..46fcc718337b 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2162,6 +2162,32 @@ qla2x00_dif_bundle_statistics_show(struct device *dev, ha->dif_bundle_dma_allocs, ha->pool.unusable.count); } +static ssize_t +qla2x00_fw_attr_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + struct qla_hw_data *ha = vha->hw; + + if (!IS_QLA27XX(ha)) + return scnprintf(buf, PAGE_SIZE, "\n"); + + return scnprintf(buf, PAGE_SIZE, "%llx\n", + (uint64_t)ha->fw_attributes_ext[1] << 48 | + (uint64_t)ha->fw_attributes_ext[0] << 32 | + (uint64_t)ha->fw_attributes_h << 16 | + (uint64_t)ha->fw_attributes); +} + +static ssize_t +qla2x00_port_no_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + + return scnprintf(buf, PAGE_SIZE, "%u\n", vha->hw->port_no); +} + static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_driver_version_show, NULL); static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); @@ -2219,6 +2245,8 @@ static DEVICE_ATTR(dif_bundle_statistics, 0444, qla2x00_dif_bundle_statistics_show, NULL); static DEVICE_ATTR(port_speed, 0644, qla2x00_port_speed_show, qla2x00_port_speed_store); +static DEVICE_ATTR(port_no, 0444, qla2x00_port_no_show, NULL); +static DEVICE_ATTR(fw_attr, 0444, qla2x00_fw_attr_show, NULL); struct device_attribute *qla2x00_host_attrs[] = { @@ -2259,6 +2287,8 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_zio_threshold, &dev_attr_dif_bundle_statistics, &dev_attr_port_speed, + &dev_attr_port_no, + &dev_attr_fw_attr, NULL, /* reserve for qlini_mode */ NULL, /* reserve for ql2xiniexchg */ NULL, /* reserve for ql2xexchoffld */