From patchwork Tue Mar 12 18:08: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: 10849741 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 029E01874 for ; Tue, 12 Mar 2019 18:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E47F7296DA for ; Tue, 12 Mar 2019 18:10:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7D9C297AD; Tue, 12 Mar 2019 18:10: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 80BB42978B for ; Tue, 12 Mar 2019 18:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729209AbfCLSKQ (ORCPT ); Tue, 12 Mar 2019 14:10:16 -0400 Received: from mail-eopbgr760084.outbound.protection.outlook.com ([40.107.76.84]:44674 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727832AbfCLSKN (ORCPT ); Tue, 12 Mar 2019 14:10:13 -0400 Received: from DM6PR07CA0027.namprd07.prod.outlook.com (2603:10b6:5:94::40) by DM6PR07MB5371.namprd07.prod.outlook.com (2603:10b6:5:44::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Tue, 12 Mar 2019 18:09:31 +0000 Received: from DM3NAM05FT055.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::206) by DM6PR07CA0027.outlook.office365.com (2603:10b6:5:94::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.18 via Frontend Transport; Tue, 12 Mar 2019 18:09:31 +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 DM3NAM05FT055.mail.protection.outlook.com (10.152.98.169) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1709.11 via Frontend Transport; Tue, 12 Mar 2019 18:09:31 +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; Tue, 12 Mar 2019 11:08:27 -0700 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 x2CI8QWN025670; Tue, 12 Mar 2019 11:08:26 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x2CI8Q4T025669; Tue, 12 Mar 2019 11:08:26 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v4 01/14] qla2xxx: Add fw_attr and port_no SysFS node Date: Tue, 12 Mar 2019 11:08:10 -0700 Message-ID: <20190312180823.25631-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190312180823.25631-1-hmadhani@marvell.com> References: <20190312180823.25631-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131968877717692027;(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)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(54906003)(50466002)(5660300002)(48376002)(87636003)(105606002)(1076003)(26826003)(106466001)(97736004)(498600001)(53936002)(76176011)(356004)(26005)(6666004)(126002)(4326008)(80596001)(51416003)(69596002)(336012)(2616005)(11346002)(85426001)(486006)(2906002)(110136005)(47776003)(86362001)(446003)(16586007)(50226002)(36906005)(68736007)(305945005)(316002)(36756003)(8936002)(42186006)(81166006)(81156014)(8676002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB5371;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: 4ea464c0-dcdd-4cfd-0cd6-08d6a715e03b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:DM6PR07MB5371; X-MS-TrafficTypeDiagnostic: DM6PR07MB5371: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB5371;23:ctYcoJIdeKjVPKFZDtboqYdSb81sy46QMHf/cELLBU6yEGQLIpk2omMdgEdHCd5pluYTeCc8ZCEsGsasq8VFEq968zPer0iEzPojIAQsn8EMuYonKQGmsb4fsr8yTMK+3flaKVZ3vn+Vn0h3/9CcqVqVSJH3VpYqiZGjG74CEu1NI0jMdlqGwXcAKiBAWfX4BwdLVWRmpEb8luSlyPURUvY7Xq5I0P6397EGOiahKRxY4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w+Gta3iZskJ+mIiNveQSN1qWDUw6+NDhQUb26Pj6XZ+f+PlbgsfZ+qsAF1trZESzq0CgpQOkGfGCny3uW0JWo2g+/mnkbAjaunvDcW0u9YoUX3sE3jlLgAFDKDmsX/ZB++Ajdw1XmzrnxVjNriGDhqCNbDwzovZudhiWDoO/jUIXFr+62RKpcCK+hsy0npTJze8QMkR/HZqUmJIUVlM4nMHzf0R1Wcgkb7O65zFJyAsVIXkmyGfXdCcbjneaBijd47uUsBTsmNXcM2dpsEmQjKaO40Cv5BNfxmI08GrQl/VxLQQXvUr57/zHhNNy97IlY7JUDajGLIfY2hGRxnHmKddWbs4X9uuCE1nfdBu+fnvQg8Se2zbavLJexRZ3s= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2019 18:09:31.4189 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ea464c0-dcdd-4cfd-0cd6-08d6a715e03b 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: DM6PR07MB5371 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 */