summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg2012-06-18 20:07:15 +0200
committerJohannes Berg2012-08-20 13:58:22 +0200
commitf142c6b906da451ded2c7a8e17b2a0e6fee3e891 (patch)
treeed23b88e0cc23cb15fa28563d27965421ed47dd7 /net/mac80211/rx.c
parentcfg80211: add P2P Device abstraction (diff)
downloadkernel-qcow2-linux-f142c6b906da451ded2c7a8e17b2a0e6fee3e891.tar.gz
kernel-qcow2-linux-f142c6b906da451ded2c7a8e17b2a0e6fee3e891.tar.xz
kernel-qcow2-linux-f142c6b906da451ded2c7a8e17b2a0e6fee3e891.zip
mac80211: support P2P Device abstraction
After cfg80211 got a P2P Device abstraction, add support to mac80211. Whether it really is supported or not will depend on whether or not the driver has support for it, but mac80211 needs to change to be able to support drivers that need a P2P Device. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 78bf6c7e80c8..f5258ebc15be 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2812,8 +2812,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
if (!bssid) {
if (!ether_addr_equal(sdata->vif.addr, hdr->addr1))
return 0;
- } else if (!ieee80211_bssid_match(bssid,
- sdata->vif.addr)) {
+ } else if (!ieee80211_bssid_match(bssid, sdata->vif.addr)) {
/*
* Accept public action frames even when the
* BSSID doesn't match, this is used for P2P
@@ -2833,9 +2832,18 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2))
return 0;
break;
+ case NL80211_IFTYPE_P2P_DEVICE:
+ if (!ieee80211_is_public_action(hdr, skb->len) &&
+ !ieee80211_is_probe_req(hdr->frame_control) &&
+ !ieee80211_is_probe_resp(hdr->frame_control) &&
+ !ieee80211_is_beacon(hdr->frame_control))
+ return 0;
+ if (!ether_addr_equal(sdata->vif.addr, hdr->addr1))
+ status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
+ break;
default:
/* should never get here */
- WARN_ON(1);
+ WARN_ON_ONCE(1);
break;
}