diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-05 16:18:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-06 15:16:05 -0500 |
commit | 804483e90794256f9ed53e795ffbf1e94de237c8 (patch) | |
tree | 22a4d8ade674bb42aaf4d3e878dfd6a73b618dcc /net/wireless/nl80211.c | |
parent | 769009b89d8c29c410a99eee3cd63764b1fff869 (diff) |
cfg80211/mac80211: report signal strength for mgmt frames
Add the signal strength (in dBm only for now) to
frames that are received via nl80211's various
frame APIs.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 4b6afc338aac..39dbdf2adb12 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -7686,7 +7686,8 @@ bool nl80211_unexpected_4addr_frame(struct net_device *dev, | |||
7686 | 7686 | ||
7687 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 7687 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
7688 | struct net_device *netdev, u32 nlpid, | 7688 | struct net_device *netdev, u32 nlpid, |
7689 | int freq, const u8 *buf, size_t len, gfp_t gfp) | 7689 | int freq, int sig_dbm, |
7690 | const u8 *buf, size_t len, gfp_t gfp) | ||
7690 | { | 7691 | { |
7691 | struct sk_buff *msg; | 7692 | struct sk_buff *msg; |
7692 | void *hdr; | 7693 | void *hdr; |
@@ -7704,6 +7705,8 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | |||
7704 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); | 7705 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); |
7705 | NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); | 7706 | NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); |
7706 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq); | 7707 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq); |
7708 | if (sig_dbm) | ||
7709 | NLA_PUT_U32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm); | ||
7707 | NLA_PUT(msg, NL80211_ATTR_FRAME, len, buf); | 7710 | NLA_PUT(msg, NL80211_ATTR_FRAME, len, buf); |
7708 | 7711 | ||
7709 | genlmsg_end(msg, hdr); | 7712 | genlmsg_end(msg, hdr); |
@@ -7965,7 +7968,7 @@ EXPORT_SYMBOL(cfg80211_probe_status); | |||
7965 | 7968 | ||
7966 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 7969 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
7967 | const u8 *frame, size_t len, | 7970 | const u8 *frame, size_t len, |
7968 | int freq, gfp_t gfp) | 7971 | int freq, int sig_dbm, gfp_t gfp) |
7969 | { | 7972 | { |
7970 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 7973 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
7971 | struct sk_buff *msg; | 7974 | struct sk_buff *msg; |
@@ -7988,6 +7991,8 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
7988 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); | 7991 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); |
7989 | if (freq) | 7992 | if (freq) |
7990 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq); | 7993 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq); |
7994 | if (sig_dbm) | ||
7995 | NLA_PUT_U32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm); | ||
7991 | NLA_PUT(msg, NL80211_ATTR_FRAME, len, frame); | 7996 | NLA_PUT(msg, NL80211_ATTR_FRAME, len, frame); |
7992 | 7997 | ||
7993 | genlmsg_end(msg, hdr); | 7998 | genlmsg_end(msg, hdr); |