From patchwork Thu Nov 9 11:46:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10050845 X-Patchwork-Delegate: johannes@sipsolutions.net 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 9BC1C60381 for ; Thu, 9 Nov 2017 11:47:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E1612A89F for ; Thu, 9 Nov 2017 11:47:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81A112AC55; Thu, 9 Nov 2017 11:47:01 +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 D47EC2A89F for ; Thu, 9 Nov 2017 11:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080AbdKILq7 (ORCPT ); Thu, 9 Nov 2017 06:46:59 -0500 Received: from mail-co1nam03on0047.outbound.protection.outlook.com ([104.47.40.47]:5872 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753619AbdKILq5 (ORCPT ); Thu, 9 Nov 2017 06:46:57 -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=kjv6Wdc4Jz0lxUnV7KTHkg8q+JIMUBqYqkB0juYZ+lA=; b=eQTYoLO46VKn1b8Bda3uweCsFh77FcsxuA2eYHhwKopi0KVRh48YU5PCfTBI0aELYTAkfs/KD/HFbhsFtvKENvOfn08KTzhQnGY64VJSjTa9VPRwCA9WwViXmV1HbrlOaK2MacS0M769sqEw4ZT6mOV2nFVJRHepBO6VHtjvC2w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BY2PR05MB1926.namprd05.prod.outlook.com (10.163.32.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.239.4; Thu, 9 Nov 2017 11:46:52 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org, Johannes Berg Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov , Sergey Matyukevich Subject: [PATCH] cfg80211: cleanup signal strength units notation Date: Thu, 9 Nov 2017 14:46:30 +0300 Message-Id: <20171109114630.24712-1-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: HE1PR0402CA0054.eurprd04.prod.outlook.com (10.167.34.171) To BY2PR05MB1926.namprd05.prod.outlook.com (10.163.32.140) X-MS-Office365-Filtering-Correlation-Id: 40ee646e-a4a7-45c6-5ac0-08d5276792f4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:BY2PR05MB1926; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 3:2x87/4iHjEBrxjoywLEQ+syidUkCrTN00+Jw8ScnbX/lEoLXRjpktUalmcAlYN8awkTDD5D5zxCkoRoT0SHTppKJwwiG4e/KgZVW8tN12mfCkL1hGV9s1JeANr50LxizBze8hYHW0/NQrgLr6XHeDowkl7qOWIvsUraLG4igiXLChIbViMIiC5/pJ0SNV5IWEs5DQe0jNlPoM1muS4jiAWZUV7hu/nNzNTHjvwIl44h4R1UAR/FVF6tZodSgHHD0; 25:0T/KvlXzSJwsb+rRJeeXGaSZP2Bk0wXPzlNhUBegpSfRTBI4yHw5TsbfMvofFE8QLpJurtyWPv0LAmfw4GVo7m/qNaHh+YZcxmTCyng7QiPFIxpTpsnL0EDiAMgL0XtN/k6SIU9Afm+wMcAX/MnpCXELY4WN4A90ADrzktBOhnluWQRH/BaEYG9LRe2zzbgisIHvY0Wq0VqT58UD7hSMAUDSwV+0nS+3IDFhrZM9+rQG7OWb9RB12kEhLzosoTb1pG6g4IFIoXg6CA0SfxqpH8jGXZqq6tjf4O2OC368FtbuyKTFK8ke1hW9OjYhT9ZjONpEH0DwdL1wGfQOXVhpAQ==; 31:IEO4qX7678gKPsbfCcL84BvB4/803AIPj5Q0/pOVmZMPD439x+z/WKEGTIkzP3aR0d+fLoQbE525uL+cOavMloh0jh0XOY4g8WJGzmZuf6tJVWCq0f0Br2x7/TPkQ+S274ovkM+qlZ7cMJXz5eqitM0D0mx4bJRDHuAVwckaCBy5x351mFzpJUj6AhrfwO+FY82vp0J/ls5uxwOWIws6MUZSbU11f6Z46/DWHNrzkCA= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY2PR05MB1926: X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 20:9MgDCiw4XIyShDoosJMfOVXSEtWolN01BRIcncIw4jX3COaZAaMLNfKUWmcNdGI5izItpnbjfOku4wHV3ZVP6KYiFjsDB8vmeb00V0StYE327r3qtm0+jov30eMn9L82HYEMctfjtjrkrbwQiyGBNcpQ/Y7qsPu212qKMYqrLUUOpGL7j1JDcjljawejyf562g1XbLhrpXE0janS5pY+5oPffQ6entK1SB/KVL0V7Ebo6rt0tXds+nonHrAeSYiyrsQORSF/Dtruii/uYI8yzHFUu+KWLY2LT08VQD6PLpAQFurpxKahnDpdzE14sEBq54NW45YuJverS78efjeCQY6UER5s3c8UNuwu6cw0XwUg2rhQ+Ccf+oDoFneYdLzH3FUU8gUFJdU0khRlv7pSP7oWeVAzopVceTwublMcZSMq6ulPfIXXfD78S8uhcPhiFFpo10136u3Wdcq4tgxBgoYwg0No8SSxBkX1pqQZ7C5SK3CIZAmag1jiC5KZSfyP; 4:8fZe75SpN75CEDygl3jsJA7VR/KLAbspeUqT0IUXbDf5aIXf48YLuxoTw8MttvctMFupzK9Z9lbu8KI/upwdSKuTqMrW3I99orFBbH0NDYaRTuqrHSZv7mrZin5ztlUFOWP0p83KvnPbnCeCULdOia2K5kmMvLtC5GCa6hfGAT4BTgnWYZxVibDX8ms5rcR5deKVP6LAYVP1uTPyH2naZAHEQ6FTIw+QNqHvoAzYmFm6iHpiyvkqcNOJ03J6yj04L8lfaOsay3mkWj72jvqc48Nm6AjTGTKvOU/N+L1TxTuj+EynwV2kFD+RcXnQuBGj X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Microsoft-Antispam-PRVS: 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)(3231021)(10201501046)(3002001)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR05MB1926; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR05MB1926; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39830400002)(346002)(199003)(189002)(54906003)(16526018)(316002)(16586007)(69596002)(81156014)(5660300001)(33646002)(50226002)(81166006)(8936002)(8676002)(478600001)(106356001)(53416004)(107886003)(2906002)(305945005)(7736002)(25786009)(105586002)(97736004)(4326008)(48376002)(50466002)(103116003)(68736007)(50986999)(101416001)(6666003)(86362001)(6916009)(66066001)(53936002)(5003940100001)(3846002)(6116002)(1076002)(189998001)(6486002)(47776003)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB1926; 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; BY2PR05MB1926; 23:GArgbzoUiX2KH4iqxk6TKiqP196l9L7H1ixzarPE1?= =?us-ascii?Q?M/JzMpH219walJFjMPrJWrZ/aF6FsuSeTOSLN3atOJbVq7YR7v0F2N9H4ze6?= =?us-ascii?Q?70JPtyADa0/4OMElRKduQXZozIbNuFlTuQfWlaOxaZkZBwKtgcbUwxE2VZfD?= =?us-ascii?Q?uhaJNeDFAuV4qJvtiLu/Dh4LmXDPhpPLqr1OMQ3NFzQpDgBjZ2QjCRlHaejx?= =?us-ascii?Q?PAuPK/vlAcR9oG6JqYA06ge7qMVqAyW2XdwKvuvGH+Lj4uiG7uPHXyckdcXm?= =?us-ascii?Q?QVnZQoLl7wD1kKZXoMczo+TOTHZxfadGS3B3/orbIMO5n0Akgb5Qb8gPUIcM?= =?us-ascii?Q?vj20tcnJjW+jSAoad/pKBUPGfzpcq+IHhXOwkRO0/CaPv5Pi3du76xEg8dG+?= =?us-ascii?Q?mvpXR8KoY2OsFAp51bWAZ2UOqNmaU3RwsZ17mlms6hac4gxKpcNq8mtEMJMq?= =?us-ascii?Q?Yy6CZ3mObNGy9QmqGDXyqQW54k7Wi0E2GYiPT7CPomz9MkID72Co5X4HXhxB?= =?us-ascii?Q?JSuCzOUEl4eTJuQrYcGdy2Sh29NGLTq7L8/WGcOE+xun5/8P77AcXlQ89m6C?= =?us-ascii?Q?lRMzT2zx37psR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od4w3u0m0k=; 5:sO4KVZWI3307kmxvEvhOmljVGj6y5HaIPw7APa8yvrGJ1Qb16buDDFmeye01GsWQE5jaUJOBXd6Hy8jKlVjmcnZg1U416H7rHcZZ/9rwiYGORIJzWSJ0n4316eKUFGqEQ5I43W2CSOQeQ9CbPvUZbcaTr9RbxljBCpS9Ixc/mPU=; 24:7XX+b4sL+4TNQJRYYAQtyNdECuqDbqn+dPzAADzRK03F6pEKNQHK5DudP7SfXLUjzysdHyzw5P1wCOShZsHLq/Tu6T+wg1q4rNu1Qg7vuAs=; 7:xrtk3+vpBPGbwi0OyKpvAoP4UMBEdmvGORzwM9C9sgbDjxr3D4b/V4UTVDWE1y881va32jC0dufz50hiR3T/Odb3J9u89cp0TjpVX+33I18k5e9knM9JxRE0RmqvZQKNA9k3zdtvpuxRaZwbz7wgOhPCNzfdYjenNUOfz6wL/Rz0QRUH/yeyT66b+sMlw2AvcyHF2Ook/NKegaZOA01tIhT3HuNeEMIH7MTdK7grE30PtkSMb04M49b/ND5J0V2h SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 11:46:52.4488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40ee646e-a4a7-45c6-5ac0-08d5276792f4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB1926 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 Both cfg80211_rx_mgmt and cfg80211_report_obss_beacon functions send reports to userspace using NL80211_ATTR_RX_SIGNAL_DBM attribute w/o any processing of their input signal values. Which means that in order to match userspace tools expectations, input signal values for those functions are supposed to be in dBm units. This patch cleans up comments, variable names, and trace reports for those functions, replacing confusing 'mBm' by 'dBm'. Signed-off-by: Sergey Matyukevich --- include/net/cfg80211.h | 4 ++-- net/wireless/mlme.c | 6 +++--- net/wireless/trace.h | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 8b8118a7fadb..54321759aa44 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -5576,7 +5576,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, * cfg80211_rx_mgmt - notification of received, unprocessed management frame * @wdev: wireless device receiving the frame * @freq: Frequency on which the frame was received in MHz - * @sig_dbm: signal strength in mBm, or 0 if unknown + * @sig_dbm: signal strength in dBm, or 0 if unknown * @buf: Management frame (header + body) * @len: length of the frame data * @flags: flags, as defined in enum nl80211_rxmgmt_flags @@ -5755,7 +5755,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, * @frame: the frame * @len: length of the frame * @freq: frequency the frame was received on - * @sig_dbm: signal strength in mBm, or 0 if unknown + * @sig_dbm: signal strength in dBm, or 0 if unknown * * Use this function to report to userspace when a beacon was * received. It is not useful to call this when there is no diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index e7c64a8dce54..bbb9907bfa86 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -692,7 +692,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev, return rdev_mgmt_tx(rdev, wdev, params, cookie); } -bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, +bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, const u8 *buf, size_t len, u32 flags) { struct wiphy *wiphy = wdev->wiphy; @@ -708,7 +708,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE); u16 stype; - trace_cfg80211_rx_mgmt(wdev, freq, sig_mbm); + trace_cfg80211_rx_mgmt(wdev, freq, sig_dbm); stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4; if (!(stypes->rx & BIT(stype))) { @@ -735,7 +735,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, /* Indicate the received Action frame to user space */ if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, - freq, sig_mbm, + freq, sig_dbm, buf, len, flags, GFP_ATOMIC)) continue; diff --git a/net/wireless/trace.h b/net/wireless/trace.h index f3353fe5b35b..bcfedd39e7a3 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -2544,20 +2544,20 @@ DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta, ); TRACE_EVENT(cfg80211_rx_mgmt, - TP_PROTO(struct wireless_dev *wdev, int freq, int sig_mbm), - TP_ARGS(wdev, freq, sig_mbm), + TP_PROTO(struct wireless_dev *wdev, int freq, int sig_dbm), + TP_ARGS(wdev, freq, sig_dbm), TP_STRUCT__entry( WDEV_ENTRY __field(int, freq) - __field(int, sig_mbm) + __field(int, sig_dbm) ), TP_fast_assign( WDEV_ASSIGN; __entry->freq = freq; - __entry->sig_mbm = sig_mbm; + __entry->sig_dbm = sig_dbm; ), - TP_printk(WDEV_PR_FMT ", freq: %d, sig mbm: %d", - WDEV_PR_ARG, __entry->freq, __entry->sig_mbm) + TP_printk(WDEV_PR_FMT ", freq: %d, sig dbm: %d", + WDEV_PR_ARG, __entry->freq, __entry->sig_dbm) ); TRACE_EVENT(cfg80211_mgmt_tx_status,