From nobody Mon Jun 22 05:31:05 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 4gkGyL21hfz6j9mn for ; Mon, 22 Jun 2026 05:31:06 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gkGyK4jGZz3qLW for ; Mon, 22 Jun 2026 05:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782106265; 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=kgmEyFZ11yREY0titvR7wwLNttgLZQesMT7RN9sluM0=; b=ohdcpNAdHJJWrtMCIX310xp8rb3yjn/ajI1hrMIhkojRSNkRVwhmPuLwiUXU3JCqNqzcAL BG8/EOr0zbs22rSYCDK2W2gl9xFdZKdvPWN16rWyK3C0yDL5QvcoKLDgNfS3N4F6gW9/YL PhPZ2DqSw1ioKkzIn6M9hfiTLh15Vr33TqYqazDzcde34VAj8jy4OA2vP0d3sVR6Cb8yfr TiMW4r4WZfrzrVe9sGDRTtgb89r7Z37cSAmSjPMk/ZcsQnBDWxEA1J9qnfsYLiIeVxqXXb LIBrZ+i51IrRioefFyWJQjT3dER62ZbNw9xPYeYgKQjvaz0DK55WzwDjwf2zSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782106265; a=rsa-sha256; cv=none; b=FgVGja0ECDz6maNwov0MU3K+bPkDDita8352ehFNIqy0hjxgoAh4WpqU/OJI1gTJg2fIP+ sbCpQvGuwjdkgCzy0i9ncNZ4FRIb0vUUO1jhCkJMuWDFeElRD1dOG91lMulCN71OmXJvwD lEXXI0YAVRJhCnlPKauQVINTSNHIEYzlI+Pq20EfyBOVVudiHEBXEMNB45CF0+TJaku2/s LY9sxk+ARwjoSuk1lKg6j7q5S7vqoJVoCAGTySS3zbvwHOpModNXuvGIzfiKk9F8qIbUr+ XUNFQv+foEoIS4dp2cO2sTfCv90BALIZnGNgxrAmlJT8AhRDzdnDwhgGTOXGIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782106265; 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=kgmEyFZ11yREY0titvR7wwLNttgLZQesMT7RN9sluM0=; b=ohTdJEr7hcx4HSJ7K7PCMpYdEhIrj2BjZKCCDIDLvkzbyTISQE66UK4FgUR6fLLnuOZ5T5 F8Fkk3gDSDT5VHhHhT6SoKFvyd9AdPjl/rXOPh8v9UADsHJVkZcQX6K4AVMZofVUMy8H1e hpRCNOZ5hIh1I6DwztxhXucKDIaaz81gt9ETCQ23anfnAky3JbCiuy3UrsanIhDz1ww104 aDL+/vWSAYrPZu3bDJ5RqFeQZuTplrSJyGaH/zeXaKiv65wALH3O5U/3jtfVOCY3AyFvTp KtFXaEoUI+JhTVHTv0Lk8crUFwI2BxZtn2lfxGZBvE+WhebezmT7jmNAsZd4Ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gkGyK3R8XzbCj for ; Mon, 22 Jun 2026 05:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30246 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 22 Jun 2026 05:31:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 7bf2eec68a29 - main - LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bf2eec68a293a22f332fc1592dffaa4ed9f0809 Auto-Submitted: auto-generated Date: Mon, 22 Jun 2026 05:31:05 +0000 Message-Id: <6a38c899.30246.6950e5fe@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7bf2eec68a293a22f332fc1592dffaa4ed9f0809 commit 7bf2eec68a293a22f332fc1592dffaa4ed9f0809 Author: Bjoern A. Zeeb AuthorDate: 2026-06-22 00:27:21 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-22 01:21:38 +0000 LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap During vap creating we inialize most [l]vif related variables. Add a br_mask (bit rate mask) to the lvif and setup the legacy component as it seems to be static. Given we are looping over the bands, also initialize the bss_conf basic_rates. At this point we only have all bitrates for the band or the mandatory bitrates for the band available. In order to not hint usage of possibly unsupported bit rates set it up with the manadatory bit rates only, which should get us through the mgmt frames, etc. to get to assoc state. By then we will do updates. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 45 +++++++++++++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 95385474840a..f41ad9f573b6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4087,6 +4087,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], struct ieee80211_vif *vif; struct ieee80211_tx_queue_params txqp; enum ieee80211_bss_changed bss_changed; + enum nl80211_band band; struct sysctl_oid *node; size_t len; int error, i; @@ -4109,8 +4110,50 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], refcount_init(&lvif->nt_unlocked, 0); lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); - vif = LVIF_TO_VIF(lvif); + + /* + * Setup legacy br_mask here. We will call (*set_bitrate_mask) + * elsewhere to announce it to the driver but it is a static + * setup. + * Also setup basic_rates with just the mandatory rates for the + * current band (if avail). + */ + for (band = 0; band < NUM_NL80211_BANDS; band++) { + struct ieee80211_supported_band *supband; + uint32_t rate_mandatory;; + + supband = hw->wiphy->bands[band]; + if (supband == NULL || supband->n_bitrates == 0) + continue; + + /* Per-band legacy br_mask. */ + lvif->br_mask.control[band].legacy = (1 << supband->n_bitrates) - 1; + + /* basic_rates for the current band. */ + if (hw->conf.chandef.chan == NULL || + hw->conf.chandef.chan->band != band) + continue; + + switch (band) { + case NL80211_BAND_2GHZ: + /* We have to assume 11g support here. */ + rate_mandatory = IEEE80211_RATE_MANDATORY_G | + IEEE80211_RATE_MANDATORY_B; + break; + case NL80211_BAND_5GHZ: + rate_mandatory = IEEE80211_RATE_MANDATORY_A; + break; + default: + continue; + } + + for (i = 0; i < supband->n_bitrates; i++) { + if ((supband->bitrates[i].flags & rate_mandatory) != 0) + vif->bss_conf.basic_rates |= BIT(i); + } + } + memcpy(vif->addr, mac, IEEE80211_ADDR_LEN); vif->p2p = false; vif->probe_req_reg = false; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 91751c0b4de5..8d6b0a23cad3 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -220,6 +220,7 @@ struct lkpi_vif { struct mtx mtx; struct wireless_dev wdev; + struct cfg80211_bitrate_mask br_mask; /* Other local stuff. */ int (*iv_newstate)(struct ieee80211vap *,