summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2021-07-09 11:24:56 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2021-07-09 11:24:56 +0000
commit1dc6f2fdf1765f361f3e31cbc0e4df29e7b2aa99 (patch)
tree0ebbc2ec95ceab265d2b28ed7020f8332b2ae6c4
parent2505955bb50315af8f6bcf42f148705ef28a4835 (diff)
Make iwm(4) set various scan command flags just like how iwlwifi sets them.
Discrepancies found while investigating an issue related to active scanning.
-rw-r--r--sys/dev/pci/if_iwm.c17
-rw-r--r--sys/dev/pci/if_iwmreg.h12
2 files changed, 24 insertions, 5 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 000b7bfa44a..615d9a492b0 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.349 2021/07/09 11:21:31 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.350 2021/07/09 11:24:55 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -7305,7 +7305,9 @@ iwm_lmac_scan(struct iwm_softc *sc, int bgscan)
req->scan_flags |=
htole32(IWM_LMAC_SCAN_FLAG_PRE_CONNECTION);
if (isset(sc->sc_enabled_capa,
- IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT))
+ IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT) &&
+ isset(sc->sc_enabled_capa,
+ IWM_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT))
req->scan_flags |= htole32(IWM_LMAC_SCAN_FLAGS_RRM_ENABLED);
req->flags = htole32(IWM_PHY_BAND_24);
@@ -7565,6 +7567,8 @@ iwm_umac_scan(struct iwm_softc *sc, int bgscan)
req->v1.passive_dwell = 110;
req->v1.fragmented_dwell = 44;
req->v1.extended_dwell = 90;
+
+ req->v1.scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH);
}
if (bgscan) {
@@ -7583,7 +7587,6 @@ iwm_umac_scan(struct iwm_softc *sc, int bgscan)
}
}
- req->v1.scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH);
req->ooc_priority = htole32(IWM_SCAN_PRIORITY_HIGH);
cmd_data = iwm_get_scan_req_umac_data(sc, req);
@@ -7601,6 +7604,10 @@ iwm_umac_scan(struct iwm_softc *sc, int bgscan)
req->general_flags = htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL |
IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE);
+ if (isset(sc->sc_ucode_api, IWM_UCODE_TLV_API_ADAPTIVE_DWELL_V2)) {
+ req->v8.general_flags2 =
+ IWM_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER;
+ }
/* Check if we're doing an active directed scan. */
if (ic->ic_des_esslen != 0) {
@@ -7621,7 +7628,9 @@ iwm_umac_scan(struct iwm_softc *sc, int bgscan)
req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE);
if (isset(sc->sc_enabled_capa,
- IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT))
+ IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT) &&
+ isset(sc->sc_enabled_capa,
+ IWM_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT))
req->general_flags |=
htole32(IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED);
diff --git a/sys/dev/pci/if_iwmreg.h b/sys/dev/pci/if_iwmreg.h
index e3e93193f52..ce7898fd501 100644
--- a/sys/dev/pci/if_iwmreg.h
+++ b/sys/dev/pci/if_iwmreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwmreg.h,v 1.63 2021/07/08 17:14:08 stsp Exp $ */
+/* $OpenBSD: if_iwmreg.h,v 1.64 2021/07/09 11:24:55 stsp Exp $ */
/******************************************************************************
*
@@ -5733,6 +5733,16 @@ struct iwm_scan_config {
#define IWM_UMAC_SCAN_GEN_FLAGS_PROB_REQ_HIGH_TX_RATE (1 << 15)
/**
+ * UMAC scan general flags #2
+ * @IWM_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL: Whether to send a complete
+ * notification per channel or not.
+ * @IWM_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER: Whether to allow channel
+ * reorder optimization or not.
+ */
+#define IWM_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL (1 << 0)
+#define IWM_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER (1 << 1)
+
+/**
* struct iwm_scan_channel_cfg_umac
* @flags: bitmap - 0-19: directed scan to i'th ssid.
* @channel_num: channel number 1-13 etc.