wifi-scan
wifi-scan copied to clipboard
Handle NL80211_CMD_SCAN_ABORTED command
We should handle NL80211_CMD_SCAN_ABORTED command in notifications channel.
Otherwise we may have the following race condition:
- we read up notifications
- we trigger scan if necessary
- we wait for completion
- we collect results
It's possible that If the scan is aborted after triggering, before completion we may wait indefinitely for results. I am not sure, this needs investigation.
Any hints on how to implement this? It is very useful.
Probably in handle_NL80211_MULTICAST_GROUP_SCAN
, the case for NL80211_CMD_SCAN_ABORTED
.
This is called from two places:
- in non blocking readout of any pending notifications
- while waiting for scan results
Some logic could be added to either:
- (re)schedule scan
- or report error
I am not sure it is needed. Ideally a way to abort scan and check what happens would be handy.