From nobody Fri Oct 06 14:25:09 2023 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 4S29gT4J5xz4wgXs; Fri, 6 Oct 2023 14:25:09 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S29gT3hpSz3Qvx; Fri, 6 Oct 2023 14:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696602309; 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=vPBj+eo4dRsiDzdiivaXOmjAlIUTO5+C9GiBdLyqmYw=; b=pFXK3rYKq0+sjqJsLRiteNO6hillcKXe1YW99OP8byWHI0fJlFIz7ghdZL30y1ZOlaUoBa x9wO1KYk4l83/4VH6OazlJq28fxwK+blIjZ47gxEnu/80kjo2INlyE1EcFp/0uGzycWeGW 8WKLOI3q+ZZxzm4TTeQWiz3xk1ufDZJcjlSZ0c4ZGw/SgC5FnDAfCsn9TRA+f4FrXDzhu7 /aeH5im3qA5AzaR5W5tZ5YMynggf6HGztVIUA39V0Dced8w/65n6O43q6ruV4cIWJISlJX /peTJ3EHX6cqdR46Sg1Xb7QqFM3c9E+g9HN63WFzzXGGlltnLK1iP0N9IyzPyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696602309; a=rsa-sha256; cv=none; b=F69FekPlt0RUyTjCLMw786DPq2IqKHaz11WxHSReGQIkzxrDlrzHcE626B+kiq+UOEO1tt c5gJW6gMbzrDaszLVMYyU/cGqaZHOP/I8ZGIBbHy2W8DdIrnAItKknj30e06RsLq9pKtRi bK51T95wp2KFvm64jLCMhUs+0A0EmatRhK3PNoYGTemi4XPZoJ9LVUEGcHvGXzLF6oBE9D AlChNQgMGgdB4aOr99kVUSNQZaubZERpwvaF2/7AAhSKGF7WlJVi06hYUghY8+c/KsZ32o sJx/RqcmTcPXYRzR3BLuJQ7gnKA3Y1YNCVNdHat2tdEiysn4sb/wD0/VKB0qcw== 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=1696602309; 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=vPBj+eo4dRsiDzdiivaXOmjAlIUTO5+C9GiBdLyqmYw=; b=OVaOgug/KZLoDaxeSaJPO48Zxni+9qUypa/NQHau6C9e6Ec3YSvwl5EmuZ+tq1xlceHyzz ka7zuXAazomPNHL1iRMhH3LMJXxsmToxuZO0018R4Dxdl5dTH/FpPDWcth0CQjMQAD+LUc ZaEhLUtEVZAV+CkyfeozONZQH4SZ92daniCxyA2wca9sCAxgN4+Qdi5Q4khW7Ym5/qAMiW tMs8GcVcbxI2ueR/9ZSdKASsfUoXNlAfZ62TCbtOglhEhmJWlV7/dZIWF01QPgRFulViVE 1nKjAmtDgPLqLjcYCxnOEutwgkXRAE5JgWvGawMD0stCGB8dp0AxLUro159ImQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S29gT2ldczrw5; Fri, 6 Oct 2023 14:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 396EP9aU093236; Fri, 6 Oct 2023 14:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 396EP9xP093233; Fri, 6 Oct 2023 14:25:09 GMT (envelope-from git) Date: Fri, 6 Oct 2023 14:25:09 GMT Message-Id: <202310061425.396EP9xP093233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8614ae463a1e - stable/14 - LinuxKPI: 802.11: adjust code to new structure layout 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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/14 X-Git-Reftype: branch X-Git-Commit: 8614ae463a1e913ff97039655a08316556839b4c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8614ae463a1e913ff97039655a08316556839b4c commit 8614ae463a1e913ff97039655a08316556839b4c Author: Bjoern A. Zeeb AuthorDate: 2023-09-21 12:19:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-10-06 12:47:39 +0000 LinuxKPI: 802.11: adjust code to new structure layout With past commits new structures were added. Now switch over some bss_conf fields into vif->cfg where they got moved to and remove the old fields. This allows drivers to find the expected values in the now expected places and work better. Sponsored by: The FreeBSD Foundation (cherry picked from commit 616e13301bcf274b007f84ef99ea857a55bef46d) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 9 ++--- sys/compat/linuxkpi/common/src/linux_80211.c | 44 +++++++++++------------ 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 20371812198a..7e6fb1bce16e 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -280,19 +280,13 @@ struct ieee80211_bss_conf { bool eht_su_beamformer; bool eht_mu_beamformer; - size_t ssid_len; - uint8_t ssid[IEEE80211_NWID_LEN]; - uint16_t aid; uint16_t ht_operation_mode; int arp_addr_cnt; uint16_t eht_puncturing; uint8_t dtim_period; uint8_t sync_dtim_count; - bool assoc; - bool idle; bool qos; - bool ps; bool twt_broadcast; bool use_cts_prot; bool use_short_preamble; @@ -991,6 +985,8 @@ struct ieee80211_ops { void (*config_iface_filter)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int, unsigned int); void (*bss_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64); + void (*link_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64); + int (*set_rts_threshold)(struct ieee80211_hw *, u32); void (*event_callback)(struct ieee80211_hw *, struct ieee80211_vif *, const struct ieee80211_event *); int (*get_survey)(struct ieee80211_hw *, int, struct survey_info *); @@ -1038,7 +1034,6 @@ struct ieee80211_ops { int (*set_hw_timestamp)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_set_hw_timestamp *); - void (*link_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64); void (*vif_cfg_changed)(struct ieee80211_hw *, struct ieee80211_vif *, u64); int (*change_vif_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16, u16, struct ieee80211_bss_conf *[IEEE80211_MLD_MAX_NUM_LINKS]); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 37e1de0b76ad..ac43b1248536 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -744,7 +744,7 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, "dtim_period %u sync_dtim_count %u sync_tsf %ju " "sync_device_ts %u bss_changed %#08x\n", __func__, __LINE__, _f, _l, - vif->bss_conf.assoc, vif->bss_conf.aid, + vif->cfg.assoc, vif->cfg.aid, vif->bss_conf.beacon_int, vif->bss_conf.dtim_period, vif->bss_conf.sync_dtim_count, (uintmax_t)vif->bss_conf.sync_tsf, @@ -775,7 +775,7 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, "dtim_period %u sync_dtim_count %u sync_tsf %ju " "sync_device_ts %u bss_changed %#08x\n", __func__, __LINE__, _f, _l, - vif->bss_conf.assoc, vif->bss_conf.aid, + vif->cfg.assoc, vif->cfg.aid, vif->bss_conf.beacon_int, vif->bss_conf.dtim_period, vif->bss_conf.sync_dtim_count, (uintmax_t)vif->bss_conf.sync_tsf, @@ -846,7 +846,7 @@ lkpi_disassoc(struct ieee80211_sta *sta, struct ieee80211_vif *vif, struct lkpi_hw *lhw) { sta->aid = 0; - if (vif->bss_conf.assoc) { + if (vif->cfg.assoc) { struct ieee80211_hw *hw; enum ieee80211_bss_changed changed; @@ -854,8 +854,8 @@ lkpi_disassoc(struct ieee80211_sta *sta, struct ieee80211_vif *vif, lkpi_update_mcast_filter(lhw->ic, true); changed = 0; - vif->bss_conf.assoc = false; - vif->bss_conf.aid = 0; + vif->cfg.assoc = false; + vif->cfg.aid = 0; changed |= BSS_CHANGED_ASSOC; /* * This will remove the sta from firmware for iwlwifi. @@ -1009,12 +1009,12 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int bss_changed |= BSS_CHANGED_BSSID; vif->bss_conf.txpower = ni->ni_txpower; bss_changed |= BSS_CHANGED_TXPOWER; - vif->bss_conf.idle = false; + vif->cfg.idle = false; bss_changed |= BSS_CHANGED_IDLE; /* Should almost assert it is this. */ - vif->bss_conf.assoc = false; - vif->bss_conf.aid = 0; + vif->cfg.assoc = false; + vif->cfg.aid = 0; bss_changed |= lkpi_update_dtim_tsf(vif, ni, vap, __func__, __LINE__); @@ -1433,8 +1433,8 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i bss_changed = 0; vif->bss_conf.qos = 0; bss_changed |= BSS_CHANGED_QOS; - vif->bss_conf.ssid_len = 0; - memset(vif->bss_conf.ssid, '\0', sizeof(vif->bss_conf.ssid)); + vif->cfg.ssid_len = 0; + memset(vif->cfg.ssid, '\0', sizeof(vif->cfg.ssid)); bss_changed |= BSS_CHANGED_BSSID; lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); @@ -1549,14 +1549,14 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int #ifdef LKPI_80211_WME bss_changed |= lkpi_wme_update(lhw, vap, true); #endif - if (!vif->bss_conf.assoc || vif->bss_conf.aid != IEEE80211_NODE_AID(ni)) { - vif->bss_conf.assoc = true; - vif->bss_conf.aid = IEEE80211_NODE_AID(ni); + if (!vif->cfg.assoc || vif->cfg.aid != IEEE80211_NODE_AID(ni)) { + vif->cfg.assoc = true; + vif->cfg.aid = IEEE80211_NODE_AID(ni); bss_changed |= BSS_CHANGED_ASSOC; } /* We set SSID but this is not BSSID! */ - vif->bss_conf.ssid_len = ni->ni_esslen; - memcpy(vif->bss_conf.ssid, ni->ni_essid, ni->ni_esslen); + vif->cfg.ssid_len = ni->ni_esslen; + memcpy(vif->cfg.ssid, ni->ni_essid, ni->ni_esslen); if ((vap->iv_flags & IEEE80211_F_SHPREAMBLE) != vif->bss_conf.use_short_preamble) { vif->bss_conf.use_short_preamble ^= 1; @@ -1895,8 +1895,8 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int bss_changed = 0; vif->bss_conf.qos = 0; bss_changed |= BSS_CHANGED_QOS; - vif->bss_conf.ssid_len = 0; - memset(vif->bss_conf.ssid, '\0', sizeof(vif->bss_conf.ssid)); + vif->cfg.ssid_len = 0; + memset(vif->cfg.ssid, '\0', sizeof(vif->cfg.ssid)); bss_changed |= BSS_CHANGED_BSSID; lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); @@ -2276,16 +2276,16 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], #if 1 vif->chanctx_conf = NULL; vif->bss_conf.vif = vif; - vif->bss_conf.idle = true; - vif->bss_conf.ps = false; vif->bss_conf.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; vif->bss_conf.use_short_preamble = false; /* vap->iv_flags IEEE80211_F_SHPREAMBLE */ vif->bss_conf.use_short_slot = false; /* vap->iv_flags IEEE80211_F_SHSLOT */ 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; - vif->bss_conf.assoc = false; - vif->bss_conf.aid = 0; + vif->cfg.aid = 0; + vif->cfg.assoc = false; + vif->cfg.idle = true; + vif->cfg.ps = false; /* * We need to initialize it to something as the bss_info_changed call * will try to copy from it in iwlwifi and NULL is a panic. @@ -4712,7 +4712,7 @@ linuxkpi_ieee80211_pspoll_get(struct ieee80211_hw *hw, psp = skb_put_zero(skb, sizeof(*psp)); psp->i_fc[0] = IEEE80211_FC0_VERSION_0; psp->i_fc[0] |= IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL; - v = htole16(vif->bss_conf.aid | 1<<15 | 1<<16); + v = htole16(vif->cfg.aid | 1<<15 | 1<<16); memcpy(&psp->i_aid, &v, sizeof(v)); IEEE80211_ADDR_COPY(psp->i_bssid, vap->iv_bss->ni_macaddr); IEEE80211_ADDR_COPY(psp->i_ta, vif->addr);