Thread (9 messages) 9 messages, 2 authors, 2012-04-02

Re: [RFC 1/2] mac80211: add explicit monitor interface if needed

From: Eliad Peller <hidden>
Date: 2012-03-29 20:09:12

On Wed, Mar 28, 2012 at 11:13 AM, Johannes Berg
[off-list ref] wrote:
From: Johannes Berg <redacted>

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 <redacted>
---
[...]
+static void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
+{
+       struct ieee80211_sub_if_data *sdata;
+
+       if (!(local->hw.flags & IEEE80211_HW_WANT_MONITOR_VIF))
+               return;
+
+       sdata = rtnl_dereference(local->monitor_sdata);
+
+       if (WARN_ON(!sdata))
+               return;
+
...
quoted hunk ↗ jump to hunk
@@ -280,6 +339,8 @@ static int ieee80211_do_open(struct net_
               break;
       default:
               if (coming_up) {
+                       ieee80211_del_virtual_monitor(local);
+
i think this will always trigger the warning?
quoted hunk ↗ jump to hunk
@@ -98,8 +98,7 @@ static inline int drv_add_interface(stru
       might_sleep();

-       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
-                   sdata->vif.type == NL80211_IFTYPE_MONITOR))
+       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
               return -EINVAL;
maybe check for IEEE80211_HW_WANT_MONITOR_VIF instead?

Eliad.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help