From c01eeb62e444f3a054dc708a4cf8cf9decb859d8 Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 3 Dec 2021 13:17:32 +0000 Subject: [PATCH] Disable probe requests during scans in iwx(4) again. While this is working well for many, some people see device timeouts when using the device unless we disable probe requests during scans. The issue was a lot more visible on iwx(4) with earlier firmware. In fact, iwx(4) did ship with probe requests disabled for most of its existence. I re-enabled them along with a firmware upgrade since I no longer saw the problem. However, the issue prevails for other people. I still have no idea what is causing this. I have already spent enough time trying to track down a proper fix. Unless we receive help from someone who knows about firmware internals the best we can do is trial and error. The problem also existed on iwm(4) 9k devices which we now run with probe requests disabled, too. The only upside of probe requests is that scans can complete faster, with the downside of a potential privacy leak (the previously selected SSID is exposed). So, overall, we do not lose much here. Patch tested for a week by Laurence Tratt who is no longer seeing device timeouts which were relatively frequent before. --- sys/dev/pci/if_iwx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 2d156edd7b8..dd1f4d8d1e8 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.126 2021/12/03 12:42:39 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.127 2021/12/03 13:17:32 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -5969,9 +5969,11 @@ iwx_umac_scan_fill_channels(struct iwx_softc *sc, * Firmware may become unresponsive when asked to send * a directed probe request on a passive channel. */ +#if 0 /* Some people see "device timeout" after active scans. */ if (n_ssids != 0 && !bgscan && (c->ic_flags & IEEE80211_CHAN_PASSIVE) == 0) chan->flags = htole32(1 << 0); /* select SSID 0 */ +#endif chan++; nchan++; } @@ -6218,7 +6220,9 @@ iwx_scan_umac_fill_ch_p_v6(struct iwx_softc *sc, int iwx_umac_scan_v14(struct iwx_softc *sc, int bgscan) { +#if 0 /* Some people see "device timeout" after active scans. */ struct ieee80211com *ic = &sc->sc_ic; +#endif struct iwx_host_cmd hcmd = { .id = iwx_cmd_id(IWX_SCAN_REQ_UMAC, IWX_LONG_GROUP, 0), .len = { 0, }, @@ -6254,6 +6258,7 @@ iwx_umac_scan_v14(struct iwx_softc *sc, int bgscan) return err; } +#if 0 /* Some people see "device timeout" after active scans. */ if (ic->ic_des_esslen != 0) { scan_p->probe_params.direct_scan[0].id = IEEE80211_ELEMID_SSID; scan_p->probe_params.direct_scan[0].len = ic->ic_des_esslen; @@ -6262,6 +6267,7 @@ iwx_umac_scan_v14(struct iwx_softc *sc, int bgscan) bitmap_ssid |= (1 << 0); n_ssid = 1; } +#endif iwx_scan_umac_fill_ch_p_v6(sc, &scan_p->channel_params, bitmap_ssid, n_ssid, bgscan); -- 2.20.1