aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-05-23 07:33:12 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-05-26 05:04:41 -0400
commit1a5f0c13d1a8808c2bdd00630818ed491e1719f5 (patch)
tree8fd17631d3377a97be2ccb2181739b4077cf8011 /include/net/mac80211.h
parent67af9811539be83dbdc0739215d29af23c870405 (diff)
mac80211: add a single-transaction driver op to switch contexts
In some cases, when the driver is already using all the channel contexts it can handle at once, we have to do an in-place switch (ie. we cannot afford using an extra context temporarily for the transaction). But some drivers may not support switching the channel context assigned to a vif on the fly (ie. without unassigning and assigning it) while others may only work if the context is changed on the fly, without unassigning it first. To allow these different scenarios, add a new driver operation that let's the driver decide how to handle an in-place switch. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2c78997bc48d..421b6ecb4b2c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -189,6 +189,43 @@ struct ieee80211_chanctx_conf {
189}; 189};
190 190
191/** 191/**
192 * enum ieee80211_chanctx_switch_mode - channel context switch mode
193 * @CHANCTX_SWMODE_REASSIGN_VIF: Both old and new contexts already
194 * exist (and will continue to exist), but the virtual interface
195 * needs to be switched from one to the other.
196 * @CHANCTX_SWMODE_SWAP_CONTEXTS: The old context exists but will stop
197 * to exist with this call, the new context doesn't exist but
198 * will be active after this call, the virtual interface switches
199 * from the old to the new (note that the driver may of course
200 * implement this as an on-the-fly chandef switch of the existing
201 * hardware context, but the mac80211 pointer for the old context
202 * will cease to exist and only the new one will later be used
203 * for changes/removal.)
204 */
205enum ieee80211_chanctx_switch_mode {
206 CHANCTX_SWMODE_REASSIGN_VIF,
207 CHANCTX_SWMODE_SWAP_CONTEXTS,
208};
209
210/**
211 * struct ieee80211_vif_chanctx_switch - vif chanctx switch information
212 *
213 * This is structure is used to pass information about a vif that
214 * needs to switch from one chanctx to another. The
215 * &ieee80211_chanctx_switch_mode defines how the switch should be
216 * done.
217 *
218 * @vif: the vif that should be switched from old_ctx to new_ctx
219 * @old_ctx: the old context to which the vif was assigned
220 * @new_ctx: the new context to which the vif must be assigned
221 */
222struct ieee80211_vif_chanctx_switch {
223 struct ieee80211_vif *vif;
224 struct ieee80211_chanctx_conf *old_ctx;
225 struct ieee80211_chanctx_conf *new_ctx;
226};
227
228/**
192 * enum ieee80211_bss_change - BSS change notification flags 229 * enum ieee80211_bss_change - BSS change notification flags
193 * 230 *
194 * These flags are used with the bss_info_changed() callback 231 * These flags are used with the bss_info_changed() callback
@@ -2736,6 +2773,11 @@ enum ieee80211_roc_type {
2736 * to vif. Possible use is for hw queue remapping. 2773 * to vif. Possible use is for hw queue remapping.
2737 * @unassign_vif_chanctx: Notifies device driver about channel context being 2774 * @unassign_vif_chanctx: Notifies device driver about channel context being
2738 * unbound from vif. 2775 * unbound from vif.
2776 * @switch_vif_chanctx: switch a number of vifs from one chanctx to
2777 * another, as specified in the list of
2778 * @ieee80211_vif_chanctx_switch passed to the driver, according
2779 * to the mode defined in &ieee80211_chanctx_switch_mode.
2780 *
2739 * @start_ap: Start operation on the AP interface, this is called after all the 2781 * @start_ap: Start operation on the AP interface, this is called after all the
2740 * information in bss_conf is set and beacon can be retrieved. A channel 2782 * information in bss_conf is set and beacon can be retrieved. A channel
2741 * context is bound before this is called. Note that if the driver uses 2783 * context is bound before this is called. Note that if the driver uses
@@ -2952,6 +2994,10 @@ struct ieee80211_ops {
2952 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, 2994 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw,
2953 struct ieee80211_vif *vif, 2995 struct ieee80211_vif *vif,
2954 struct ieee80211_chanctx_conf *ctx); 2996 struct ieee80211_chanctx_conf *ctx);
2997 int (*switch_vif_chanctx)(struct ieee80211_hw *hw,
2998 struct ieee80211_vif_chanctx_switch *vifs,
2999 int n_vifs,
3000 enum ieee80211_chanctx_switch_mode mode);
2955 3001
2956 void (*restart_complete)(struct ieee80211_hw *hw); 3002 void (*restart_complete)(struct ieee80211_hw *hw);
2957 3003