Skip to content

Commit

Permalink
nl80211: include frequency offset in survey info
Browse files Browse the repository at this point in the history
Recently channels gained a potential frequency offset, so
include this in the per-channel survey info.

Signed-off-by: Thomas Pedersen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[add the offset only if non-zero]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
twpedersen authored and jmberg-intel committed Sep 28, 2020
1 parent 1d00ce8 commit 58ef7c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/uapi/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -4097,6 +4097,7 @@ enum nl80211_user_reg_hint_type {
* receiving frames destined to the local BSS
* @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
* currently defined
* @NL80211_SURVEY_INFO_FREQUENCY_OFFSET: center frequency offset in KHz
* @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
*/
enum nl80211_survey_info {
Expand All @@ -4112,6 +4113,7 @@ enum nl80211_survey_info {
NL80211_SURVEY_INFO_TIME_SCAN,
NL80211_SURVEY_INFO_PAD,
NL80211_SURVEY_INFO_TIME_BSS_RX,
NL80211_SURVEY_INFO_FREQUENCY_OFFSET,

/* keep last */
__NL80211_SURVEY_INFO_AFTER_LAST,
Expand Down
5 changes: 5 additions & 0 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -9319,6 +9319,11 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq,
survey->channel->center_freq))
goto nla_put_failure;

if (survey->channel && survey->channel->freq_offset &&
nla_put_u32(msg, NL80211_SURVEY_INFO_FREQUENCY_OFFSET,
survey->channel->freq_offset))
goto nla_put_failure;

if ((survey->filled & SURVEY_INFO_NOISE_DBM) &&
nla_put_u8(msg, NL80211_SURVEY_INFO_NOISE, survey->noise))
goto nla_put_failure;
Expand Down

0 comments on commit 58ef7c1

Please sign in to comment.