Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Feb 2023 23:44:57 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 28fbc0caa49b - stable/13 - LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
Message-ID:  <202302172344.31HNiv5i025246@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=28fbc0caa49b0fb119cc34a704d5437d63f479a3

commit 28fbc0caa49b0fb119cc34a704d5437d63f479a3
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-01-31 23:00:28 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-02-17 23:42:16 +0000

    LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
    
    Add code (currently disabled by #ifdef) for HT and VHT to
    lkpi_scan_ies_add().  Switch to a local variable for ic given
    the new code also needs the value.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    
    (cherry picked from commit 3dd980267f4e53df259eb6d322e7332a8bc5bb0a)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 57dd174b62a1..b2969aeb5db2 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2478,11 +2478,13 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies,
 {
 	struct ieee80211_supported_band *supband;
 	struct linuxkpi_ieee80211_channel *channels;
+	struct ieee80211com *ic;
 	const struct ieee80211_channel *chan;
 	const struct ieee80211_rateset *rs;
 	uint8_t *pb;
 	int band, i;
 
+	ic = vap->iv_ic;
 	for (band = 0; band < NUM_NL80211_BANDS; band++) {
 		if ((band_mask & (1 << band)) == 0)
 			continue;
@@ -2503,7 +2505,7 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies,
 			if (channels[i].flags & IEEE80211_CHAN_DISABLED)
 				continue;
 
-			chan = ieee80211_find_channel(vap->iv_ic,
+			chan = ieee80211_find_channel(ic,
 			    channels[i].center_freq, 0);
 			if (chan != NULL)
 				break;
@@ -2514,10 +2516,31 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies,
 			continue;
 
 		pb = p;
-		rs = ieee80211_get_suprates(vap->iv_ic, chan);	/* calls chan2mode */
+		rs = ieee80211_get_suprates(ic, chan);	/* calls chan2mode */
 		p = ieee80211_add_rates(p, rs);
 		p = ieee80211_add_xrates(p, rs);
 
+#if defined(LKPI_80211_HT)
+		if ((vap->iv_flags_ht & IEEE80211_FHT_HT) != 0) {
+			struct ieee80211_channel *c;
+
+			c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan,
+			    vap->iv_flags_ht);
+			p = ieee80211_add_htcap_ch(p, vap, c);
+		}
+#endif
+#if defined(LKPI_80211_VHT)
+		if ((vap->iv_vht_flags & IEEE80211_FVHT_VHT) != 0) {
+			struct ieee80211_channel *c;
+
+			c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan,
+			    vap->iv_flags_ht);
+			c = ieee80211_vht_adjust_channel(ic, c,
+			    vap->iv_vht_flags);
+			p = ieee80211_add_vhtcap_ch(p, vap, c);
+		}
+#endif
+
 		scan_ies->ies[band] = pb;
 		scan_ies->len[band] = p - pb;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302172344.31HNiv5i025246>