freebsd-dev/sys/net80211
Adrian Chadd 67a26c98f2 [net80211] Fix interrupted scan logic and ticks comparison
The scan task refactoring stuff circa 2014-2016 broke the blocking task
 into a taskqueue with some async bits, but it apparently broke scans
 being interrupted by traffic.

Notably - the new "field" SCAN_PAUSE sets both SCAN_INTERRUPT and SCAN_CANCEL,
and a bunch of existing code was checking for SCAN_CANCEL only and breaking
the scan. Unfortunately it was then (a) cancelling the scan entirely and
(b) not notifying userland that scan was done.

So:
* Update the calls to scan_end() to only pass in 1 (saying the scan is complete)
  if SCAN_CANCEL is set WITHOUT SCAN_INTERRUPT. If both are set then yes,
  the scan is interrupted, but it isn't canceled - it's just paused.
* Update the "did the scan flags change whilst the driver was called" logic
  to check for canceled scans, not interrupted scans.
* The "scan done" logic now explicitly checks for either interrupted or
  completed scans. This accounts for the situation where a scan is being
  aborted via traffic but it ALSO happens to have finished (ie the last
  channel was checked.)

This doesn't ENTIRELY fix scanning as the resume function is broken
due to incorrect ticks math. Thus, the second half of this patch
changes the ieee80211_ticks_*() macros to use int instead of long,
matching the logic that the TCP code does with ticks and handles
wrapping / negative ticks values. If cast to long then the wrapping
math wouldn't work right (ie, if ticks was actually negative,
ie, after the system has been up for a while.)

This allows contbgscan() to correctly calculate if a scan should
continue based on ticks and ic->ic_lastdata .

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D25031
2020-05-27 18:32:12 +00:00
..
_ieee80211.h
ieee80211_acl.c
ieee80211_action.c
ieee80211_action.h
ieee80211_adhoc.c net80211(4): hide casts for 'i_seq' field offset calculation inside 2019-02-10 23:58:56 +00:00
ieee80211_adhoc.h
ieee80211_ageq.c
ieee80211_ageq.h
ieee80211_alq.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ieee80211_alq.h
ieee80211_amrr.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ieee80211_amrr.h
ieee80211_crypto_ccmp.c
ieee80211_crypto_none.c
ieee80211_crypto_tkip.c
ieee80211_crypto_wep.c
ieee80211_crypto.c net80211: drop m_pullup call from ieee80211_crypto_decap. 2019-01-19 16:04:26 +00:00
ieee80211_crypto.h
ieee80211_ddb.c
ieee80211_dfs.c Do not acquire IEEE80211_LOCK twice in cac_timeout(); reuse 2019-02-02 16:21:23 +00:00
ieee80211_dfs.h
ieee80211_freebsd.c net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING 2020-05-22 11:25:45 +00:00
ieee80211_freebsd.h [net80211] Fix interrupted scan logic and ticks comparison 2020-05-27 18:32:12 +00:00
ieee80211_hostap.c net80211(4): hide casts for 'i_seq' field offset calculation inside 2019-02-10 23:58:56 +00:00
ieee80211_hostap.h
ieee80211_ht.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ieee80211_ht.h
ieee80211_hwmp.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ieee80211_input.c
ieee80211_input.h
ieee80211_ioctl.c Don't use if_maddr_rlock() in 802.11, use epoch(9) directly instead. 2019-10-10 23:55:33 +00:00
ieee80211_ioctl.h
ieee80211_mesh.c Don't indirect user pointers directly in two 802.11s ioctls. 2020-04-24 22:10:02 +00:00
ieee80211_mesh.h
ieee80211_monitor.c
ieee80211_monitor.h
ieee80211_node.c net80211: fix out-of-bounds read in ieee80211_amrr(9). 2018-12-19 03:08:10 +00:00
ieee80211_node.h
ieee80211_output.c [net80211] Use the unicast key when transmitting DWDS AP multicast frames. 2020-05-08 17:01:33 +00:00
ieee80211_phy.c
ieee80211_phy.h
ieee80211_power.c
ieee80211_power.h
ieee80211_proto.c net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING 2020-05-22 11:25:45 +00:00
ieee80211_proto.h net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING 2020-05-22 11:25:45 +00:00
ieee80211_radiotap.c
ieee80211_radiotap.h
ieee80211_ratectl_none.c
ieee80211_ratectl.c
ieee80211_ratectl.h
ieee80211_regdomain.c
ieee80211_regdomain.h
ieee80211_rssadapt.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ieee80211_rssadapt.h
ieee80211_scan_sta.c net80211(4): fix rate check when 'roaming' ifconfig(8) option is set to 'auto' 2019-02-03 02:32:13 +00:00
ieee80211_scan_sw.c [net80211] Fix interrupted scan logic and ticks comparison 2020-05-27 18:32:12 +00:00
ieee80211_scan_sw.h
ieee80211_scan.c net80211(4): do not setup roaming parameters for unsupported modes. 2019-02-03 01:32:02 +00:00
ieee80211_scan.h
ieee80211_sta.c net80211(4): hide casts for 'i_seq' field offset calculation inside 2019-02-10 23:58:56 +00:00
ieee80211_sta.h
ieee80211_superg.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
ieee80211_superg.h
ieee80211_tdma.c net80211(4): do not setup Tx parameters for unsupported modes. 2019-02-03 04:31:50 +00:00
ieee80211_tdma.h
ieee80211_var.h Remove 2GHz channel list copies from wireless drivers. 2019-01-26 17:00:55 +00:00
ieee80211_vht.c
ieee80211_vht.h
ieee80211_wds.c Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
ieee80211_wds.h
ieee80211_wps.h [ifconfig] Print more WPS attributes in verbose "list scan" output 2019-01-20 00:45:44 +00:00
ieee80211_xauth.c
ieee80211.c Enhance the comment ieee80211_add_channel() to avoid a 2019-06-10 14:31:18 +00:00
ieee80211.h [ifconfig] Print more WPS attributes in verbose "list scan" output 2019-01-20 00:45:44 +00:00