aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ieee802_11_vht.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ap/ieee802_11_vht.c')
-rw-r--r--src/ap/ieee802_11_vht.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
index f2ab182..221d9c2 100644
--- a/src/ap/ieee802_11_vht.c
+++ b/src/ap/ieee802_11_vht.c
@@ -108,6 +108,35 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
return WLAN_STATUS_SUCCESS;
}
+
+u16 set_sta_vht_opmode(struct hostapd_data *hapd, struct sta_info *sta,
+ const u8 *vht_oper_notif)
+{
+ u8 channel_width;
+
+ if (!vht_oper_notif) {
+ sta->flags &= ~WLAN_STA_VHT_OPMODE_ENABLED;
+ return WLAN_STATUS_SUCCESS;
+ }
+
+ channel_width = *vht_oper_notif & VHT_OPMODE_CHANNEL_WIDTH_MASK;
+
+ if (channel_width != VHT_CHANWIDTH_USE_HT &&
+ channel_width != VHT_CHANWIDTH_80MHZ &&
+ channel_width != VHT_CHANWIDTH_160MHZ &&
+ channel_width != VHT_CHANWIDTH_80P80MHZ &&
+ ((*vht_oper_notif & VHT_OPMODE_CHANNEL_RxNSS_MASK) >>
+ VHT_OPMODE_NOTIF_RX_NSS_SHIFT) > VHT_RX_NSS_MAX_STREAMS - 1) {
+ sta->flags &= ~WLAN_STA_VHT_OPMODE_ENABLED;
+ return WLAN_STATUS_UNSPECIFIED_FAILURE;
+ }
+
+ sta->flags |= WLAN_STA_VHT_OPMODE_ENABLED;
+ sta->vht_opmode = *vht_oper_notif;
+ return WLAN_STATUS_SUCCESS;
+}
+
+
void hostapd_get_vht_capab(struct hostapd_data *hapd,
struct ieee80211_vht_capabilities *vht_cap,
struct ieee80211_vht_capabilities *neg_vht_cap)