On 3/3/20 10:27 PM, Johannes Berg wrote: > On Tue, 2020-03-03 at 12:50 +0100, Markus Theil wrote: >> Back in 2007 "mac80211: don't allow scanning in monitor mode" >> (f27b62d3e7ec) disabled scanning in monitor mode, because hw >> controlled by the zd1211rw driver got confused during this operation. >> >> Nevertheless, it can be useful to scan in monitor mode, e.g. >> when building a tool which processes scans, channel surveys and >> monitors the channel passively in monitor mode. > Hmm. I'm not really sure that this makes sense. > > You're in monitor mode, so you won't get any scan processing as such > (you will not be able to use nl80211 to retrieve the results!), I used this patchset for some time to build a combined monitoring and channel survey tool. A mt76 based USB dongle is used, because mt76 supports the channel survey cmd which yields the channel's busy time. At the same time, the tool listens for beacons over the monitor interface to log available networks and their RSSI to the user. When the user changes into heatmap mode, he can issue active scan requests at different points on the floor plan. All of this this can be done with a single interface in monitor mode. I change the frequency of the monitoring interface periodically to passively listen at other channels. nl80211 is able to receive scan results in my setup. "iw dev $MON_IF scan" also works as expected. A combination of an unassociated STA VIF and a monitor VIF (scan on STA VIF, receive Wi-Fi frames on monitor VIF) does not work, because I cannot freely set the channel on an unassociated STA VIF. Trying to set the operating frequency on the monitor VIF also fails, when the STA VIF is up. Bringing the STA VIF up would be needed for scanning on it. Therefore this patches solved my solely monitoring-oriented use-case. > and > there will be a lot of confusion over sending probe requests (the code > now looks like it would in fact attempt to do so ... but how?). Yes, the code now uses the kernel mechanisms to send probe requests. > > johannes > Markus