From 4b6f1dd6a6faf4ed8d209bbd548e78b15e55aee8 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 3 Apr 2012 14:35:57 +0200 Subject: mac80211: add explicit monitor interface if needed The queue mapping redesign that I'm planning to do will break pure injection unless we handle monitor interfaces explicitly. One possible option would be to have the driver tell mac80211 about monitor mode queues etc., but that would duplicate the API since we already need to have queue assignments handled per virtual interface. So in order to solve this, have a virtual monitor interface that is added whenever all active vifs are monitors. We could also use the state of one of the monitor interfaces, but managing that would be complicated, so allocate separate state. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/tx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'net/mac80211/tx.c') diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 4109ec7999a3..a8d0188ab408 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1283,8 +1283,11 @@ static bool __ieee80211_tx(struct ieee80211_local *local, switch (sdata->vif.type) { case NL80211_IFTYPE_MONITOR: - sdata = NULL; - vif = NULL; + sdata = rcu_dereference(local->monitor_sdata); + if (sdata) + vif = &sdata->vif; + else + vif = NULL; break; case NL80211_IFTYPE_AP_VLAN: sdata = container_of(sdata->bss, -- cgit v1.2.3