From: Thomas Pedersen Date: Thu, 30 Apr 2020 17:25:50 +0000 (-0700) Subject: cfg80211: add KHz variants of frame RX API X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;ds=inline;h=c1b812f4e6030afa7f4e39957a1fff8b46f96941;p=carl9170fw.git 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 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 Signed-off-by: Christian Lamparter --- diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 1962973..12edfba 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -3344,6 +3344,8 @@ struct element { /* convert frequencies */ #define MHZ_TO_KHZ(freq) ((freq) * 1000) #define KHZ_TO_MHZ(freq) ((freq) / 1000) +#define PR_KHZ(f) KHZ_TO_MHZ(f), f % 1000 +#define KHZ_F "%d.%03d" /* convert powers */ #define DBI_TO_MBI(gain) ((gain) * 100)