diff options
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 6 | ||||
-rw-r--r-- | include/linux/nl80211.h | 6 | ||||
-rw-r--r-- | include/net/cfg80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/rx.c | 13 | ||||
-rw-r--r-- | net/wireless/mlme.c | 7 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 9 | ||||
-rw-r--r-- | net/wireless/nl80211.h | 3 |
7 files changed, 39 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 18fa9aa8af92..97abf4699b41 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -556,7 +556,8 @@ static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
556 | dlen, freq, vif->probe_req_report); | 556 | dlen, freq, vif->probe_req_report); |
557 | 557 | ||
558 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) | 558 | if (vif->probe_req_report || vif->nw_type == AP_NETWORK) |
559 | cfg80211_rx_mgmt(vif->ndev, freq, ev->data, dlen, GFP_ATOMIC); | 559 | cfg80211_rx_mgmt(vif->ndev, freq, 0, |
560 | ev->data, dlen, GFP_ATOMIC); | ||
560 | 561 | ||
561 | return 0; | 562 | return 0; |
562 | } | 563 | } |
@@ -595,7 +596,8 @@ static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len, | |||
595 | return -EINVAL; | 596 | return -EINVAL; |
596 | } | 597 | } |
597 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); | 598 | ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); |
598 | cfg80211_rx_mgmt(vif->ndev, freq, ev->data, dlen, GFP_ATOMIC); | 599 | cfg80211_rx_mgmt(vif->ndev, freq, 0, |
600 | ev->data, dlen, GFP_ATOMIC); | ||
599 | 601 | ||
600 | return 0; | 602 | return 0; |
601 | } | 603 | } |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 9f46c62b1eee..c37d67add090 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -1203,6 +1203,10 @@ enum nl80211_commands { | |||
1203 | * the list. This needs to be used when the driver advertises the | 1203 | * the list. This needs to be used when the driver advertises the |
1204 | * capability to timeout the stations. | 1204 | * capability to timeout the stations. |
1205 | * | 1205 | * |
1206 | * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int); | ||
1207 | * this attribute is (depending on the driver capabilities) added to | ||
1208 | * received frames indicated with %NL80211_CMD_FRAME. | ||
1209 | * | ||
1206 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1210 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1207 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1211 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1208 | */ | 1212 | */ |
@@ -1450,6 +1454,8 @@ enum nl80211_attrs { | |||
1450 | 1454 | ||
1451 | NL80211_ATTR_INACTIVITY_TIMEOUT, | 1455 | NL80211_ATTR_INACTIVITY_TIMEOUT, |
1452 | 1456 | ||
1457 | NL80211_ATTR_RX_SIGNAL_DBM, | ||
1458 | |||
1453 | /* add attributes here, update the policy in nl80211.c */ | 1459 | /* add attributes here, update the policy in nl80211.c */ |
1454 | 1460 | ||
1455 | __NL80211_ATTR_AFTER_LAST, | 1461 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 804805827736..4682c35a92c4 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -3189,6 +3189,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | |||
3189 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame | 3189 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
3190 | * @dev: network device | 3190 | * @dev: network device |
3191 | * @freq: Frequency on which the frame was received in MHz | 3191 | * @freq: Frequency on which the frame was received in MHz |
3192 | * @sig_dbm: signal strength in mBm, or 0 if unknown | ||
3192 | * @buf: Management frame (header + body) | 3193 | * @buf: Management frame (header + body) |
3193 | * @len: length of the frame data | 3194 | * @len: length of the frame data |
3194 | * @gfp: context flags | 3195 | * @gfp: context flags |
@@ -3201,8 +3202,8 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | |||
3201 | * This function is called whenever an Action frame is received for a station | 3202 | * This function is called whenever an Action frame is received for a station |
3202 | * mode interface, but is not processed in kernel. | 3203 | * mode interface, but is not processed in kernel. |
3203 | */ | 3204 | */ |
3204 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, | 3205 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, |
3205 | size_t len, gfp_t gfp); | 3206 | const u8 *buf, size_t len, gfp_t gfp); |
3206 | 3207 | ||
3207 | /** | 3208 | /** |
3208 | * cfg80211_mgmt_tx_status - notification of TX status for management frame | 3209 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
@@ -3315,6 +3316,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3315 | * @frame: the frame | 3316 | * @frame: the frame |
3316 | * @len: length of the frame | 3317 | * @len: length of the frame |
3317 | * @freq: frequency the frame was received on | 3318 | * @freq: frequency the frame was received on |
3319 | * @sig_dbm: signal strength in mBm, or 0 if unknown | ||
3318 | * @gfp: allocation flags | 3320 | * @gfp: allocation flags |
3319 | * | 3321 | * |
3320 | * Use this function to report to userspace when a beacon was | 3322 | * Use this function to report to userspace when a beacon was |
@@ -3323,7 +3325,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3323 | */ | 3325 | */ |
3324 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 3326 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
3325 | const u8 *frame, size_t len, | 3327 | const u8 *frame, size_t len, |
3326 | int freq, gfp_t gfp); | 3328 | int freq, int sig_dbm, gfp_t gfp); |
3327 | 3329 | ||
3328 | /* | 3330 | /* |
3329 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3331 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 10bbbd33b314..5f6e32ca0858 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2188,9 +2188,14 @@ ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) | |||
2188 | if (rx->sdata->vif.type == NL80211_IFTYPE_AP && | 2188 | if (rx->sdata->vif.type == NL80211_IFTYPE_AP && |
2189 | ieee80211_is_beacon(mgmt->frame_control) && | 2189 | ieee80211_is_beacon(mgmt->frame_control) && |
2190 | !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) { | 2190 | !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) { |
2191 | int sig = 0; | ||
2192 | |||
2193 | if (rx->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) | ||
2194 | sig = status->signal; | ||
2195 | |||
2191 | cfg80211_report_obss_beacon(rx->local->hw.wiphy, | 2196 | cfg80211_report_obss_beacon(rx->local->hw.wiphy, |
2192 | rx->skb->data, rx->skb->len, | 2197 | rx->skb->data, rx->skb->len, |
2193 | status->freq, GFP_ATOMIC); | 2198 | status->freq, sig, GFP_ATOMIC); |
2194 | rx->flags |= IEEE80211_RX_BEACON_REPORTED; | 2199 | rx->flags |= IEEE80211_RX_BEACON_REPORTED; |
2195 | } | 2200 | } |
2196 | 2201 | ||
@@ -2414,6 +2419,7 @@ static ieee80211_rx_result debug_noinline | |||
2414 | ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) | 2419 | ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) |
2415 | { | 2420 | { |
2416 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); | 2421 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); |
2422 | int sig = 0; | ||
2417 | 2423 | ||
2418 | /* skip known-bad action frames and return them in the next handler */ | 2424 | /* skip known-bad action frames and return them in the next handler */ |
2419 | if (status->rx_flags & IEEE80211_RX_MALFORMED_ACTION_FRM) | 2425 | if (status->rx_flags & IEEE80211_RX_MALFORMED_ACTION_FRM) |
@@ -2426,7 +2432,10 @@ ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) | |||
2426 | * it transmitted were processed or returned. | 2432 | * it transmitted were processed or returned. |
2427 | */ | 2433 | */ |
2428 | 2434 | ||
2429 | if (cfg80211_rx_mgmt(rx->sdata->dev, status->freq, | 2435 | if (rx->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) |
2436 | sig = status->signal; | ||
2437 | |||
2438 | if (cfg80211_rx_mgmt(rx->sdata->dev, status->freq, sig, | ||
2430 | rx->skb->data, rx->skb->len, | 2439 | rx->skb->data, rx->skb->len, |
2431 | GFP_ATOMIC)) { | 2440 | GFP_ATOMIC)) { |
2432 | if (rx->sta) | 2441 | if (rx->sta) |
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index fb1e72179117..f5a7ac3a0939 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -814,8 +814,8 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev, | |||
814 | cookie); | 814 | cookie); |
815 | } | 815 | } |
816 | 816 | ||
817 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, | 817 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_mbm, |
818 | size_t len, gfp_t gfp) | 818 | const u8 *buf, size_t len, gfp_t gfp) |
819 | { | 819 | { |
820 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 820 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
821 | struct wiphy *wiphy = wdev->wiphy; | 821 | struct wiphy *wiphy = wdev->wiphy; |
@@ -854,7 +854,8 @@ bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, | |||
854 | /* found match! */ | 854 | /* found match! */ |
855 | 855 | ||
856 | /* Indicate the received Action frame to user space */ | 856 | /* Indicate the received Action frame to user space */ |
857 | if (nl80211_send_mgmt(rdev, dev, reg->nlpid, freq, | 857 | if (nl80211_send_mgmt(rdev, dev, reg->nlpid, |
858 | freq, sig_mbm, | ||
858 | buf, len, gfp)) | 859 | buf, len, gfp)) |
859 | continue; | 860 | continue; |
860 | 861 | ||
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); |
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h index 12bf4d185abe..4ffe50df9f31 100644 --- a/net/wireless/nl80211.h +++ b/net/wireless/nl80211.h | |||
@@ -92,7 +92,8 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev, | |||
92 | gfp_t gfp); | 92 | gfp_t gfp); |
93 | 93 | ||
94 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 94 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
95 | struct net_device *netdev, u32 nlpid, int freq, | 95 | struct net_device *netdev, u32 nlpid, |
96 | int freq, int sig_dbm, | ||
96 | const u8 *buf, size_t len, gfp_t gfp); | 97 | const u8 *buf, size_t len, gfp_t gfp); |
97 | void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev, | 98 | void nl80211_send_mgmt_tx_status(struct cfg80211_registered_device *rdev, |
98 | struct net_device *netdev, u64 cookie, | 99 | struct net_device *netdev, u64 cookie, |