From patchwork Mon Jan 22 12:46:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10178453 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 E05A660224 for ; Mon, 22 Jan 2018 12:47:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC827281DB for ; Mon, 22 Jan 2018 12:47:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0E8128210; Mon, 22 Jan 2018 12:47:10 +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 4917028236 for ; Mon, 22 Jan 2018 12:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751117AbeAVMrG (ORCPT ); Mon, 22 Jan 2018 07:47:06 -0500 Received: from mail-bl2nam02on0073.outbound.protection.outlook.com ([104.47.38.73]:37088 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751110AbeAVMrE (ORCPT ); Mon, 22 Jan 2018 07:47:04 -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=1WpWduhB+qcC4zQ0ntslku/w81F0CV92aDoiVSwwv/s=; b=cOcwTXgkNTxeO0I62o6KC7bK/6riRWxkTHFqPWSYqM6q0UtW+A9+YFQ9esZQWX2vV5SEvBcvjRR07l2aVs3jKvr9rsC6g6vbhWMcVhp1pyG527Q/9M3/EDCjGUGyOmhWM7PYTmFvltVTekUrOzzCsx7iYUlNlILUf/3yT5y+3L8= 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:01 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov Subject: [PATCH 04/11] qtnfmac: get more hardware info from card Date: Mon, 22 Jan 2018 15:46:27 +0300 Message-Id: <20180122124634.8430-5-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: ea02fa25-9bd0-44f5-a2c7-08d561963c4f 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:NWxqrucEfW8v/tMaL1YBltCmh6hXzYVTs9TKx7gCI3zqzcq7n+O2HkkAsNXIcPd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9TMvrsimC5uhuB6b/1cSbcyo86uSwNgs14rJe1c3GknYShvbuSq88WBJPyGD3zb3NRSb6bI5ququAR2R2js4JRl60pGEIXlTlLk+9VFHIT7DGR/NDI1MQJ7HuHcpHMSp662gIqzPUZNMQVHo32+oR4HrM3eM5lcm5uubF08E6bhnZ0Va0BgQXOHPMft9CnKMZkBnrnuIYCNzfXr5zRtB18WiVdJzhpcwrekAUr4jK3xlz8CN5OKNNHa+hSN6CAJGOi1QiVqy1S2kN+g9XPDm/nhDA09tfDC+Hpt/lNZ; 4:cIcvWPjCx3wwE7LMxerfJC6Yf4Ow4ZbBBss5vNIRF/q2dtuBmT30BjDQ24com4HrjRNYBWbra5yy3/NLfs74eb3CwSjrEJ3QLrA77vGR6kQerRAtZPF8Xtt9YZtNtuRJnBmNt3xRYMeuIzd8+s/HiDTmvfvus3BPM3nKnBkzL/jRmqYUwXOJ1iBU2uQdWmCzAbrMRqwgz6RR4/1uezSZmCY6xR877Djg92ntzGMrjBY949gEckCGVBQiw++1NVnrzfmaJnJPasKjO6cYkuDAsw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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)(47776003)(103116003)(97736004)(50466002)(5660300001)(3846002)(386003)(16586007)(316002)(51416003)(7696005)(53416004)(54906003)(69596002)(86362001); 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:KiNUW5xcG8hau9OHFLutW+5jJUkvjBM099JNGgPYA?= =?us-ascii?Q?i6TcqMFkQlILXL0R4FYBg/Ou2MfS5359VY7CIc8ZkFA6yb28PUXvZxz6vc6l?= =?us-ascii?Q?7R+XfxXya+7AziSaPZkRTD8ifrHLYYY6F2vJdljVTwK8h3Gvu8o0XofZngTc?= =?us-ascii?Q?y80mtsR4wbSY117SJTgryyk5aiP6eVm2XZnrUsZdwj3v6/iKe7aRBofG7/UR?= =?us-ascii?Q?txR+MrA28IJ3eQXKtU36yuCK3IT7jYi/KP/eDl4RN81UpZCvE+ay1fTk3MQm?= =?us-ascii?Q?E6MU6lXI9rmu8QM0gtklUNEDqMsrlebjGQNCSM6vHUcKLnIxHlHgvxpbbkoL?= =?us-ascii?Q?ydZL5tuh/dlUVIv3aXogxzGTb5snSFydF8Rk9YF2Xk9sUWyFpLHinUM29IHg?= =?us-ascii?Q?7vL/4uVE9Yo5Nmyl40j0zqgenc25030FL057WiVT23T7Rs2kyJVGew+IDPtC?= =?us-ascii?Q?c+ujDZ67reUann0opCPDhxo0QgQ3jgoy3N3r9+SDrUj8xhhlRd2t7OiCxyKu?= =?us-ascii?Q?cQNo0eU3pO9SiImv/xsZAzXiTEpRO9luaZw7yAK4nufnFLZGGrtlwDYyHsrQ?= =?us-ascii?Q?9BIqv2xl6n+kT6c2SXtzKkR38LT+h+6o6Z4BriW+gB2fdVRY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GAHWLLbvENc8KyOeq7I0i2E9iXbnU6OXF+G5snaWrbNJUB5ZUOxpyOS29MJlEF07PHjD+IZIy4xOap6fEEKixr7mcD2679e5TR2t+nZl4n9yW650tS3IwQ=; 5:lDw1kV+MGPS/1oo7HOq3Z9Zqova+r97xbw0pay5y6crIW6vY0N1mKyk4cJKqdD+gbz1OwqapMfzzUxnaa0YLJE414g5gHMipIb0L/SjXs3MLoH1CGCYBgk90c5ueLISpMtSS7O6O7h/HLGaSHRNWxUF3i8cgSplsS7wq0wGqaiQ=; 24:3+E7zUq1LjzV2uu8Hec5QBLLQXvV1nfJXunDluCccB10jYck0YcRUJtHhO/Hr1kdtwRSwd1zNAMsMKP4Od/Doc5s3Qz6gZopNqmlFKtKFH8=; 7:W70O2V5eCF5rixtYFqOimfj0XYGHOEdfR2ILvQSw0M6ZSoQ0JBeKA5HIHNaxMkpU9RNIrpQzcT1TI3LfAmCXwY5nqwV4mk4KchfkQG1tJhMLMwoKs1b8m3fsjnM/Ko5EVyYZbIkT82FQ+4cQnplYyZBwhNBPmAT2cdkDPNRgDaiE89DQkNHx/AW9oiMZvBmJDzW9HkHN3JU48GfrUaiOxVKSjK9H4u9IP1Mp3G6vcHktYQ5vbT5bGtFTdxISsYuG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 12:47:01.4664 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea02fa25-9bd0-44f5-a2c7-08d561963c4f 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 Various bits of hardware and firmware versions are useful for debug and troubleshooting. Get more information from the wireless card. Signed-off-by: Vasily Ulyanov --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 50 +++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 12 +++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index b47b06bd680f..d6bfb257cdae 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -949,6 +949,16 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, struct qtnf_hw_info *hwinfo = &bus->hw_info; const struct qlink_tlv_hdr *tlv; const struct qlink_tlv_reg_rule *tlv_rule; + const char *bld_name = NULL; + const char *bld_rev = NULL; + const char *bld_type = NULL; + const char *bld_label = NULL; + u32 bld_tmstamp = 0; + u32 plat_id = 0; + const char *hw_id = NULL; + const char *calibration_ver = NULL; + const char *uboot_ver = NULL; + u32 hw_ver = 0; struct ieee80211_reg_rule *rule; u16 tlv_type; u16 tlv_value_len; @@ -975,6 +985,10 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, hwinfo->rd->alpha2[0] = resp->alpha2[0]; hwinfo->rd->alpha2[1] = resp->alpha2[1]; + bld_tmstamp = le32_to_cpu(resp->bld_tmstamp); + plat_id = le32_to_cpu(resp->plat_id); + hw_ver = le32_to_cpu(resp->hw_ver); + switch (resp->dfs_region) { case QLINK_DFS_FCC: hwinfo->rd->dfs_region = NL80211_DFS_FCC; @@ -1035,6 +1049,27 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, rule->flags = qtnf_cmd_resp_reg_rule_flags_parse( le32_to_cpu(tlv_rule->flags)); break; + case QTN_TLV_ID_BUILD_NAME: + bld_name = (const void *)tlv->val; + break; + case QTN_TLV_ID_BUILD_REV: + bld_rev = (const void *)tlv->val; + break; + case QTN_TLV_ID_BUILD_TYPE: + bld_type = (const void *)tlv->val; + break; + case QTN_TLV_ID_BUILD_LABEL: + bld_label = (const void *)tlv->val; + break; + case QTN_TLV_ID_HW_ID: + hw_id = (const void *)tlv->val; + break; + case QTN_TLV_ID_CALIBRATION_VER: + calibration_ver = (const void *)tlv->val; + break; + case QTN_TLV_ID_UBOOT_VER: + uboot_ver = (const void *)tlv->val; + break; default: break; } @@ -1057,6 +1092,21 @@ qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, hwinfo->total_tx_chain, hwinfo->total_rx_chain, hwinfo->hw_capab); + pr_info("\nBuild name: %s" \ + "\nBuild revision: %s" \ + "\nBuild type: %s" \ + "\nBuild label: %s" \ + "\nBuild timestamp: %lu" \ + "\nPlatform ID: %lu" \ + "\nHardware ID: %s" \ + "\nCalibration version: %s" \ + "\nU-Boot version: %s" \ + "\nHardware version: 0x%08x", + bld_name, bld_rev, bld_type, bld_label, + (unsigned long)bld_tmstamp, + (unsigned long)plat_id, + hw_id, calibration_ver, uboot_ver, hw_ver); + return 0; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index f4d49565161e..51cadd2a43f0 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -19,7 +19,7 @@ #include -#define QLINK_PROTO_VER 10 +#define QLINK_PROTO_VER 11 #define QLINK_MACID_RSVD 0xFF #define QLINK_VIFID_RSVD 0xFF @@ -764,6 +764,9 @@ struct qlink_resp_get_hw_info { struct qlink_resp rhdr; __le32 fw_ver; __le32 hw_capab; + __le32 bld_tmstamp; + __le32 plat_id; + __le32 hw_ver; __le16 ql_proto_ver; u8 num_mac; u8 mac_bitmap; @@ -1074,6 +1077,13 @@ enum qlink_tlv_id { QTN_TLV_ID_IE_SET = 0x0305, QTN_TLV_ID_EXT_CAPABILITY_MASK = 0x0306, QTN_TLV_ID_ACL_DATA = 0x0307, + QTN_TLV_ID_BUILD_NAME = 0x0401, + QTN_TLV_ID_BUILD_REV = 0x0402, + QTN_TLV_ID_BUILD_TYPE = 0x0403, + QTN_TLV_ID_BUILD_LABEL = 0x0404, + QTN_TLV_ID_HW_ID = 0x0405, + QTN_TLV_ID_CALIBRATION_VER = 0x0406, + QTN_TLV_ID_UBOOT_VER = 0x0407, }; struct qlink_tlv_hdr {