aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-08-28 07:41:31 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-09-26 07:27:14 -0400
commitcd7760e62c2ac8581f050b2d36501d1a60beaf83 (patch)
tree1f4e9fb22e3b952c68c2e055a5381f5f9c5a2f94 /net/mac80211/rx.c
parent871a4180b8b62dbed54cd203c33bdab7fce24e6f (diff)
mac80211: add support for CSA in IBSS mode
This function adds the channel switch announcement implementation for the IBSS code. It is triggered by userspace (mac80211/cfg) or by external channel switch announcement, which have to be adopted. Both CSAs in beacons and action frames are supported. As for AP mode, the channel switch is applied after some time. However in IBSS mode, the channel switch IEs are generated in the kernel. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 54395d7583ba..8e908e17e248 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2402,7 +2402,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2402 return RX_DROP_UNUSABLE; 2402 return RX_DROP_UNUSABLE;
2403 2403
2404 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && 2404 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC &&
2405 mgmt->u.action.category != WLAN_CATEGORY_SELF_PROTECTED) 2405 mgmt->u.action.category != WLAN_CATEGORY_SELF_PROTECTED &&
2406 mgmt->u.action.category != WLAN_CATEGORY_SPECTRUM_MGMT)
2406 return RX_DROP_UNUSABLE; 2407 return RX_DROP_UNUSABLE;
2407 2408
2408 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 2409 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH))
@@ -2566,31 +2567,46 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2566 2567
2567 goto queue; 2568 goto queue;
2568 case WLAN_CATEGORY_SPECTRUM_MGMT: 2569 case WLAN_CATEGORY_SPECTRUM_MGMT:
2569 if (status->band != IEEE80211_BAND_5GHZ)
2570 break;
2571
2572 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2573 break;
2574
2575 /* verify action_code is present */ 2570 /* verify action_code is present */
2576 if (len < IEEE80211_MIN_ACTION_SIZE + 1) 2571 if (len < IEEE80211_MIN_ACTION_SIZE + 1)
2577 break; 2572 break;
2578 2573
2579 switch (mgmt->u.action.u.measurement.action_code) { 2574 switch (mgmt->u.action.u.measurement.action_code) {
2580 case WLAN_ACTION_SPCT_MSR_REQ: 2575 case WLAN_ACTION_SPCT_MSR_REQ:
2576 if (status->band != IEEE80211_BAND_5GHZ)
2577 break;
2578
2581 if (len < (IEEE80211_MIN_ACTION_SIZE + 2579 if (len < (IEEE80211_MIN_ACTION_SIZE +
2582 sizeof(mgmt->u.action.u.measurement))) 2580 sizeof(mgmt->u.action.u.measurement)))
2583 break; 2581 break;
2582
2583 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2584 break;
2585
2584 ieee80211_process_measurement_req(sdata, mgmt, len); 2586 ieee80211_process_measurement_req(sdata, mgmt, len);
2585 goto handled; 2587 goto handled;
2586 case WLAN_ACTION_SPCT_CHL_SWITCH: 2588 case WLAN_ACTION_SPCT_CHL_SWITCH: {
2587 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2589 u8 *bssid;
2590 if (len < (IEEE80211_MIN_ACTION_SIZE +
2591 sizeof(mgmt->u.action.u.chan_switch)))
2588 break; 2592 break;
2589 2593
2590 if (!ether_addr_equal(mgmt->bssid, sdata->u.mgd.bssid)) 2594 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
2595 sdata->vif.type != NL80211_IFTYPE_ADHOC)
2596 break;
2597
2598 if (sdata->vif.type == NL80211_IFTYPE_STATION)
2599 bssid = sdata->u.mgd.bssid;
2600 else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
2601 bssid = sdata->u.ibss.bssid;
2602 else
2603 break;
2604
2605 if (!ether_addr_equal(mgmt->bssid, bssid))
2591 break; 2606 break;
2592 2607
2593 goto queue; 2608 goto queue;
2609 }
2594 } 2610 }
2595 break; 2611 break;
2596 case WLAN_CATEGORY_SA_QUERY: 2612 case WLAN_CATEGORY_SA_QUERY: