git: 377fdea48222 - releng/13.2 - LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 23 Feb 2023 19:34:35 UTC
The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=377fdea48222d2422d18c93d4d2dada1f553e2bb commit 377fdea48222d2422d18c93d4d2dada1f553e2bb 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-23 19:32:48 +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 Approved by: re (cperciva) (cherry picked from commit 3dd980267f4e53df259eb6d322e7332a8bc5bb0a) (cherry picked from commit 28fbc0caa49b0fb119cc34a704d5437d63f479a3) --- 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; }