Drivers may abort a scan by calling cfg80211_scan_done() with a struct
cfg80211_scan_info that sets aborted to true.
To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS
and NL80211_CMD_SCAN_ABORTED when waiting for scan results.
Tested with Broadcom's bcmdhd driver.
Signed-off-by: Olof Sivertsson <olof.sivertsson@zenterio.com>
[rebased on top of variadic nl80211_wait()]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (nl80211_request(ifname, NL80211_CMD_TRIGGER_SCAN, 0, NULL, NULL))
goto out;
- if (nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS))
+ if (nl80211_wait("nl80211", "scan",
+ NL80211_CMD_NEW_SCAN_RESULTS, NL80211_CMD_SCAN_ABORTED))
goto out;
if (nl80211_request(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP,