hostapd: Pass VHT capabilities to driver wrapper
authorJohannes Berg <johannes.berg@intel.com>
Fri, 28 Dec 2012 15:30:30 +0000 (17:30 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Jan 2013 15:51:52 +0000 (17:51 +0200)
Signed-hostap: Johannes Berg <johannes.berg@intel.com>

src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h
src/ap/ieee802_11.c
src/ap/ieee802_11.h
src/ap/ieee802_11_vht.c
src/drivers/driver.h

index 355df15..b71d51d 100644 (file)
@@ -338,6 +338,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
                    const u8 *supp_rates, size_t supp_rates_len,
                    u16 listen_interval,
                    const struct ieee80211_ht_capabilities *ht_capab,
+                   const struct ieee80211_vht_capabilities *vht_capab,
                    u32 flags, u8 qosinfo)
 {
        struct hostapd_sta_add_params params;
@@ -355,6 +356,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
        params.supp_rates_len = supp_rates_len;
        params.listen_interval = listen_interval;
        params.ht_capabilities = ht_capab;
+       params.vht_capabilities = vht_capab;
        params.flags = hostapd_sta_flags_to_drv(flags);
        params.qosinfo = qosinfo;
        return hapd->driver->sta_add(hapd->drv_priv, &params);
index 768a0ba..ceb7e68 100644 (file)
@@ -13,6 +13,7 @@ enum wpa_driver_if_type;
 struct wpa_bss_params;
 struct wpa_driver_scan_params;
 struct ieee80211_ht_capabilities;
+struct ieee80211_vht_capabilities;
 
 u32 hostapd_sta_flags_to_drv(u32 flags);
 int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
@@ -37,6 +38,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
                    const u8 *supp_rates, size_t supp_rates_len,
                    u16 listen_interval,
                    const struct ieee80211_ht_capabilities *ht_capab,
+                   const struct ieee80211_vht_capabilities *vht_capab,
                    u32 flags, u8 qosinfo);
 int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
 int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
index 51c8d28..0bc7f5b 100644 (file)
@@ -1708,6 +1708,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
        struct sta_info *sta;
        int new_assoc = 1;
        struct ieee80211_ht_capabilities ht_cap;
+       struct ieee80211_vht_capabilities vht_cap;
 
        if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
                                      sizeof(mgmt->u.assoc_resp))) {
@@ -1780,11 +1781,16 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
        if (sta->flags & WLAN_STA_HT)
                hostapd_get_ht_capab(hapd, sta->ht_capabilities, &ht_cap);
 #endif /* CONFIG_IEEE80211N */
+#ifdef CONFIG_IEEE80211AC
+       if (sta->flags & WLAN_STA_VHT)
+               hostapd_get_vht_capab(hapd, sta->vht_capabilities, &vht_cap);
+#endif /* CONFIG_IEEE80211AC */
 
        if (hostapd_sta_add(hapd, sta->addr, sta->aid, sta->capability,
                            sta->supported_rates, sta->supported_rates_len,
                            sta->listen_interval,
                            sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
+                           sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
                            sta->flags, sta->qosinfo)) {
                hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
                               HOSTAPD_LEVEL_NOTICE,
index 1e5800d..2aab56d 100644 (file)
@@ -53,6 +53,9 @@ void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
 void hostapd_get_ht_capab(struct hostapd_data *hapd,
                          struct ieee80211_ht_capabilities *ht_cap,
                          struct ieee80211_ht_capabilities *neg_ht_cap);
+void hostapd_get_vht_capab(struct hostapd_data *hapd,
+                          struct ieee80211_vht_capabilities *vht_cap,
+                          struct ieee80211_vht_capabilities *neg_vht_cap);
 u16 copy_sta_ht_capab(struct hostapd_data *hapd, struct sta_info *sta,
                      const u8 *ht_capab, size_t ht_capab_len);
 void update_ht_state(struct hostapd_data *hapd, struct sta_info *sta);
index b21c2b7..f6cc5d6 100644 (file)
@@ -108,3 +108,14 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
 
        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)
+{
+       if (vht_cap == NULL)
+               return;
+       os_memcpy(neg_vht_cap, vht_cap, sizeof(*neg_vht_cap));
+
+       /* TODO: mask own capabilities, like get_ht_capab() */
+}
index 62f621f..b981172 100644 (file)
@@ -898,6 +898,7 @@ struct hostapd_sta_add_params {
        size_t supp_rates_len;
        u16 listen_interval;
        const struct ieee80211_ht_capabilities *ht_capabilities;
+       const struct ieee80211_vht_capabilities *vht_capabilities;
        u32 flags; /* bitmask of WPA_STA_* flags */
        int set; /* Set STA parameters instead of add */
        u8 qosinfo;