From patchwork Fri Mar 8 05:16:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10844181 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 51405180E for ; Fri, 8 Mar 2019 05:18:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 383B32EA49 for ; Fri, 8 Mar 2019 05:18:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C4FF2EACC; Fri, 8 Mar 2019 05:18:20 +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 89FD22EA49 for ; Fri, 8 Mar 2019 05:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726268AbfCHFST (ORCPT ); Fri, 8 Mar 2019 00:18:19 -0500 Received: from mail-eopbgr820072.outbound.protection.outlook.com ([40.107.82.72]:52521 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725372AbfCHFSS (ORCPT ); Fri, 8 Mar 2019 00:18:18 -0500 Received: from DM6PR07CA0009.namprd07.prod.outlook.com (2603:10b6:5:94::22) by BN7PR07MB4755.namprd07.prod.outlook.com (2603:10b6:406:f0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.20; Fri, 8 Mar 2019 05:18:13 +0000 Received: from CO1NAM05FT023.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::207) by DM6PR07CA0009.outlook.office365.com (2603:10b6:5:94::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.16 via Frontend Transport; Fri, 8 Mar 2019 05:18:12 +0000 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 CO1NAM05FT023.mail.protection.outlook.com (10.152.96.131) 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 05:18:12 +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; Thu, 7 Mar 2019 21:17:08 -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 x285H72g030791; Thu, 7 Mar 2019 21:17:07 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x285H718030790; Thu, 7 Mar 2019 21:17:07 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 01/14] qla2xxx: Add fw_attr and port_no SysFS node Date: Thu, 7 Mar 2019 21:16:51 -0800 Message-ID: <20190308051704.30752-2-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190308051704.30752-1-hmadhani@marvell.com> References: <20190308051704.30752-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131964958925727813;(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)(396003)(39860400002)(346002)(136003)(376002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(97736004)(8936002)(51416003)(69596002)(356004)(316002)(6346003)(305945005)(47776003)(53936002)(5660300002)(2906002)(110136005)(81166006)(1076003)(81156014)(42186006)(48376002)(50466002)(36756003)(76176011)(16586007)(4326008)(26005)(105606002)(68736007)(87636003)(336012)(106466001)(486006)(446003)(86362001)(11346002)(8676002)(2616005)(126002)(50226002)(476003)(80596001)(36906005)(54906003)(498600001)(6666004)(26826003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4755;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: 17edb26f-4529-4dd1-3c74-08d6a38575f3 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:BN7PR07MB4755; X-MS-TrafficTypeDiagnostic: BN7PR07MB4755: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0970508454 X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4755;23:HF7oeJKuPXutY4NqRM6bZ54Vhvj1Zd74rNnEklfLg5bMYQ+ZT+E6mm0CK8SUbypGQ4I1RcrbxulEP5nOjeJ0Dj7eTQEbXr7CjTg7fV7ixKVBZ0OOEg8i6IYHi9bE4AXdmi6VixZW72GhGVj6+2HJmdUaVOeVLcPe9AoBbZ05yEntYwxzDgm8sqcCFlMDkcZpHA6gHPRp/+WZKxZy0kk6H08EYGPge3bzc0HvWFWs071KxtbaajuUSZi4P8ZW+zMoXEZGh2Y8as6yjWMCdjIFyV0K9LqPfZ243Qp1o8AbsYvKx76ELAnZXi9oD9I3HHxw3f5UXcRCSIqw7IRS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r+26OFHG3bZ6EhHHv7esuS+bWItbXBx6vRAeNLVCIznZCa1ozahJtQBzV0u8NtpYinlaGGsUHdieteDTWltocZncErHy3HNfzrZWmFVALqWfOBkF9GsWuJES0yQc6wIisBE5jXGBKRh/fztN2Pz3fsztG0ZNkA/rX0DnsEYBCIbiOtRiGFWX0NKKnLkHB7d4cD5g285HAdyxtqjz/1gBCR5V4Ta2ssvh1ERwnvb1nsrVLgf7qha5EuVu3lz8jMeYI7DYahmCUg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2019 05:18:12.1450 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17edb26f-4529-4dd1-3c74-08d6a38575f3 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: BN7PR07MB4755 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 */