Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2023 00:38:21 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: bd10aa138e78 - stable/14 - net80211: add ieee80211_add_vhtcap_ch()
Message-ID:  <202311300038.3AU0cLcl052166@gitrepo.freebsd.org>

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

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

commit bd10aa138e78b621ee82288bc11d7543c33a9a35
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-10-26 20:55:59 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-11-30 00:36:58 +0000

    net80211: add ieee80211_add_vhtcap_ch()
    
    Add an implementation of ieee80211_add_vhtcap() which works based on
    information derived from the vap (and possibly channel/band but we do
    not support that yet in net80211).  This is needed for scans request
    information in LinuxKPI at times before we have a BSS.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    adrian, cc
    Differential Revision: https://reviews.freebsd.org/D42422
    
    (cherry picked from commit 6c3ae01cc75afdd575f54289b2879a7c98d55bf6)
---
 sys/net80211/ieee80211_vht.c | 27 +++++++++++++++++++++++++++
 sys/net80211/ieee80211_vht.h |  2 ++
 2 files changed, 29 insertions(+)

diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c
index 77611d9704a2..f7a13157150e 100644
--- a/sys/net80211/ieee80211_vht.c
+++ b/sys/net80211/ieee80211_vht.c
@@ -707,6 +707,33 @@ ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni)
 	return (frm);
 }
 
+/*
+ * Non-associated probe requests.  Add VHT capabilities based on
+ * the current channel configuration.  No BSS yet.
+ */
+uint8_t *
+ieee80211_add_vhtcap_ch(uint8_t *frm, struct ieee80211vap *vap,
+    struct ieee80211_channel *c)
+{
+	struct ieee80211_vht_cap *vhtcap;
+
+	memset(frm, 0, 2 + sizeof(*vhtcap));
+	frm[0] = IEEE80211_ELEMID_VHT_CAP;
+	frm[1] = sizeof(*vhtcap);
+	frm += 2;
+
+	/* 32-bit VHT capability */
+	ADDWORD(frm, vap->iv_vht_cap.vht_cap_info);
+
+	/* supp_mcs */
+	ADDSHORT(frm, vap->iv_vht_cap.supp_mcs.rx_mcs_map);
+	ADDSHORT(frm, vap->iv_vht_cap.supp_mcs.rx_highest);
+	ADDSHORT(frm, vap->iv_vht_cap.supp_mcs.tx_mcs_map);
+	ADDSHORT(frm, vap->iv_vht_cap.supp_mcs.tx_highest);
+
+	return (frm);
+}
+
 static uint8_t
 ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c)
 {
diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h
index a3830ae13ba7..756c2e367485 100644
--- a/sys/net80211/ieee80211_vht.h
+++ b/sys/net80211/ieee80211_vht.h
@@ -50,6 +50,8 @@ void	ieee80211_vht_node_leave(struct ieee80211_node *ni);
 
 uint8_t *	ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *);
 uint8_t *	ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *);
+uint8_t *ieee80211_add_vhtcap_ch(uint8_t *, struct ieee80211vap *,
+    struct ieee80211_channel *);
 
 void	ieee80211_vht_update_cap(struct ieee80211_node *,
 	    const uint8_t *, const uint8_t *);



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