summaryrefslogtreecommitdiffstats
path: root/net/mac80211/chan.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-04-09 15:29:26 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-04-25 17:08:29 +0200
commit484298ad1afaf249a4708a5091487132dae80bf9 (patch)
treedfed80a1d4dd5b6877877203a6da37f24af21462 /net/mac80211/chan.c
parent093324816b91c9f4a3dd8c78930e43d0a2ef2508 (diff)
downloadlinux-484298ad1afaf249a4708a5091487132dae80bf9.tar.bz2
mac80211: track assigned vifs in chanctx
This can be useful. Provides a more straghtforward way to iterate over interfaces bound to a given chanctx and allows tracking chanctx usage explicitly. The structure is protected by local->chanctx_mtx. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/chan.c')
-rw-r--r--net/mac80211/chan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 4ed229c0966a..504526c97867 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -276,6 +276,7 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
if (!ctx)
return ERR_PTR(-ENOMEM);
+ INIT_LIST_HEAD(&ctx->assigned_vifs);
ctx->conf.def = *chandef;
ctx->conf.rx_chains_static = 1;
ctx->conf.rx_chains_dynamic = 1;
@@ -420,6 +421,7 @@ static int ieee80211_assign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
curr_ctx->refcount--;
drv_unassign_vif_chanctx(local, sdata, curr_ctx);
conf = NULL;
+ list_del(&sdata->assigned_chanctx_list);
}
if (new_ctx) {
@@ -429,6 +431,8 @@ static int ieee80211_assign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
new_ctx->refcount++;
conf = &new_ctx->conf;
+ list_add(&sdata->assigned_chanctx_list,
+ &new_ctx->assigned_vifs);
}
out: