History

nl80211: fix scheduled scan RSSI matchset attribute confusion

The scheduled scan matchsets were intended to be a list of filters, with the found BSS having to pass at least one of them to be passed to the host. When the RSSI attribute was added, however, this was broken and currently wpa_supplicant adds that attribute in its own matchset; however, it doesn't intend that to mean that anything that passes the RSSI filter should be passed to the host, instead it wants it to mean that everything needs to also have higher RSSI. This is semantically problematic because we have a list of filters like [ SSID1, SSID2, SSID3, RSSI ] with no real indication which one should be OR'ed and which one AND'ed. To fix this, move the RSSI filter attribute into each matchset. As we need to stay backward compatible, treat a matchset with only the RSSI attribute as a "default RSSI filter" for all other matchsets, but only if there are other matchsets (an RSSI-only matchset by itself is still desirable.) To make driver implementation easier, keep a global min_rssi_thold for the entire request as well. The only affected driver is ath6kl. I found this when I looked into the code after Raja Mani submitted a patch fixing the n_match_sets calculation to disregard the RSSI, but that patch didn't address the semantic issue.

Johannes Berg committed 12 years ago

Commit ea73cbc1 parent 9fa37a35 files · +92 −19Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+8−2
@@ -2467,9 +2467,15 @@ enum nl80211_reg_rule_attr { · 2466 unmodified lines
2467 * enum nl80211_sched_scan_match_attr - scheduled scan match attributes2467 * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
2468 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved2468 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
2469 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,2469 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
2470 * only report BSS with matching SSID.2470 * only report BSS with matching SSID.
2471 * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a2471 * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
2472 * BSS in scan results. Filtering is turned off if not specified.2472 * BSS in scan results. Filtering is turned off if not specified. Note that
2473 * if this attribute is in a match set of its own, then it is treated as
2474 * the default value for all matchsets with an SSID, rather than being a
2475 * matchset of its own without an RSSI filter. This is due to problems with
2476 * how this API was implemented in the past. Also, due to the same problem,
2477 * the only way to create a matchset with only an RSSI filter (with this
2478 * attribute) is if there's only a single matchset with the RSSI attribute.
2473 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter2479 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
2474 * attribute number currently defined2480 * attribute number currently defined
2475 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use2481 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use