Ensure that iwm/iwx devices announce VHT capabilities in probe requests.
authorstsp <stsp@openbsd.org>
Wed, 20 Dec 2023 07:32:05 +0000 (07:32 +0000)
committerstsp <stsp@openbsd.org>
Wed, 20 Dec 2023 07:32:05 +0000 (07:32 +0000)
The previous code did not update the per-band-data length field,
resulting in firmware skipping the VHT information element in the
probe-request frame template.

Patch by Mikhail Pchelin

sys/dev/pci/if_iwm.c
sys/dev/pci/if_iwx.c

index fbab94f..f0977cd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_iwm.c,v 1.412 2023/11/06 08:34:41 stsp Exp $       */
+/*     $OpenBSD: if_iwm.c,v 1.413 2023/12/20 07:32:05 stsp Exp $       */
 
 /*
  * Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -7704,6 +7704,7 @@ iwm_fill_probe_req(struct iwm_softc *sc, struct iwm_scan_probe_req *preq)
                                return ENOBUFS;
                        frm = ieee80211_add_vhtcaps(frm, ic);
                        remain -= frm - pos;
+                       preq->band_data[1].len = htole16(frm - pos);
                }
        }
 
index 612b68e..a86049a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_iwx.c,v 1.177 2023/10/06 15:15:29 stsp Exp $       */
+/*     $OpenBSD: if_iwx.c,v 1.178 2023/12/20 07:32:05 stsp Exp $       */
 
 /*
  * Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -6977,6 +6977,7 @@ iwx_fill_probe_req(struct iwx_softc *sc, struct iwx_scan_probe_req *preq)
                                return ENOBUFS;
                        frm = ieee80211_add_vhtcaps(frm, ic);
                        remain -= frm - pos;
+                       preq->band_data[1].len = htole16(frm - pos);
                }
        }