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>
This commit is contained in:
Sergey Matyukevich 2017-11-09 14:46:30 +03:00 committed by Johannes Berg
parent 9ae3b172e8
commit 6c2fb1e652
3 changed files with 11 additions and 11 deletions

View File

@ -5581,7 +5581,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
* cfg80211_rx_mgmt - notification of received, unprocessed management frame * cfg80211_rx_mgmt - notification of received, unprocessed management frame
* @wdev: wireless device receiving the frame * @wdev: wireless device receiving the frame
* @freq: Frequency on which the frame was received in MHz * @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) * @buf: Management frame (header + body)
* @len: length of the frame data * @len: length of the frame data
* @flags: flags, as defined in enum nl80211_rxmgmt_flags * @flags: flags, as defined in enum nl80211_rxmgmt_flags
@ -5760,7 +5760,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
* @frame: the frame * @frame: the frame
* @len: length of the frame * @len: length of the frame
* @freq: frequency the frame was received on * @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 * Use this function to report to userspace when a beacon was
* received. It is not useful to call this when there is no * received. It is not useful to call this when there is no

View File

@ -692,7 +692,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
return rdev_mgmt_tx(rdev, wdev, params, cookie); 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) const u8 *buf, size_t len, u32 flags)
{ {
struct wiphy *wiphy = wdev->wiphy; 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); cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE);
u16 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; stype = (le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
if (!(stypes->rx & BIT(stype))) { 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 */ /* Indicate the received Action frame to user space */
if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, if (nl80211_send_mgmt(rdev, wdev, reg->nlportid,
freq, sig_mbm, freq, sig_dbm,
buf, len, flags, GFP_ATOMIC)) buf, len, flags, GFP_ATOMIC))
continue; continue;

View File

@ -2544,20 +2544,20 @@ DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta,
); );
TRACE_EVENT(cfg80211_rx_mgmt, TRACE_EVENT(cfg80211_rx_mgmt,
TP_PROTO(struct wireless_dev *wdev, int freq, int sig_mbm), TP_PROTO(struct wireless_dev *wdev, int freq, int sig_dbm),
TP_ARGS(wdev, freq, sig_mbm), TP_ARGS(wdev, freq, sig_dbm),
TP_STRUCT__entry( TP_STRUCT__entry(
WDEV_ENTRY WDEV_ENTRY
__field(int, freq) __field(int, freq)
__field(int, sig_mbm) __field(int, sig_dbm)
), ),
TP_fast_assign( TP_fast_assign(
WDEV_ASSIGN; WDEV_ASSIGN;
__entry->freq = freq; __entry->freq = freq;
__entry->sig_mbm = sig_mbm; __entry->sig_dbm = sig_dbm;
), ),
TP_printk(WDEV_PR_FMT ", freq: %d, sig mbm: %d", TP_printk(WDEV_PR_FMT ", freq: %d, sig dbm: %d",
WDEV_PR_ARG, __entry->freq, __entry->sig_mbm) WDEV_PR_ARG, __entry->freq, __entry->sig_dbm)
); );
TRACE_EVENT(cfg80211_mgmt_tx_status, TRACE_EVENT(cfg80211_mgmt_tx_status,