cfg80211: add KHz variants of frame RX API
Drivers may wish to report the RX frequency in units of KHz. Provide cfg80211_rx_mgmt_khz() and wrap it with cfg80211_rx_mgmt() so exisiting drivers which can't report KHz anyway don't need to change. Add a similar wrapper for cfg80211_report_obss_beacon() so the frequency units stay somewhat consistent. This doesn't actually change the nl80211 API yet. Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com> Link: https://lore.kernel.org/r/20200430172554.18383-2-thomas@adapt-ip.com [fix mac80211 calling the non-khz version of obss beacon report, drop trace point name changes] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:

committed by
Johannes Berg

parent
c03369558c
commit
e76fede8bf
@@ -729,8 +729,8 @@ 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_dbm,
|
||||
const u8 *buf, size_t len, u32 flags)
|
||||
bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm,
|
||||
const u8 *buf, size_t len, u32 flags)
|
||||
{
|
||||
struct wiphy *wiphy = wdev->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
@@ -785,7 +785,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
|
||||
trace_cfg80211_return_bool(result);
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_rx_mgmt);
|
||||
EXPORT_SYMBOL(cfg80211_rx_mgmt_khz);
|
||||
|
||||
void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev)
|
||||
{
|
||||
|
@@ -16214,7 +16214,7 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
|
||||
netdev->ifindex)) ||
|
||||
nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev),
|
||||
NL80211_ATTR_PAD) ||
|
||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) ||
|
||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, KHZ_TO_MHZ(freq)) ||
|
||||
(sig_dbm &&
|
||||
nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) ||
|
||||
nla_put(msg, NL80211_ATTR_FRAME, len, buf) ||
|
||||
@@ -16840,9 +16840,8 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_probe_status);
|
||||
|
||||
void cfg80211_report_obss_beacon(struct wiphy *wiphy,
|
||||
const u8 *frame, size_t len,
|
||||
int freq, int sig_dbm)
|
||||
void cfg80211_report_obss_beacon_khz(struct wiphy *wiphy, const u8 *frame,
|
||||
size_t len, int freq, int sig_dbm)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
struct sk_buff *msg;
|
||||
@@ -16865,7 +16864,8 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
|
||||
|
||||
if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
|
||||
(freq &&
|
||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq)) ||
|
||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ,
|
||||
KHZ_TO_MHZ(freq))) ||
|
||||
(sig_dbm &&
|
||||
nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) ||
|
||||
nla_put(msg, NL80211_ATTR_FRAME, len, frame))
|
||||
@@ -16882,7 +16882,7 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
|
||||
spin_unlock_bh(&rdev->beacon_registrations_lock);
|
||||
nlmsg_free(msg);
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_report_obss_beacon);
|
||||
EXPORT_SYMBOL(cfg80211_report_obss_beacon_khz);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int cfg80211_net_detect_results(struct sk_buff *msg,
|
||||
|
@@ -2840,8 +2840,8 @@ TRACE_EVENT(cfg80211_rx_mgmt,
|
||||
__entry->freq = freq;
|
||||
__entry->sig_dbm = sig_dbm;
|
||||
),
|
||||
TP_printk(WDEV_PR_FMT ", freq: %d, sig dbm: %d",
|
||||
WDEV_PR_ARG, __entry->freq, __entry->sig_dbm)
|
||||
TP_printk(WDEV_PR_FMT ", freq: "KHZ_F", sig dbm: %d",
|
||||
WDEV_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
|
||||
);
|
||||
|
||||
TRACE_EVENT(cfg80211_mgmt_tx_status,
|
||||
@@ -3121,8 +3121,8 @@ TRACE_EVENT(cfg80211_report_obss_beacon,
|
||||
__entry->freq = freq;
|
||||
__entry->sig_dbm = sig_dbm;
|
||||
),
|
||||
TP_printk(WIPHY_PR_FMT ", freq: %d, sig_dbm: %d",
|
||||
WIPHY_PR_ARG, __entry->freq, __entry->sig_dbm)
|
||||
TP_printk(WIPHY_PR_FMT ", freq: "KHZ_F", sig_dbm: %d",
|
||||
WIPHY_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
|
||||
);
|
||||
|
||||
TRACE_EVENT(cfg80211_tdls_oper_request,
|
||||
|
Reference in New Issue
Block a user