diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -50,6 +50,8 @@ 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 *); diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -707,6 +707,33 @@ 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) {