From patchwork Tue Dec 19 11:28:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10123089 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 9505E6019C for ; Tue, 19 Dec 2017 11:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94CB129280 for ; Tue, 19 Dec 2017 11:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 899B3292A2; Tue, 19 Dec 2017 11:29:38 +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 1C6E529280 for ; Tue, 19 Dec 2017 11:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967006AbdLSL3g (ORCPT ); Tue, 19 Dec 2017 06:29:36 -0500 Received: from mail-by2nam03on0052.outbound.protection.outlook.com ([104.47.42.52]:40224 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965342AbdLSL33 (ORCPT ); Tue, 19 Dec 2017 06:29:29 -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=8mZgTSSA7y4efA9SxoAH50yJ0b2XY5H3/VZui84vOak=; b=J1o6AIyXepbcGlX+K2NDyfBYOZaP4aBZl+nRI4fsJNt8AxrgYaVfo08JcKAfwq20UWDHYlHhlqmWLXbOdBfiUDRPIecpjEDGemNj01ZGFXHre0wfuWNGQrESI1A+KQ706nQfSQq3pbw2l441sjbcoaqFcBYZiv/Dr5qAhpl7dkE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1923.namprd05.prod.outlook.com (10.162.224.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.10; Tue, 19 Dec 2017 11:29:23 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH v2 06/10] qtnfmac: fix rssi data passed to wireless core Date: Tue, 19 Dec 2017 14:28:52 +0300 Message-Id: <20171219112856.22463-7-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171219112856.22463-1-sergey.matyukevich.os@quantenna.com> References: <20171219112856.22463-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR0502CA0022.eurprd05.prod.outlook.com (52.133.16.163) To BLUPR05MB1923.namprd05.prod.outlook.com (10.162.224.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee67d39b-2fb2-427a-6dc4-08d546d3c1e6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:BLUPR05MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 3:ijdqkvGqPoDzSBxR4T/tu90EaywCeQB6olu//GZCk0BERthwTb+NN/1xqnhceNe4L7L3RNAWTg57lsK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5R2g0kMRRAUghUT1KUzzm6PQLHxYEefrvdooQTfeG7RV5V1Wee8myv73oqsbhOqQd9qxdHJBwsutFyaI6kyqh0zyuTvCFfvv0bx/JsdROeFlWXz7ifoOegbh9UR3ckjEd7dfo4wYHvcHPEz5kXG8YERV9kkcK1mw2QjQh8gf2nqmwPkj0GER7ASHbhJ1/ZTXcMDdEgwb7AkdeQ7kLFwpl1m7ozDze/ubhx9oc6jbRnq1wi699Iao8Z+7bfhh1p8SrAdGvPACPdAuvPOEeTy8r3uwstbMgv/O; 4:/Ilg/MtzU9haOj2FnOWu/OsnifMSkCWaBmrN4edyuz+nx4N4qL8wLEo1zvsYwia62EOBMZ6kMw+wJ3/UI64+wfE3kp2DMX39cEit6NeMKjFN8zjzD89uMloqxyHqSitt3FW9CFIuy740C8TxFTJOllEY+9/pNHyEbt59/jWOWA9ipI8kTTbdjIZSxyecxjjUbAJkI9jgKkfDjh5b2xFggFH7+Ast4BHGgvC+gLuHgYyApqOtVImUQbX2OseaqcwDwmJl5IvFA8ed6tiXt2iIQg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(10201501046)(93006095)(93001095)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011); SRVR:BLUPR05MB1923; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR05MB1923; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39840400004)(346002)(396003)(189003)(199004)(48376002)(68736007)(50466002)(59450400001)(5660300001)(2950100002)(6666003)(6916009)(316002)(52116002)(76176011)(386003)(7696005)(97736004)(51416003)(16526018)(16586007)(107886003)(25786009)(54906003)(4326008)(69596002)(86362001)(53936002)(2906002)(81156014)(103116003)(6486002)(2361001)(2351001)(478600001)(8676002)(50226002)(1076002)(8936002)(7736002)(81166006)(66066001)(47776003)(106356001)(105586002)(3846002)(36756003)(6116002)(305945005)(53416004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1923; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BLUPR05MB1923; 23:o+gWKaimIzfUtReyZNWMkuOqTrazRaByaAtHjXid6?= =?us-ascii?Q?cgAcJbDUtquPEHPzB5SStmiBrzsDuX1b4r5RQwssbjDCp1Da87xYSan2/OAX?= =?us-ascii?Q?qlPV/K41YTW84qkP4fOdBDHa/Of3UJt8n5SewQagRRU4YVaXwY4amCkymy6I?= =?us-ascii?Q?F5tvbvcPooKXM59AMRsZ6mtz6Hii1p3Scs2P9YGC0UV/fWN7Lxh7sUE3+VrD?= =?us-ascii?Q?Enc+fow5ldWg/MKjis78wSLPyQBmRD2ge4e6I547Phq4YN8kgl0aXW5DWO1d?= =?us-ascii?Q?lQ96Yn9REE5dIIPqki6IZYYgfquZXKRm+idTRtJD4YaVxnZCL54BWBRyHXbh?= =?us-ascii?Q?UeeniMaVcoy4/c52Qb4fmZgzx6FdzjhPndaeA3F+9qFtYIKCcmN/dCH7UZHX?= =?us-ascii?Q?oDb9Ypbrf9CV6C6y8uVdFPoIAocz4v95ZM/W46DTXfipHQfcxYbKzacGxwKd?= =?us-ascii?Q?DM8KHylKXCeAoUcQEkUwF3t9Gzc1c+GYEiz+j2VvC+q4gp49dk4QbnvCT6wc?= =?us-ascii?Q?ubEFCKBoOp+W42cgompH0r/kMvdlW7wAwrpeVvgwATFGBXmfvquvCXnfmnuw?= =?us-ascii?Q?OdDXa20CJO05BYA0G2qzy5oekTEvgvdg3AJlosMlYn3PnnrtW+k77GKF0eac?= =?us-ascii?Q?za3PM0iyK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ZjsBGIWfoEpLdMtQcfYcf9XD4=; 5:RoYMUESLYJ+zhLRYrmRfoxCUpjw721G1jne4azYFXo0F8aynBV+y52N6X9wr5SYRfgdm95ARI/+yGzOBaWflCJf41K20TTm46LYYkKfwFYYt4NalATd39EzvmFf9vjoBFTzVxqBhyzCwhoZvY6vbqM4m1K6JL83l0W5XP2E5wws=; 24:RnZnhXrisFyPqVHYxhaL16ZtjTIE2jYtievejMljJpHx/94pfM7vsbYYiXlfqayUSSj7+biE9Q0t6ftgAiTYmBdmgFikW7CUuvEE5A0oEWA=; 7:Qg5U+OUaaLvlGZ+725voWSHD+d/QZL6/RSsU51WJ3trzvZeh/F0zbRFhjM7URzoLJWgcPoAzGnNzDsUMJPSstYDYCHmWxK9VFA8543c3Sf1ONaj4DTovMVsQEUwQmZ54OBIHjeApG35xHvRL+vmz3aX1wNBsk3+vzzDJqO+IK2Bg9T47DMzd72gwFI1pHvi0QVj7SL8bCf8vTgY4IipABz1heTaJkBIUrYnpxvfROet5YJrIR8CNcMNk15cufrrn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 11:29:23.9659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee67d39b-2fb2-427a-6dc4-08d546d3c1e6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1923 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 Fix RSSI values passed to wireless core by qtnfmac driver: - fix RSSI values in scan results: driver registers wiphy with CFG80211_SIGNAL_TYPE_MBM signal type, so mBm should be passed using DBM_TO_MBM macro - accompany firmware changes fixing RSSI values in received mgmt frames update qlink message format and pass correct signed values to core Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/event.c | 7 +++---- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 9843ca36b74b..b3489b5b5d9e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -237,9 +237,8 @@ qtnf_event_handle_mgmt_received(struct qtnf_vif *vif, pr_debug("%s LEN:%u FC:%.4X SA:%pM\n", vif->netdev->name, frame_len, le16_to_cpu(frame->frame_control), frame->addr2); - cfg80211_rx_mgmt(&vif->wdev, le32_to_cpu(rxmgmt->freq), - le32_to_cpu(rxmgmt->sig_dbm), rxmgmt->frame_data, - frame_len, flags); + cfg80211_rx_mgmt(&vif->wdev, le32_to_cpu(rxmgmt->freq), rxmgmt->sig_dbm, + rxmgmt->frame_data, frame_len, flags); return 0; } @@ -324,7 +323,7 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, sr->bssid, get_unaligned_le64(&sr->tsf), le16_to_cpu(sr->capab), le16_to_cpu(sr->bintval), ies, ies_len, - sr->signal, GFP_KERNEL); + DBM_TO_MBM(sr->sig_dbm), GFP_KERNEL); if (!bss) return -ENOMEM; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 3e3de4629a53..1f150be98820 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 7 +#define QLINK_PROTO_VER 8 #define QLINK_MACID_RSVD 0xFF #define QLINK_VIFID_RSVD 0xFF @@ -916,15 +916,16 @@ enum qlink_rxmgmt_flags { * struct qlink_event_rxmgmt - data for QLINK_EVENT_MGMT_RECEIVED event * * @freq: Frequency on which the frame was received in MHz. - * @sig_dbm: signal strength in dBm. * @flags: bitmap of &enum qlink_rxmgmt_flags. + * @sig_dbm: signal strength in dBm. * @frame_data: data of Rx'd frame itself. */ struct qlink_event_rxmgmt { struct qlink_event ehdr; __le32 freq; - __le32 sig_dbm; __le32 flags; + s8 sig_dbm; + u8 rsvd[3]; u8 frame_data[0]; } __packed; @@ -936,7 +937,7 @@ struct qlink_event_rxmgmt { * event was generated was discovered. * @capab: capabilities field. * @bintval: beacon interval announced by discovered BSS. - * @signal: signal strength. + * @sig_dbm: signal strength in dBm. * @bssid: BSSID announced by discovered BSS. * @ssid_len: length of SSID announced by BSS. * @ssid: SSID announced by discovered BSS. @@ -948,7 +949,7 @@ struct qlink_event_scan_result { __le16 freq; __le16 capab; __le16 bintval; - s8 signal; + s8 sig_dbm; u8 ssid_len; u8 ssid[IEEE80211_MAX_SSID_LEN]; u8 bssid[ETH_ALEN];