Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P652
add vht conf flags
Active
Public
Actions
Authored by
adrian
on Fri, Nov 22, 4:09 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F103198580: add vht conf flags
Fri, Nov 22, 4:09 AM
2024-11-22 04:09:34 (UTC+0)
Subscribers
None
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 53139a3852b8..a1c4f17208ab 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -244,10 +244,11 @@ struct ieee80211com {
uint8_t ic_txstream; /* # TX streams */
/* VHT information */
- uint32_t ic_vht_flags; /* VHT state flags */
+ uint32_t ic_vht_flags; /* VHT state flags (IEEE80211_FVHT) */
struct ieee80211_vht_cap ic_vht_cap; /* VHT capabilities + MCS info */
uint32_t ic_vhtextcaps; /* VHT extended capabilities (TODO) */
- uint32_t ic_vht_spare[3];
+ uint32_t ic_vht_conf; /* VHT config (IEEE80211_FVHT) */
+ uint32_t ic_vht_spare[2];
/* optional state for Atheros SuperG protocol extensions */
struct ieee80211_superg *ic_superg;
diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c
index 0839f426e09c..9c54939db32f 100644
--- a/sys/net80211/ieee80211_vht.c
+++ b/sys/net80211/ieee80211_vht.c
@@ -143,11 +143,25 @@ ieee80211_vht_vattach(struct ieee80211vap *vap)
vap->iv_vht_cap.vht_cap_info = ic->ic_vht_cap.vht_cap_info;
vap->iv_vhtextcaps = ic->ic_vhtextcaps;
- /* XXX assume VHT80 support; should really check vhtcaps */
- vap->iv_vht_flags =
- IEEE80211_FVHT_VHT
- | IEEE80211_FVHT_USEVHT40
- | IEEE80211_FVHT_USEVHT80;
+ vap->iv_vht_flags = IEEE80211_FVHT_VHT;
+
+ /*
+ * This isn't in vht_cap_info, it's actually in the channel config.
+ * So instead check the config.
+ */
+ if (ic->ic_vht_conf & IEEE80211_FVHT_USEVHT40)
+ vap->iv_vht_flags |= IEEE80211_FVHT_USEVHT40;
+ if (ic->ic_vht_conf & IEEE80211_FVHT_USEVHT80)
+ vap->iv_vht_flags |= IEEE80211_FVHT_USEVHT80;
+
+ /*
+ * These are in vht_cap_info, so just use them.
+ *
+ * It may be better to only enable VHT80 if 40 is enabled,
+ * and 160 / 80+80 if 40 is enabled. It's also likely better
+ * to put the FVHT into the config space and do a sanity check
+ * here.
+ */
if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(vap->iv_vht_cap.vht_cap_info))
vap->iv_vht_flags |= IEEE80211_FVHT_USEVHT160;
if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ(vap->iv_vht_cap.vht_cap_info))
Event Timeline
adrian
created this paste.
Fri, Nov 22, 4:09 AM
2024-11-22 04:09:34 (UTC+0)
adrian
created this object in space
S1 Global
.
Log In to Comment