From patchwork Mon Nov 13 10:28:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10055529 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 7B9146029B for ; Mon, 13 Nov 2017 10:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A3E92935C for ; Mon, 13 Nov 2017 10:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF8C29364; Mon, 13 Nov 2017 10:28:51 +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 C60F229362 for ; Mon, 13 Nov 2017 10:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752316AbdKMK2m (ORCPT ); Mon, 13 Nov 2017 05:28:42 -0500 Received: from mail-sn1nam01on0085.outbound.protection.outlook.com ([104.47.32.85]:59533 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752217AbdKMK2h (ORCPT ); Mon, 13 Nov 2017 05:28:37 -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=gF25EfU6DfSvS9d5IodlOBunCyDcmk9JyYBrzqg7DBC3yQ/WWFtwKgSumDqCaQmdA090hL7NWhoob/VFKJU3Em0itQz/SNESwzhuRLu23Sr5odZpn+q5E/Kk2pKin2e2Rh6bX44n9a4cjd0d3r1YWQxVy4sggBrQA6gyiK91DNM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1924.namprd05.prod.outlook.com (10.162.224.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.239.4; Mon, 13 Nov 2017 10:28:34 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov , Sergey Matyukevich Subject: [PATCH 06/10] qtnfmac: fix rssi data passed to wireless core Date: Mon, 13 Nov 2017 13:28:11 +0300 Message-Id: <20171113102815.11254-7-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171113102815.11254-1-sergey.matyukevich.os@quantenna.com> References: <20171113102815.11254-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM5P190CA0007.EURP190.PROD.OUTLOOK.COM (10.161.47.148) To BLUPR05MB1924.namprd05.prod.outlook.com (10.162.224.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a711ab80-adbe-45dd-9257-08d52a814ba8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:BLUPR05MB1924; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1924; 3:OI4C97bGY4GbJWQ8VV4mRUOBGTA8FnVOIi++cO8xMLXWIg0qmK3k+g8g/UHYIsG8QhFtT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4Maeg5f6x4/BsfJqLe7q7Vud2Rrw+1yP7cEsiQ9Kr1xjFgfYpdXGHmIKGXXL4Jjzue0vdEVa6uQ5dw8mJISb1dwTGBYOh8dAV/bEOSZ07y/ljewVUCEWZOE6SqtxZ12NQsz57z/WeAT9NeQyf6X31MnUFp1ACp85ftR4oGlhfz/cdrXosBGXsyq0mj/1DtLz6EVr4I90XCwwJux5eSM3lg5kFqPsPD7mCZAN+ehyr72iW+6xHSOs5Wd3I0lgqqs2p9K0sR6mV3spyVrq3z5R1/AsGdbI61sKgObHjBpPIKGsRfDjFSN; 4:zIhODEw+NLB7WlJw+TCXP0XU2V33zAfhMkJXoKOJO7SseW2jylhzS/0jbF05MoaHiecHfxchHvXKgIdYM8bvUCYqP8WnjT7zbF843LN9MhOnZbpKhVlHwTi1KHngu+aVzZrkFJpc10eEvoN8evh9NJ76fUtFuSwolaD6D2aapRxqgKwqGZ/3bBNYoGUffR7rXCZf+/PqO4MPYesAEgv7mGAddQq9KW1A/4JEpsZxn62BKsjyPRvMERPon/fwOjnIpI/B4c6el0m3ODWfHU2obw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3231022)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB1924; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB1924; X-Forefront-PRVS: 0490BBA1F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39830400002)(346002)(199003)(189002)(5660300001)(107886003)(47776003)(105586002)(50226002)(54906003)(66066001)(53936002)(2361001)(76176999)(316002)(6486002)(6916009)(50986999)(97736004)(4326008)(33646002)(5003940100001)(106356001)(2906002)(6666003)(2950100002)(25786009)(101416001)(16526018)(189998001)(81166006)(81156014)(86362001)(8676002)(6116002)(3846002)(478600001)(68736007)(53416004)(48376002)(7736002)(50466002)(2351001)(16586007)(103116003)(69596002)(36756003)(305945005)(1076002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1924; 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; BLUPR05MB1924; 23:X0uMEtsOI5OJNftnKlVTEKZsXXAu/A4SmbnJw/ghw?= =?us-ascii?Q?v9nUeVpyHQDLLwhRYaeSl3HTkL8pvG+PQmw1iDomLheXLrhGwORwwUGC17VI?= =?us-ascii?Q?PTph6TYuqQLZb2OGZbDYllv8BC1Tcrmlsnc5pNYTcl+AXmqC9V/MtUISlcum?= =?us-ascii?Q?NICJjzSZMNPm9i+We1B2JDkZbo75S1PHMoUC0OJAyz19XrZXTXZMZsynFU2R?= =?us-ascii?Q?patVFRFZ7yiNSSs/KMYEklj6xvwC7rAxqAnJ0/qobNFuMU2Np96C9r4VAEXS?= =?us-ascii?Q?aaOBlA+AFK++7mkGGJq8nHOqyOFdYz5Pgqs03C5KaNPT4TiKzEtEQ9wBBHRd?= =?us-ascii?Q?GjuGlfWi6cjdvXEcA2h0U3SYDbpETkfoR8PyEdxnvYCKzq4XGBgPVJyK7D0c?= =?us-ascii?Q?NEQ0k6tMXi29gjcIX8ix7brPHQSeModKrsbi8jnQNDD0joJMm3LP4voMRRTH?= =?us-ascii?Q?wMh4rlrIYyh1aumVz1eERqUwJwlOHj4xxg5MRZ9dzytUq+xXW1qEl5HSv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+JYKrgV3UgYP/rDns5GJyhdE+IViIO4q352OOse63qCyrzMUEiP7GbmC/ZmejYOUuX3Kqw09cPyRBAbUj7w83PQILFISkBAdnBxAD9lhBNk1x1sHKOLw6HA9/46CqmT6hb92jYyQIcn+P8zn59TwGf3fx8+HZCKmySUT7sxonHm2pxLCG65G4iJOku+wCDOfEXGRU38E=; 5:/DIjqERPtUbG0Ik95Qk/cMH18zibatloowDpahqRhBlONcTQXnA+K6y0MN/gl2YOGkkiKeWkKjyr+z8t5dnr99PYfo3Jc3tziZZcvcQPwdteMXiFj4vnG+qohyjnUBIqohhAGko9vbTna7PHYMJMvztNQOo8KSkO6a/04PsZEVU=; 24:9jWmmzcwHcvqKKN2EAAZFoUvvo9ot/VresTorEFXHgcSLMxuDc0LU7GFX+NdV0x9OGh6hFxEEOpijjQcSsXS02IGMLrbchmPZdPQdhTEJQ4=; 7:IVHMNo4B4W8squBqwfjZklXmYKBNkYVp1AQ3JWlHJ+ps/vh22uKL6LxO0Beh0ZnGPDSoPKzlKkMprOdNV4TZK8Y55olG5R4250jnDrASWviDS6Za/kyTjZucrDAofcdsqtsFXmGqQcVyjFKq3XVYRH1f6Xelpt99BCas7sHwvgIq9sAKGJAmfwQRPu3te3GWl25D30s4vAFrHl1Nkplc9VPMNMBOyavux5H/jejKKTPDIf6Dle2u2XhB5ExFU9C1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2017 10:28:34.1435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a711ab80-adbe-45dd-9257-08d52a814ba8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1924 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];