aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-11-04 06:18:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-11-09 16:13:52 -0500
commitee971924543fe82f279d3e97f6f6d02320b381b7 (patch)
tree8388d05cedbdf969fe05de3c752c0bf24f67efb3
parent5e760230e42cf759bd923457ca2753aacf2e656e (diff)
mac80211: report OBSS beacons
If there's an interface in AP mode, OBSS beacons are needed by hostapd/wpa_s to implement logic to enable/disable protection etc. Report the frames and set the capability flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/main.c3
-rw-r--r--net/mac80211/rx.c12
3 files changed, 17 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 386330c89baf..4bef6eca1722 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -184,12 +184,15 @@ enum ieee80211_packet_rx_flags {
184 * enum ieee80211_rx_flags - RX data flags 184 * enum ieee80211_rx_flags - RX data flags
185 * 185 *
186 * @IEEE80211_RX_CMNTR: received on cooked monitor already 186 * @IEEE80211_RX_CMNTR: received on cooked monitor already
187 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
188 * to cfg80211_report_obss_beacon().
187 * 189 *
188 * These flags are used across handling multiple interfaces 190 * These flags are used across handling multiple interfaces
189 * for a single frame. 191 * for a single frame.
190 */ 192 */
191enum ieee80211_rx_flags { 193enum ieee80211_rx_flags {
192 IEEE80211_RX_CMNTR = BIT(0), 194 IEEE80211_RX_CMNTR = BIT(0),
195 IEEE80211_RX_BEACON_REPORTED = BIT(1),
193}; 196};
194 197
195struct ieee80211_rx_data { 198struct ieee80211_rx_data {
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 7217019d1ed9..8e9327bca910 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -593,7 +593,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
593 593
594 wiphy->flags |= WIPHY_FLAG_NETNS_OK | 594 wiphy->flags |= WIPHY_FLAG_NETNS_OK |
595 WIPHY_FLAG_4ADDR_AP | 595 WIPHY_FLAG_4ADDR_AP |
596 WIPHY_FLAG_4ADDR_STATION; 596 WIPHY_FLAG_4ADDR_STATION |
597 WIPHY_FLAG_REPORTS_OBSS;
597 598
598 if (!ops->set_key) 599 if (!ops->set_key)
599 wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 600 wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index e832e0dcab3c..2ed882f8a9f8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2188,6 +2188,18 @@ ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx)
2188 if (!ieee80211_is_mgmt(mgmt->frame_control)) 2188 if (!ieee80211_is_mgmt(mgmt->frame_control))
2189 return RX_DROP_MONITOR; 2189 return RX_DROP_MONITOR;
2190 2190
2191 if (rx->sdata->vif.type == NL80211_IFTYPE_AP &&
2192 ieee80211_is_beacon(mgmt->frame_control) &&
2193 !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) {
2194 struct ieee80211_rx_status *status;
2195
2196 status = IEEE80211_SKB_RXCB(rx->skb);
2197 cfg80211_report_obss_beacon(rx->local->hw.wiphy,
2198 rx->skb->data, rx->skb->len,
2199 status->freq, GFP_ATOMIC);
2200 rx->flags |= IEEE80211_RX_BEACON_REPORTED;
2201 }
2202
2191 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 2203 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH))
2192 return RX_DROP_MONITOR; 2204 return RX_DROP_MONITOR;
2193 2205