Make channel parameters available in set_ap() driver operation
authorPeng Xu <pxu@qca.qualcomm.com>
Mon, 14 Apr 2014 18:05:26 +0000 (21:05 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 09:16:51 +0000 (12:16 +0300)
This provides information to allow the driver to be configured for
updated channel parameters, e.g., when dynamically changing HT20/HT40
bandwidth.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/beacon.c
src/drivers/driver.h

index 56df318..38600e6 100644 (file)
@@ -951,6 +951,9 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params)
 int ieee802_11_set_beacon(struct hostapd_data *hapd)
 {
        struct wpa_driver_ap_params params;
+       struct hostapd_freq_params freq;
+       struct hostapd_iface *iface = hapd->iface;
+       struct hostapd_config *iconf = iface->conf;
        struct wpabuf *beacon, *proberesp, *assocresp;
        int res, ret = -1;
 
@@ -972,6 +975,17 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
        params.proberesp_ies = proberesp;
        params.assocresp_ies = assocresp;
 
+       if (iface->current_mode &&
+           hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq,
+                                   iconf->channel, iconf->ieee80211n,
+                                   iconf->ieee80211ac,
+                                   iconf->secondary_channel,
+                                   iconf->vht_oper_chwidth,
+                                   iconf->vht_oper_centr_freq_seg0_idx,
+                                   iconf->vht_oper_centr_freq_seg1_idx,
+                                   iface->current_mode->vht_capab) == 0)
+               params.freq = &freq;
+
        res = hostapd_drv_set_ap(hapd, &params);
        hostapd_free_ap_extra_ies(hapd, beacon, proberesp, assocresp);
        if (res)
index c689876..00565a7 100644 (file)
@@ -868,6 +868,11 @@ struct wpa_driver_ap_params {
         * osen - Whether OSEN security is enabled
         */
        int osen;
+
+       /**
+        * freq - Channel parameters for dynamic bandwidth changes
+        */
+       struct hostapd_freq_params *freq;
 };
 
 /**
@@ -921,7 +926,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_AP            0x00000040
 /* Driver needs static WEP key setup after association has been completed */
 #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE     0x00000080
-/* unused: 0x00000100 */
+/* Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
+#define WPA_DRIVER_FLAGS_HT_2040_COEX                  0x00000100
 /* Driver supports concurrent P2P operations */
 #define WPA_DRIVER_FLAGS_P2P_CONCURRENT        0x00000200
 /*