From nobody Mon Oct 12 02:51:31 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j326X1y0Kz6vDj8 for ; Mon, 12 Oct 2026 02:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j326X0Qx4z4Tn0 for ; Mon, 12 Oct 2026 02:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791773492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DvmTWeC5Bph82HN4ywugxLKXTdypoH2UbO1x4ZD+KwY=; b=GYVdSlmV8Shiv4Nv4nORoGq2P0RlQxw3//x1XtDmY1VqQxXpeN8Fei3rMGKHZTyC8jhuTm j01vg21jBQdptimJagLhZYFIdnm2lIc1XufK0EMB04nnZ6QgHlVdcedUknoEoN/+Zv3gH8 zd6FqtmT67EbyTpi1iOfazUtKfZG6Qn5Te5tDUl2NJwJ11Ev4EbxtRf+nnn08jSCcHuSgn epYagfvxgtIoNTPCsQf1mt5eEP4umNogosWYxt/MQUYjk6wcEUW3IUQpSwNDyAf+F+sLWF sPgW5mM50qV4ZDrQtSZw/I0SR1UwCcB+cNV9zRKVWJICoHFLWsxYE2ZXFoYhMA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791773492; b=QIfWYBwYD9VEQTN7Pv4ZA2beYscPbxXLarrEURbqzpY9Q42Ct9FqEgYDvZKMCjfZDaekH6 6uDwyt/OyGwywb6T2LDvuRupUrZZr5wkaSisxPegecVa+gn8AQQbbFuEpZUUopXnLlO/53 DdSC3JghUK785afrQ3zOuQz4JUalgSww7QUGZhMvt7W7zByaWZl5tcigHsW0Ig7cOeLAel noeFcAdvsc7D5u4KZdGvUosT5MhyL6oZ1+tTmssVkDkglAUimi9J0qcvTdiuoLkIZU8pFF /GXea72zI5JjkwKqm/8xbPz2NESj8kNMxhAXzjjOTGPjw/GgtB2y6f1Siy/r1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791773492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DvmTWeC5Bph82HN4ywugxLKXTdypoH2UbO1x4ZD+KwY=; b=XNXkoMDA1ohmycShjeH39lPkLC7Qq49W3pgokQzUDckn20IWF/HZw/seJ0QsmhOlCH//w8 52KnN7m9/vqHwspMLShOlqyj0NAgxw0KViPJ4wpN/g6cOeJv/hPhuaOu3wKQtSlYeHyJHh Rq2IAIh+TGORijitMxRQc4dUDgC37e4wB4khauXSMXhjFB2tSs65jHs4LZJjyhhxA0i5n3 Y0J6EZooyZgq0BIzqx0Gae5uCJEl3+2jC6Ct/Q3PG27cqmGjGN04XZCHtwmSiLiyOPnXdZ +2v7ARIwUNJ7pN8S8FP0bqgTtLpZUaRMG9BJxei+pVywStB+ic33O9TREdfLYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j326W5zbgz189Q for ; Mon, 12 Oct 2026 02:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 412da by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 12 Oct 2026 02:51:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 1f07bcd91de1 - main - iwm: placeholders for HT rates, update some FW flags to openbsd List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f07bcd91de1d02d1adb8a1215945cd02f469489 Auto-Submitted: auto-generated Date: Mon, 12 Oct 2026 02:51:31 +0000 Message-Id: <6acc4b33.412da.3d22e15d@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1f07bcd91de1d02d1adb8a1215945cd02f469489 commit 1f07bcd91de1d02d1adb8a1215945cd02f469489 Author: Adrian Chadd AuthorDate: 2026-10-12 02:41:12 +0000 Commit: Adrian Chadd CommitDate: 2026-10-12 02:41:12 +0000 iwm: placeholders for HT rates, update some FW flags to openbsd * update a flag to openbsd iwm * lay down placeholder ht rate / MIMO config routines based on openbsd's updated init path Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674 Differential Revision: https://reviews.freebsd.org/D60073 --- sys/dev/iwm/if_iwm.c | 39 ++++++++++++++++++++++++++++++++++++--- sys/dev/iwm/if_iwm_phy_ctxt.c | 3 +++ sys/dev/iwm/if_iwmreg.h | 2 +- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 51a0313842d0..dcebda12e263 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -2003,6 +2003,11 @@ iwm_add_channel_band(struct iwm_softc *sc, struct ieee80211_channel chans[], } } +/* TODO: HT20 */ +/* TODO: HT40 */ +/* TODO: VHT20 */ +/* TODO: VHT40, VHT80 */ + static void iwm_init_channel_map(struct ieee80211com *ic, int maxchans, int *nchans, struct ieee80211_channel chans[]) @@ -2036,6 +2041,23 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxchans, int *nchans, } } +static int +iwm_mimo_enabled(struct iwm_softc *sc) +{ + return (!sc->nvm_data->sku_cap_mimo_disable); +} + +static void +iwm_setup_ht_rates(struct iwm_softc *sc) +{ + /* XXX TODO MCS0..7 */ + + if (!iwm_mimo_enabled(sc)) + return; + + /* XXX TODO: MCS8..15 if >1 antenna and mimo enabled */ +} + static void iwm_set_hw_address_family_8000(struct iwm_softc *sc, struct iwm_nvm_data *data, const uint16_t *mac_override, const uint16_t *nvm_hw) @@ -4671,7 +4693,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const char *alpha2) int n_channels; uint16_t mcc; #endif - int resp_v2 = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); + int resp_v3 = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V3); if (!iwm_is_lar_supported(sc)) { IWM_DPRINTF(sc, IWM_DEBUG_LAR, "%s: no LAR support\n", @@ -4686,7 +4708,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const char *alpha2) else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; - if (resp_v2) + if (resp_v3) hcmd.len[0] = sizeof(struct iwm_mcc_update_cmd); else hcmd.len[0] = sizeof(struct iwm_mcc_update_cmd_v1); @@ -4703,7 +4725,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const char *alpha2) pkt = hcmd.resp_pkt; /* Extract MCC response */ - if (resp_v2) { + if (resp_v3) { mcc_resp = (void *)pkt->data; mcc = mcc_resp->mcc; n_channels = le32toh(mcc_resp->n_channels); @@ -4906,6 +4928,9 @@ iwm_init(struct iwm_softc *sc) return; } + if (sc->nvm_data->sku_cap_11n_enable) + iwm_setup_ht_rates(sc); + /* * Ok, firmware loaded and we are jogging */ @@ -6191,6 +6216,11 @@ iwm_attach(device_t dev) IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_TRACE, "<-%s\n", __func__); + device_printf(dev, "%s: TX ant=0x%x, RX ant=0x%x\n", + __func__, + iwm_get_valid_tx_ant(sc), + iwm_get_valid_rx_ant(sc)); + return 0; /* Free allocated memory if something failed during attachment. */ @@ -6287,6 +6317,9 @@ iwm_preinit(void *arg) sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK, sc->sc_fwver, ether_sprintf(sc->nvm_data->hw_addr)); + if (sc->nvm_data->sku_cap_11n_enable) + iwm_setup_ht_rates(sc); + /* not all hardware can do 5GHz band */ if (!sc->nvm_data->sku_cap_band_52GHz_enable) memset(&ic->ic_sup_rates[IEEE80211_MODE_11A], 0, diff --git a/sys/dev/iwm/if_iwm_phy_ctxt.c b/sys/dev/iwm/if_iwm_phy_ctxt.c index 65ebc4449af9..7ca86b31267f 100644 --- a/sys/dev/iwm/if_iwm_phy_ctxt.c +++ b/sys/dev/iwm/if_iwm_phy_ctxt.c @@ -209,6 +209,9 @@ iwm_phy_ctxt_cmd_data(struct iwm_softc *sc, IWM_PHY_BAND_24 : IWM_PHY_BAND_5; cmd->ci.channel = ieee80211_chan2ieee(ic, chan); + + /* TODO: HT40 */ + /* TODO: VHT40/VHT80 */ cmd->ci.width = IWM_PHY_VHT_CHANNEL_MODE20; cmd->ci.ctrl_pos = IWM_PHY_VHT_CTRL_POS_1_BELOW; diff --git a/sys/dev/iwm/if_iwmreg.h b/sys/dev/iwm/if_iwmreg.h index 296d07bc4b31..c8241aa5ceea 100644 --- a/sys/dev/iwm/if_iwmreg.h +++ b/sys/dev/iwm/if_iwmreg.h @@ -954,7 +954,7 @@ enum msix_ivar_for_cause { #define IWM_UCODE_TLV_CAPA_MULTI_QUEUE_RX_SUPPORT 68 #define IWM_UCODE_TLV_CAPA_BEACON_ANT_SELECTION 71 #define IWM_UCODE_TLV_CAPA_BEACON_STORING 72 -#define IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2 73 +#define IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V3 73 #define IWM_UCODE_TLV_CAPA_CT_KILL_BY_FW 74 #define IWM_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT 75 #define IWM_UCODE_TLV_CAPA_CTDP_SUPPORT 76