On Thu, Jul 12, 2012 at 7:03 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > On Thu, 2012-07-12 at 19:00 +0300, Eliad Peller wrote: >> On Thu, Jul 12, 2012 at 6:15 PM, Johannes Berg >> <johannes@xxxxxxxxxxxxxxxx> wrote: >> > From: Johannes Berg <johannes.berg@xxxxxxxxx> >> > >> > When bringing monitor mode up with a driver using the >> > mac80211 virtual monitor interface this resulted in a >> > warning because cfg80211_update_iface_num() is called >> > from PRE_UP, which causes it to call mac80211 and the >> > low-level driver before the device is started. >> > >> > For the case that another interface is added and the >> > monitor interface should be removed, this is correct. >> > However, in the case where a monitor interface is >> > added, it's not correct as the above. >> > >> > To fix this, we need to split up the cases and track >> > whether or not "only monitor" is active so that the >> > code can correctly call into the driver when things >> > change. > >> why not always do it only on IFACE_UP? > > Yeah .. thought so too at first, but it doesn't work, say you have this > situation: > > * up moni0 (monitor) > * up wlan0 (managed) > > Then the set_monitor_enabled(false) should happen before wlan0 is > brought up, otherwise mac80211/the driver will correctly reject wlan0 > being brought up. > but you don't call set_monitor_enabled(false) on pre_up in your patch... so i guess the driver will still get its add_interface callback while the monitor is enabled? afaict, the only effect of pre_up is updating rdev->num_running_ifaces/rdev->num_running_monitor_ifaces, which don't seem to matter much... Eliad. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html