Set MIMO-related flags in the iwx(4) ADD_STA command.
authorstsp <stsp@openbsd.org>
Sun, 18 Jul 2021 12:21:49 +0000 (12:21 +0000)
committerstsp <stsp@openbsd.org>
Sun, 18 Jul 2021 12:21:49 +0000 (12:21 +0000)
Not sure how we ended up missing these. MIMO apparently works without the
flags set, and setting them doesn't seem to have any immediately visible
effect on firmware. But let's be consistent with iwm(4) and iwlwifi.

sys/dev/pci/if_iwx.c

index 0183a8b..332d49f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_iwx.c,v 1.66 2021/07/18 12:03:57 stsp Exp $        */
+/*     $OpenBSD: if_iwx.c,v 1.67 2021/07/18 12:21:49 stsp Exp $        */
 
 /*
  * Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -5173,6 +5173,17 @@ iwx_add_sta_cmd(struct iwx_softc *sc, struct iwx_node *in, int update)
                    |= htole32(IWX_STA_FLG_MAX_AGG_SIZE_MSK |
                    IWX_STA_FLG_AGG_MPDU_DENS_MSK);
 
+               if (iwx_mimo_enabled(sc)) {
+                       if (in->in_ni.ni_rxmcs[1] != 0) {
+                               add_sta_cmd.station_flags |=
+                                   htole32(IWX_STA_FLG_MIMO_EN_MIMO2);
+                       }
+                       if (in->in_ni.ni_rxmcs[2] != 0) {
+                               add_sta_cmd.station_flags |=
+                                   htole32(IWX_STA_FLG_MIMO_EN_MIMO3);
+                       }
+               }
+
                add_sta_cmd.station_flags
                    |= htole32(IWX_STA_FLG_MAX_AGG_SIZE_64K);
                switch (ic->ic_ampdu_params & IEEE80211_AMPDU_PARAM_SS) {