From patchwork Mon Jan 22 12:46:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10178455 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB74460224 for ; Mon, 22 Jan 2018 12:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9296281DB for ; Mon, 22 Jan 2018 12:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD2B28236; Mon, 22 Jan 2018 12:47:12 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 3D888281DB for ; Mon, 22 Jan 2018 12:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751140AbeAVMrK (ORCPT ); Mon, 22 Jan 2018 07:47:10 -0500 Received: from mail-bl2nam02on0074.outbound.protection.outlook.com ([104.47.38.74]:1664 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751113AbeAVMrG (ORCPT ); Mon, 22 Jan 2018 07:47:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=j5WpWb+wTPRA88M1Bf109E8TQTtWbVmStC2wS7AsUFA=; b=f3NZcZzraDU29J/ul/haAbeymXxkJQY2bU+ebne4WwgaBvHjY8tX5AISmQpd89Ln8rR0Iuj+e/nEfKT6Zv2zQKRw5RneQutHq2bZD/OwaVx36CBumXPqQ0ofT/WX3AXKdyJy+XbVjRHPErsFFmEESZoabHN7JWlc/wxZAK9I828= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.5; Mon, 22 Jan 2018 12:47:03 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov Subject: [PATCH 05/11] qtnfmac: report hardware/firmware information via ethtool Date: Mon, 22 Jan 2018 15:46:28 +0300 Message-Id: <20180122124634.8430-6-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180122124634.8430-1-sergey.matyukevich.os@quantenna.com> References: <20180122124634.8430-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: VI1PR08CA0220.eurprd08.prod.outlook.com (10.170.234.157) To CY1PR05MB1931.namprd05.prod.outlook.com (10.162.216.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41eaccf6-3d60-4ee5-d20f-08d561963d61 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:CY1PR05MB1931; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB1931; 3:pqVWMcrgleWJcLdrh8YAO4kOMdg/RflImZN1zeG77BKtxXGqa9pS7hHoOUP56O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k7mrvTORAM+WferMIzfmFN/KuXDZjASPNIMIxynmY+7hoC+IvgLtzgMFs92WyW2m5cOcQPHhVtpc/vLaobpwCF1v8No6BF4skdxviKGDwc0q58L9gIhjC/jHPbyi9z/H+hTTSehB1ZnZjrgSU3/kRMmpRoRugNGQAHl6+VoE1el1mnydzkn9vf1fRHT8Kqz7g1FeieUrdoHCjjPmi5iNh/pyMxnhU70QQ6m/OoJZ/0BXAleFerk8T5trcn759vwoX35PSY7KZ4QmEfpPe156LZ/TzKZnjINkyXaqOLqRHPUcymn; 4:nEPi6xS+Rd4T4tg+/EP5fxBu3G8+fhW09rgBLsdrJDzTr4l1+em+Yd9LDqUcL2dEG8ZCvHLkG9A62hLYzv8jFC7svSkA8FdiedhZOv9i1vqroGARD7zOj6KRHe+Dgx+HhpMh0AHxtexXl43BeSiWBWQXXjrKzGMPIFcaI+d4Aq/ktq91p24rF6Eb9bl43Zm5shPcGYYhkOaCIzt21JT+dBV4tFHcKuEabe1lGoDK1TWHJ2WEkQewIvx0LQIlDEtDNKnG6SJ+9E4T4lrlSKVMix5rWQiNUTPtEdwSKuy/oNhJW+BvxyhwquNjlJfhsY3X X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(10201501046)(3002001)(93006095)(93001095)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR05MB1931; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR05MB1931; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39840400004)(396003)(366004)(346002)(39380400002)(199004)(189003)(2351001)(25786009)(52116002)(1076002)(6116002)(26005)(59450400001)(2361001)(36756003)(4326008)(76176011)(107886003)(478600001)(8676002)(8936002)(50226002)(7736002)(81166006)(6916009)(6666003)(2950100002)(305945005)(2906002)(106356001)(105586002)(68736007)(6486002)(81156014)(53936002)(48376002)(66066001)(16526018)(5890100001)(47776003)(103116003)(97736004)(50466002)(5660300001)(3846002)(386003)(16586007)(316002)(51416003)(7696005)(53416004)(54906003)(69596002)(86362001)(575784001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB1931; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB1931; 23:OqBw2w78ypXfG89D7vFIYpjJJndX1ZRkJfonalRYQ?= =?us-ascii?Q?Zx0Y9e5eFFZQ5Cp2rrxeq1edNF4tnZs1+WLj2bVQm7xxtuQjd9OKv1yHaAF0?= =?us-ascii?Q?3l9jSd+fy61e+MNF1RYmMrcIqqV0LnZkWSMBO0hk9c9zNl4iOCV9xWVlvETP?= =?us-ascii?Q?46AbTMQKeASWrX+86Cs1uDvdPFILRmntN2nSqPwBLD27kXQpuPvntmeySKsI?= =?us-ascii?Q?jkx/26ZaTgZgKgF6E5rlH+VYE7aijRxBFOKwjW0H1/7gKjB9jqQarH4bPTS+?= =?us-ascii?Q?1K92mhuoJzvlRH0vrfOdTSEgNunkoj7d4AGA66Ws15xqfL3RWBUTBZDjYN3G?= =?us-ascii?Q?pYRxVibiKFdFsYhBHrerbhHbWtqASmdgInY7eL2H0hYm2fKwHy3nC2BiEyWE?= =?us-ascii?Q?UQB4ZjS/jMhyoXjbBm/dM5tMrSzntk+SjRJjQHHiULxLB7XnnvwUOQ/8Sad0?= =?us-ascii?Q?q8wo+cZLWyd50L+ap1Eye1UrQjnitbo5++M67QYDzmHo0mi1SNR7pTnvJTRE?= =?us-ascii?Q?0hWDkeyB4jZ/j0Hca2NaqJRo++/zQXE3P9LfrQKPkDIe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kmJPZqLDMrC8H+wC8f+i0+g8BEut64oJn0Kejvzs9trkrgy93ebIVHjS4XGx4n1YsvcrehXH0ufV5E7Qb/DsU3slcxi4Nw9hUjjJXAYXAw5NarEIHGdYWYRuMxBkypeM6cEfZXLSzfy//ok5cTxSvXP+MSCWJt18ukjgqTrXHIFIyYhQKcDzUD9zhevRs61AfQK4aYBCUOp2Oi38eNEBbTB416dIwMooUiMGZGxFfXLNK/M4Tz7JF/FxymTon7nIwx52Kr2se/WAExZpsw=; 5:RSgTm0ZVE07z69EJjva515Wh9qDpmAB8EdlWKCl/rgVcHiZdIaXgw5FCqBiVOIyfydtW+rdTNGLCSOdfQ/ogpCg4tyH81oH2wH80OVd3OoHgblHRpNTyFHUdxpqbQ7c5EkvYGgvX0WhWUqBkB2e3bwHBHWadxw4NyJObtDi17rI=; 24:Pq9LnGdwenAIOIUlUrl/qG2seqfBXvPRPjdx7I5nsYboH8GpouKaIQOL1TWFrtZIsIr5Oob2AvOMJE2C4Ni6TyxSH3ZQNliRDS/Q4E/wDpM=; 7:zEvQHSC792Q8Bb7mOrF4qPqtp/Y8oSW0vQmox9NPWPn/eTiHsZfKUMXL5HACulVqQdnOkd/pA8XKkQs0tNRH9sDP66ehACb8sEDkS7frsURoyn2Mdf/oldAXTSNnLt0qP+pVrc7pLUcdQQqX3bn1rPRtWTuh/Ddf+EEV92TXaINASXz37PRH89MEdCySVgMywz4+kSLIFB5euq3GkX2AjzGubB/GN699bGcPutI9V0dv+HxySv/03eBgiHDFcfbd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 12:47:03.2633 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41eaccf6-3d60-4ee5-d20f-08d561963d61 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB1931 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasily Ulyanov Enable reporting of qtnfmac hardware and firmware details using ethtool command. Signed-off-by: Vasily Ulyanov --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 4 ++++ drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 +++ drivers/net/wireless/quantenna/qtnfmac/core.c | 5 +++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 2 ++ 4 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index c417a67b0291..03f819076197 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -972,6 +972,10 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; } + strlcpy(wiphy->fw_version, hw_info->fw_version, + sizeof(wiphy->fw_version)); + wiphy->hw_version = hw_info->hw_version; + ret = wiphy_register(wiphy); if (ret < 0) goto out; diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index d6bfb257cdae..2017532477c9 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -1107,6 +1107,9 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, (unsigned long)plat_id, hw_id, calibration_ver, uboot_ver, hw_ver); + strlcpy(hwinfo->fw_version, bld_label, sizeof(hwinfo->fw_version)); + hwinfo->hw_version = hw_ver; + return 0; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index c10f24f0a0ce..1acbe30dfc66 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -331,6 +331,10 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, return mac; } +static const struct ethtool_ops qtnf_ethtool_ops = { + .get_drvinfo = cfg80211_get_drvinfo, +}; + int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, const char *name, unsigned char name_assign_type) { @@ -358,6 +362,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, dev->flags |= IFF_BROADCAST | IFF_MULTICAST; dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT; dev->tx_queue_len = 100; + dev->ethtool_ops = &qtnf_ethtool_ops; qdev_vif = netdev_priv(dev); *((void **)qdev_vif) = vif; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 09fa5d28cc2a..e47198cbcceb 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -145,6 +145,8 @@ struct qtnf_hw_info { struct ieee80211_regdomain *rd; u8 total_tx_chain; u8 total_rx_chain; + char fw_version[ETHTOOL_FWVERS_LEN]; + u32 hw_version; }; struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac);