]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Store the VHT Operation element of an associated STA
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
Mon, 6 Aug 2018 19:46:24 +0000 (15:46 -0400)
committerJouni Malinen <j@w1.fi>
Sun, 16 Dec 2018 16:35:30 +0000 (18:35 +0200)
APs and mesh peers use the VHT Operation element to advertise certain
channel properties (e.g., the bandwidth of the channel). Save this
information element so we can later access this information.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
src/ap/ieee802_11.c
src/ap/ieee802_11.h
src/ap/ieee802_11_vht.c
src/ap/sta_info.c
src/ap/sta_info.h
wpa_supplicant/mesh_mpm.c

index fce5781c21b53ef73cfa25b0717a0d8c191cfd1e..41de3f6c137b80f8e6de3daf1b3cf91a65b04875 100644 (file)
@@ -2485,6 +2485,10 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
                if (resp != WLAN_STATUS_SUCCESS)
                        return resp;
 
+               resp = copy_sta_vht_oper(hapd, sta, elems.vht_operation);
+               if (resp != WLAN_STATUS_SUCCESS)
+                       return resp;
+
                resp = set_sta_vht_opmode(hapd, sta, elems.vht_opmode_notif);
                if (resp != WLAN_STATUS_SUCCESS)
                        return resp;
index 2f3b4da8e752a2adb7e0ffb7b939c5793fea3b22..3d93be299d28a2a997e9ac8b8977443fec241064 100644 (file)
@@ -80,6 +80,8 @@ void ht40_intolerant_add(struct hostapd_iface *iface, struct sta_info *sta);
 void ht40_intolerant_remove(struct hostapd_iface *iface, struct sta_info *sta);
 u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
                       const u8 *vht_capab);
+u16 copy_sta_vht_oper(struct hostapd_data *hapd, struct sta_info *sta,
+                     const u8 *vht_oper);
 u16 set_sta_vht_opmode(struct hostapd_data *hapd, struct sta_info *sta,
                       const u8 *vht_opmode);
 void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
index 8d0662078bcf198ad0a1d5ede94305a6d2b506b2..54ee080a43f0239f9b7a37120463352cdf52a6cb 100644 (file)
@@ -357,6 +357,29 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
 }
 
 
+u16 copy_sta_vht_oper(struct hostapd_data *hapd, struct sta_info *sta,
+                     const u8 *vht_oper)
+{
+       if (!vht_oper) {
+               os_free(sta->vht_operation);
+               sta->vht_operation = NULL;
+               return WLAN_STATUS_SUCCESS;
+       }
+
+       if (!sta->vht_operation) {
+               sta->vht_operation =
+                       os_zalloc(sizeof(struct ieee80211_vht_operation));
+               if (!sta->vht_operation)
+                       return WLAN_STATUS_UNSPECIFIED_FAILURE;
+       }
+
+       os_memcpy(sta->vht_operation, vht_oper,
+                 sizeof(struct ieee80211_vht_operation));
+
+       return WLAN_STATUS_SUCCESS;
+}
+
+
 u16 copy_sta_vendor_vht(struct hostapd_data *hapd, struct sta_info *sta,
                        const u8 *ie, size_t len)
 {
index 179cf43b60b17c267d9fe9622370c3c82fad9e4b..d0f14389020b0489831a6b8bb0d1c8481541dd18 100644 (file)
@@ -328,6 +328,7 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
 
        os_free(sta->ht_capabilities);
        os_free(sta->vht_capabilities);
+       os_free(sta->vht_operation);
        hostapd_free_psk_list(sta->psk);
        os_free(sta->identity);
        os_free(sta->radius_cui);
index 9cac6f157f68f4b1b9dc9d7f617541b51def71c9..48365822e8d803ac4984a3e57a946b08d90e0164 100644 (file)
@@ -162,6 +162,7 @@ struct sta_info {
 
        struct ieee80211_ht_capabilities *ht_capabilities;
        struct ieee80211_vht_capabilities *vht_capabilities;
+       struct ieee80211_vht_operation *vht_operation;
        u8 vht_opmode;
 
 #ifdef CONFIG_IEEE80211W
index eafb0af7b82a97a180473e97ffebd65024dac03d..75ee0f7750c77b6ee30abae3418d83119a06d83d 100644 (file)
@@ -699,6 +699,7 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s,
 
 #ifdef CONFIG_IEEE80211AC
        copy_sta_vht_capab(data, sta, elems->vht_capabilities);
+       copy_sta_vht_oper(data, sta, elems->vht_operation);
        set_sta_vht_opmode(data, sta, elems->vht_opmode_notif);
 #endif /* CONFIG_IEEE80211AC */