From nobody Mon Jun 29 06:34:39 2026 X-Original-To: dev-commits-src-all@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 4gpc2S4DRHz6k5J8 for ; Mon, 29 Jun 2026 06:34:40 +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 4gpc2S05ddz4H3C for ; Mon, 29 Jun 2026 06:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782714880; 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=PBqvtXof5wGCMkamoiM09JJbU+aled29HfNTokZFAUI=; b=lfpOv4kSvJ0yjQ85JwSjKY0vbIejieJI4Pgl/Tq0ITZfjc1f9J22PbHTBsXQH5BVZCyvpL zcjSkQc2rX67376rSozcy+nORh3fDuYQ6e/g1HjBQo5w89r3sqwlg+3iuS8IMZRzp0ERBC Kzjd73O+/VwTa2rUdy9591g7ubYNqem1zgfzVIvmG7xicGtMXTPMLxiaN/uHhn3eCQ5lW2 JaasLYQR2hHPO8ED8qQIMXVQKwyCJCq8tP3qY5Ew06RiGY8nN8m41J7OX65ZOOEE60whNK wGgE5KBK0BFp6mFadafns6okZ8TXZkEmfT94Hua3MPrRbIC3uwDv9hraBMim8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782714880; a=rsa-sha256; cv=none; b=b1ciVDHgNjNmU/ZLdcbQ7SwFcAKopO+gQOkmJrjuKretcKDaHuHIl8kPx+pWBSQWJ9FQT7 fScasUEwCFvF4nWdoCf30mDRUinMlSy0ofZWMdGZPewR0a6JE+GRT0XujJbq/y1mHODWqB crVGlqHB2yT89CThTR/wXrlwUaa3vTbutOYSAWfdP0zH0BzHcU/vPkEmW2CL3qZp1ihjco dVR7iag6jqRBj9LhCeqVnGzvbVOSsN7xN718nbbETLglf3HQ9Z55/PcsYdI9PjNZZJqjHn m4IbuUks1DjpSDXcgdPahdUnCauKm+4QYKYfVcBVxVbJU7y/pDSqdf7ZlelOBw== 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=1782714880; 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=PBqvtXof5wGCMkamoiM09JJbU+aled29HfNTokZFAUI=; b=xBPKMeGtnnkkMGOH5eKL0JcpNXnv2T0WHt3He1UIfhj/xMZOgpDpewLNi70vy9esAQ+SG7 OroRBq6mtl4BtQiyQijZoEuZ/BOZ7tOJuJDv1x8sQz/60iIUhmVQl4sT7AlxS64HR7FyqE LCEuEgShe4W449j5+J6+mvIKxzZOnEupcJ8Whs2ks4WLyZ5ulywwaLvx1+G9A4GYoANoRN oMKj8cFBr7PDq0t/kc+ICKoLmOSlKIH44+g3p8KZGDokzbNSdekdB1gi2Auwx8c9dBgDN7 2ET5Pmfch83DtS2kXDX1cAieqMkl7celtVRVUHEWWgsKC86iD6kW96LuYcS+FQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpc2R63WdzmH8 for ; Mon, 29 Jun 2026 06:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47800 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 29 Jun 2026 06:34:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: c17a6e0f8787 - stable/15 - LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/15 X-Git-Reftype: branch X-Git-Commit: c17a6e0f87871885cb698451ff1f1b0864da3cc9 Auto-Submitted: auto-generated Date: Mon, 29 Jun 2026 06:34:39 +0000 Message-Id: <6a4211ff.47800.7e01f58a@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c17a6e0f87871885cb698451ff1f1b0864da3cc9 commit c17a6e0f87871885cb698451ff1f1b0864da3cc9 Author: Bjoern A. Zeeb AuthorDate: 2026-06-22 00:27:21 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-29 03:54:41 +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 (cherry picked from commit 7bf2eec68a293a22f332fc1592dffaa4ed9f0809) --- 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 24819a970431..8a761be3d6fd 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4081,6 +4081,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; @@ -4103,8 +4104,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 *,