aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>2017-11-09 06:46:30 -0500
committerJohannes Berg <johannes.berg@intel.com>2017-12-11 06:19:31 -0500
commit6c2fb1e6527b1092e09c786fee66b1759fa9d574 (patch)
tree2c99129bf8b221fe2db4374db395c740c1593d63
parent9ae3b172e886c851d8cd6a88569025160b485e95 (diff)
cfg80211: cleanup signal strength units notation
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 <sergey.matyukevich.os@quantenna.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--net/wireless/mlme.c6
-rw-r--r--net/wireless/trace.h12
3 files changed, 11 insertions, 11 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 698cebf2de2a..d7f8e7b96bcb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5581,7 +5581,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
5581 * cfg80211_rx_mgmt - notification of received, unprocessed management frame 5581 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
5582 * @wdev: wireless device receiving the frame 5582 * @wdev: wireless device receiving the frame
5583 * @freq: Frequency on which the frame was received in MHz 5583 * @freq: Frequency on which the frame was received in MHz
5584 * @sig_dbm: signal strength in mBm, or 0 if unknown 5584 * @sig_dbm: signal strength in dBm, or 0 if unknown
5585 * @buf: Management frame (header + body) 5585 * @buf: Management frame (header + body)
5586 * @len: length of the frame data 5586 * @len: length of the frame data
5587 * @flags: flags, as defined in enum nl80211_rxmgmt_flags 5587 * @flags: flags, as defined in enum nl80211_rxmgmt_flags
@@ -5760,7 +5760,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
5760 * @frame: the frame 5760 * @frame: the frame
5761 * @len: length of the frame 5761 * @len: length of the frame
5762 * @freq: frequency the frame was received on 5762 * @freq: frequency the frame was received on
5763 * @sig_dbm: signal strength in mBm, or 0 if unknown 5763 * @sig_dbm: signal strength in dBm, or 0 if unknown
5764 * 5764 *
5765 * Use this function to report to userspace when a beacon was 5765 * Use this function to report to userspace when a beacon was
5766 * received. It is not useful to call this when there is no 5766 * 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,
692 return rdev_mgmt_tx(rdev, wdev, params, cookie); 692 return rdev_mgmt_tx(rdev, wdev, params, cookie);
693} 693}
694 694
695bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, 695bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
696 const u8 *buf, size_t len, u32 flags) 696 const u8 *buf, size_t len, u32 flags)
697{ 697{
698 struct wiphy *wiphy = wdev->wiphy; 698 struct wiphy *wiphy = wdev->wiphy;
@@ -708,7 +708,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
708 cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE); 708 cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE);
709 u16 stype; 709 u16 stype;
710 710
711 trace_cfg80211_rx_mgmt(wdev, freq, sig_mbm); 711 trace_cfg80211_rx_mgmt(wdev, freq, sig_dbm);
712 stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4; 712 stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
713 713
714 if (!(stypes->rx & BIT(stype))) { 714 if (!(stypes->rx & BIT(stype))) {
@@ -735,7 +735,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm,
735 735
736 /* Indicate the received Action frame to user space */ 736 /* Indicate the received Action frame to user space */
737 if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, 737 if (nl80211_send_mgmt(rdev, wdev, reg->nlportid,
738 freq, sig_mbm, 738 freq, sig_dbm,
739 buf, len, flags, GFP_ATOMIC)) 739 buf, len, flags, GFP_ATOMIC))
740 continue; 740 continue;
741 741
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,
2544); 2544);
2545 2545
2546TRACE_EVENT(cfg80211_rx_mgmt, 2546TRACE_EVENT(cfg80211_rx_mgmt,
2547 TP_PROTO(struct wireless_dev *wdev, int freq, int sig_mbm), 2547 TP_PROTO(struct wireless_dev *wdev, int freq, int sig_dbm),
2548 TP_ARGS(wdev, freq, sig_mbm), 2548 TP_ARGS(wdev, freq, sig_dbm),
2549 TP_STRUCT__entry( 2549 TP_STRUCT__entry(
2550 WDEV_ENTRY 2550 WDEV_ENTRY
2551 __field(int, freq) 2551 __field(int, freq)
2552 __field(int, sig_mbm) 2552 __field(int, sig_dbm)
2553 ), 2553 ),
2554 TP_fast_assign( 2554 TP_fast_assign(
2555 WDEV_ASSIGN; 2555 WDEV_ASSIGN;
2556 __entry->freq = freq; 2556 __entry->freq = freq;
2557 __entry->sig_mbm = sig_mbm; 2557 __entry->sig_dbm = sig_dbm;
2558 ), 2558 ),
2559 TP_printk(WDEV_PR_FMT ", freq: %d, sig mbm: %d", 2559 TP_printk(WDEV_PR_FMT ", freq: %d, sig dbm: %d",
2560 WDEV_PR_ARG, __entry->freq, __entry->sig_mbm) 2560 WDEV_PR_ARG, __entry->freq, __entry->sig_dbm)
2561); 2561);
2562 2562
2563TRACE_EVENT(cfg80211_mgmt_tx_status, 2563TRACE_EVENT(cfg80211_mgmt_tx_status,