aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-07-11 10:09:06 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-08-01 12:30:33 -0400
commit73da7d5bab79ad7e16ff44d67c3fe8b9c0b33e5b (patch)
treecb4eee7b96aae1d31a4841167a3f36c638bd0a11 /include
parent16ef1fe272332b2f7fd99236017b891db48d9cd6 (diff)
mac80211: add channel switch command and beacon callbacks
The count field in CSA must be decremented with each beacon transmitted. This patch implements the functionality for drivers using ieee80211_beacon_get(). Other drivers must call back manually after reaching count == 0. This patch also contains the handling and finish worker for the channel switch command, and mac80211/chanctx code to allow to change a channel definition of an active channel context. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> [small cleanups, catch identical chandef] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/mac80211.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3124036285eb..9cda3728c2cb 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -152,11 +152,14 @@ struct ieee80211_low_level_stats {
152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA
155 */ 157 */
156enum ieee80211_chanctx_change { 158enum ieee80211_chanctx_change {
157 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
158 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
159 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
160}; 163};
161 164
162/** 165/**
@@ -1084,6 +1087,7 @@ enum ieee80211_vif_flags {
1084 * @addr: address of this interface 1087 * @addr: address of this interface
1085 * @p2p: indicates whether this AP or STA interface is a p2p 1088 * @p2p: indicates whether this AP or STA interface is a p2p
1086 * interface, i.e. a GO or p2p-sta respectively 1089 * interface, i.e. a GO or p2p-sta respectively
1090 * @csa_active: marks whether a channel switch is going on
1087 * @driver_flags: flags/capabilities the driver has for this interface, 1091 * @driver_flags: flags/capabilities the driver has for this interface,
1088 * these need to be set (or cleared) when the interface is added 1092 * these need to be set (or cleared) when the interface is added
1089 * or, if supported by the driver, the interface type is changed 1093 * or, if supported by the driver, the interface type is changed
@@ -1106,6 +1110,7 @@ struct ieee80211_vif {
1106 struct ieee80211_bss_conf bss_conf; 1110 struct ieee80211_bss_conf bss_conf;
1107 u8 addr[ETH_ALEN]; 1111 u8 addr[ETH_ALEN];
1108 bool p2p; 1112 bool p2p;
1113 bool csa_active;
1109 1114
1110 u8 cab_queue; 1115 u8 cab_queue;
1111 u8 hw_queue[IEEE80211_NUM_ACS]; 1116 u8 hw_queue[IEEE80211_NUM_ACS];
@@ -2637,6 +2642,16 @@ enum ieee80211_roc_type {
2637 * @ipv6_addr_change: IPv6 address assignment on the given interface changed. 2642 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2638 * Currently, this is only called for managed or P2P client interfaces. 2643 * Currently, this is only called for managed or P2P client interfaces.
2639 * This callback is optional; it must not sleep. 2644 * This callback is optional; it must not sleep.
2645 *
2646 * @channel_switch_beacon: Starts a channel switch to a new channel.
2647 * Beacons are modified to include CSA or ECSA IEs before calling this
2648 * function. The corresponding count fields in these IEs must be
2649 * decremented, and when they reach zero the driver must call
2650 * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get()
2651 * get the csa counter decremented by mac80211, but must check if it is
2652 * zero using ieee80211_csa_is_complete() after the beacon has been
2653 * transmitted and then call ieee80211_csa_finish().
2654 *
2640 */ 2655 */
2641struct ieee80211_ops { 2656struct ieee80211_ops {
2642 void (*tx)(struct ieee80211_hw *hw, 2657 void (*tx)(struct ieee80211_hw *hw,
@@ -2824,6 +2839,9 @@ struct ieee80211_ops {
2824 struct ieee80211_vif *vif, 2839 struct ieee80211_vif *vif,
2825 struct inet6_dev *idev); 2840 struct inet6_dev *idev);
2826#endif 2841#endif
2842 void (*channel_switch_beacon)(struct ieee80211_hw *hw,
2843 struct ieee80211_vif *vif,
2844 struct cfg80211_chan_def *chandef);
2827}; 2845};
2828 2846
2829/** 2847/**
@@ -3319,6 +3337,25 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3319} 3337}
3320 3338
3321/** 3339/**
3340 * ieee80211_csa_finish - notify mac80211 about channel switch
3341 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3342 *
3343 * After a channel switch announcement was scheduled and the counter in this
3344 * announcement hit zero, this function must be called by the driver to
3345 * notify mac80211 that the channel can be changed.
3346 */
3347void ieee80211_csa_finish(struct ieee80211_vif *vif);
3348
3349/**
3350 * ieee80211_csa_is_complete - find out if counters reached zero
3351 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3352 *
3353 * This function returns whether the channel switch counters reached zero.
3354 */
3355bool ieee80211_csa_is_complete(struct ieee80211_vif *vif);
3356
3357
3358/**
3322 * ieee80211_proberesp_get - retrieve a Probe Response template 3359 * ieee80211_proberesp_get - retrieve a Probe Response template
3323 * @hw: pointer obtained from ieee80211_alloc_hw(). 3360 * @hw: pointer obtained from ieee80211_alloc_hw().
3324 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3361 * @vif: &struct ieee80211_vif pointer from the add_interface callback.