git: c282b53edbd6 - stable/15 - LinuxKPI: 802.11: start filling vif->cfg.ap_addr
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Apr 2026 21:08:48 UTC
The branch stable/15 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=c282b53edbd692e8c7df31419b5f65c318d50274
commit c282b53edbd692e8c7df31419b5f65c318d50274
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-04-16 23:42:03 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-22 20:57:06 +0000
LinuxKPI: 802.11: start filling vif->cfg.ap_addr
vif->cfg.ap_addr is used by various drivers now and is the BSSID for
non-MLO or the AP addr for MLO configurations.
If this is unset rtw89 gets cranky and certain packets are likely not
going out correctly (also for iwlwifi).
Sponsored by: The FreeBSD Foundation
(cherry picked from commit dc886a4428712aa4fcdcf8cd9e850b048c923bbf)
---
sys/compat/linuxkpi/common/src/linux_80211.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index e1a3daf98cb2..89395f2f98b8 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2617,6 +2617,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
/* Set bss info (bss_info_changed). */
bss_changed = 0;
+ IEEE80211_ADDR_COPY(vif->cfg.ap_addr, ni->ni_bssid);
vif->bss_conf.bssid = ni->ni_bssid;
bss_changed |= BSS_CHANGED_BSSID;
vif->bss_conf.txpower = ni->ni_txpower;
@@ -3467,6 +3468,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int
bss_changed |= BSS_CHANGED_QOS;
vif->cfg.ssid_len = 0;
memset(vif->cfg.ssid, '\0', sizeof(vif->cfg.ssid));
+ IEEE80211_ADDR_COPY(vif->cfg.ap_addr, ieee80211broadcastaddr);
bss_changed |= BSS_CHANGED_BSSID;
vif->bss_conf.use_short_preamble = false;
/* XXX BSS_CHANGED_???? */
@@ -4072,6 +4074,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
vif->bss_conf.qos = false;
vif->bss_conf.use_cts_prot = false; /* vap->iv_protmode */
vif->bss_conf.ht_operation_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
+ IEEE80211_ADDR_COPY(vif->cfg.ap_addr, ieee80211broadcastaddr);
vif->cfg.aid = 0;
vif->cfg.assoc = false;
vif->cfg.idle = true;
@@ -7913,13 +7916,13 @@ no_trace_beacons:
struct ieee80211_vif *vif;
struct ieee80211_frame *wh;
- wh = mtod(m, struct ieee80211_frame *);
- if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid))
- goto skip_device_ts;
-
lvif = VAP_TO_LVIF(vap);
vif = LVIF_TO_VIF(lvif);
+ wh = mtod(m, struct ieee80211_frame *);
+ if (!IEEE80211_ADDR_EQ(wh->i_addr2, vif->cfg.ap_addr))
+ goto skip_device_ts;
+
IMPROVE("TIMING_BEACON_ONLY?");
/* mac80211 specific (not net80211) so keep it here. */
vif->bss_conf.sync_device_ts = rx_status->device_timestamp;
@@ -8757,8 +8760,6 @@ struct sk_buff *
linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, int linkid, bool qos)
{
- struct lkpi_vif *lvif;
- struct ieee80211vap *vap;
struct sk_buff *skb;
struct ieee80211_frame *nullf;
@@ -8770,17 +8771,15 @@ linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *hw,
skb_reserve(skb, hw->extra_tx_headroom);
- lvif = VIF_TO_LVIF(vif);
- vap = LVIF_TO_VAP(lvif);
-
nullf = skb_put_zero(skb, sizeof(*nullf));
nullf->i_fc[0] = IEEE80211_FC0_VERSION_0;
nullf->i_fc[0] |= IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA;
nullf->i_fc[1] = IEEE80211_FC1_DIR_TODS;
- IEEE80211_ADDR_COPY(nullf->i_addr1, vap->iv_bss->ni_bssid);
+ /* XXX-BZ if link is given, this is different. */
+ IEEE80211_ADDR_COPY(nullf->i_addr1, vif->cfg.ap_addr);
IEEE80211_ADDR_COPY(nullf->i_addr2, vif->addr);
- IEEE80211_ADDR_COPY(nullf->i_addr3, vap->iv_bss->ni_macaddr);
+ IEEE80211_ADDR_COPY(nullf->i_addr3, vif->cfg.ap_addr);
return (skb);
}