AP: Enable HT Tx STBC for AP/GO if supported by driver
[mech_eap.git] / wpa_supplicant / ap.c
index 8c3d3b8..65532e3 100644 (file)
@@ -132,6 +132,7 @@ void wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
                                 HT_CAP_INFO_SHORT_GI20MHZ |
                                 HT_CAP_INFO_SHORT_GI40MHZ |
                                 HT_CAP_INFO_RX_STBC_MASK |
+                                HT_CAP_INFO_TX_STBC |
                                 HT_CAP_INFO_MAX_AMSDU_SIZE);
 
                        if (mode->vht_capab && ssid->vht) {
@@ -225,7 +226,7 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
        bss->wpa_key_mgmt = ssid->key_mgmt;
        bss->wpa_pairwise = ssid->pairwise_cipher;
        if (ssid->psk_set) {
-               os_free(bss->ssid.wpa_psk);
+               bin_clear_free(bss->ssid.wpa_psk, sizeof(*bss->ssid.wpa_psk));
                bss->ssid.wpa_psk = os_zalloc(sizeof(struct hostapd_wpa_psk));
                if (bss->ssid.wpa_psk == NULL)
                        return -1;
@@ -994,30 +995,45 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
 int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
                            char *buf, size_t buflen)
 {
-       if (wpa_s->ap_iface == NULL)
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface)
+               hapd = wpa_s->ap_iface->bss[0];
+       else if (wpa_s->ifmsh)
+               hapd = wpa_s->ifmsh->bss[0];
+       else
                return -1;
-       return hostapd_ctrl_iface_sta_first(wpa_s->ap_iface->bss[0],
-                                           buf, buflen);
+       return hostapd_ctrl_iface_sta_first(hapd, buf, buflen);
 }
 
 
 int ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr,
                      char *buf, size_t buflen)
 {
-       if (wpa_s->ap_iface == NULL)
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface)
+               hapd = wpa_s->ap_iface->bss[0];
+       else if (wpa_s->ifmsh)
+               hapd = wpa_s->ifmsh->bss[0];
+       else
                return -1;
-       return hostapd_ctrl_iface_sta(wpa_s->ap_iface->bss[0], txtaddr,
-                                     buf, buflen);
+       return hostapd_ctrl_iface_sta(hapd, txtaddr, buf, buflen);
 }
 
 
 int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr,
                           char *buf, size_t buflen)
 {
-       if (wpa_s->ap_iface == NULL)
+       struct hostapd_data *hapd;
+
+       if (wpa_s->ap_iface)
+               hapd = wpa_s->ap_iface->bss[0];
+       else if (wpa_s->ifmsh)
+               hapd = wpa_s->ifmsh->bss[0];
+       else
                return -1;
-       return hostapd_ctrl_iface_sta_next(wpa_s->ap_iface->bss[0], txtaddr,
-                                          buf, buflen);
+       return hostapd_ctrl_iface_sta_next(hapd, txtaddr, buf, buflen);
 }