]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HE: Pass in HE information into hostapd_set_freq_params()
authorJohn Crispin <john@phrozen.org>
Mon, 20 May 2019 07:55:09 +0000 (09:55 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 27 May 2019 14:33:59 +0000 (17:33 +0300)
Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h
src/ap/beacon.c
src/ap/dfs.c
src/ap/hostapd.c
src/common/hw_features_common.c
src/common/hw_features_common.h
wpa_supplicant/wpa_supplicant.c

index 8bdacf6ff05aca695df5641c2fbcd9eb4d12741f..9249762ca8b40d999bd1648a94234a94364aacdd 100644 (file)
@@ -541,17 +541,19 @@ int hostapd_flush(struct hostapd_data *hapd)
 
 int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
                     int freq, int channel, int ht_enabled, int vht_enabled,
+                    int he_enabled,
                     int sec_channel_offset, int oper_chwidth,
                     int center_segment0, int center_segment1)
 {
        struct hostapd_freq_params data;
 
        if (hostapd_set_freq_params(&data, mode, freq, channel, ht_enabled,
-                                   vht_enabled, sec_channel_offset,
+                                   vht_enabled, he_enabled, sec_channel_offset,
                                    oper_chwidth,
                                    center_segment0, center_segment1,
                                    hapd->iface->current_mode ?
-                                   hapd->iface->current_mode->vht_capab : 0))
+                                   hapd->iface->current_mode->vht_capab : 0,
+                                   &hapd->iface->current_mode->he_capab))
                return -1;
 
        if (hapd->driver == NULL)
@@ -789,6 +791,7 @@ int hostapd_drv_send_action_addr3_ap(struct hostapd_data *hapd,
 int hostapd_start_dfs_cac(struct hostapd_iface *iface,
                          enum hostapd_hw_mode mode, int freq,
                          int channel, int ht_enabled, int vht_enabled,
+                         int he_enabled,
                          int sec_channel_offset, int oper_chwidth,
                          int center_segment0, int center_segment1)
 {
@@ -806,10 +809,11 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
        }
 
        if (hostapd_set_freq_params(&data, mode, freq, channel, ht_enabled,
-                                   vht_enabled, sec_channel_offset,
+                                   vht_enabled, he_enabled, sec_channel_offset,
                                    oper_chwidth, center_segment0,
                                    center_segment1,
-                                   iface->current_mode->vht_capab)) {
+                                   iface->current_mode->vht_capab,
+                                   &iface->current_mode->he_capab)) {
                wpa_printf(MSG_ERROR, "Can't set freq params");
                return -1;
        }
index 4357ceed3a273b9d15666595bb4157729693893b..2a914dc65c9e103c1745f71bf4f8783d74a38df8 100644 (file)
@@ -63,7 +63,7 @@ int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
 int hostapd_flush(struct hostapd_data *hapd);
 int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
                     int freq, int channel, int ht_enabled, int vht_enabled,
-                    int sec_channel_offset, int oper_chwidth,
+                    int he_enabled, int sec_channel_offset, int oper_chwidth,
                     int center_segment0, int center_segment1);
 int hostapd_set_rts(struct hostapd_data *hapd, int rts);
 int hostapd_set_frag(struct hostapd_data *hapd, int frag);
@@ -126,6 +126,7 @@ int hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
 int hostapd_start_dfs_cac(struct hostapd_iface *iface,
                          enum hostapd_hw_mode mode, int freq,
                          int channel, int ht_enabled, int vht_enabled,
+                         int he_enabled,
                          int sec_channel_offset, int oper_chwidth,
                          int center_segment0, int center_segment1);
 int hostapd_drv_do_acs(struct hostapd_data *hapd);
index 5cc30445087889da531056d35d76e9a04cbc9de7..1838c1c843093600df68e11548de9c00513e3160 100644 (file)
@@ -1424,12 +1424,13 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
        if (iface->current_mode &&
            hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq,
                                    iconf->channel, iconf->ieee80211n,
-                                   iconf->ieee80211ac,
+                                   iconf->ieee80211ac, iconf->ieee80211ax,
                                    iconf->secondary_channel,
                                    hostapd_get_oper_chwidth(iconf),
                                    hostapd_get_oper_centr_freq_seg0_idx(iconf),
                                    hostapd_get_oper_centr_freq_seg1_idx(iconf),
-                                   iface->current_mode->vht_capab) == 0)
+                                   iface->current_mode->vht_capab,
+                                   &iface->current_mode->he_capab) == 0)
                params.freq = &freq;
 
        res = hostapd_drv_set_ap(hapd, &params);
index e4dc0dd3d684d59e95c396e6e5d98ecb2391f386..417235b02d4dd89bfd8af7c3080affcabf324d02 100644 (file)
@@ -744,6 +744,7 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
        res = hostapd_start_dfs_cac(
                iface, iface->conf->hw_mode, iface->freq, iface->conf->channel,
                iface->conf->ieee80211n, iface->conf->ieee80211ac,
+               iface->conf->ieee80211ax,
                iface->conf->secondary_channel,
                hostapd_get_oper_chwidth(iface->conf),
                hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
@@ -960,11 +961,13 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
                                      channel->chan,
                                      iface->conf->ieee80211n,
                                      iface->conf->ieee80211ac,
+                                     iface->conf->ieee80211ax,
                                      secondary_channel,
                                      hostapd_get_oper_chwidth(iface->conf),
                                      oper_centr_freq_seg0_idx,
                                      oper_centr_freq_seg1_idx,
-                                     iface->current_mode->vht_capab);
+                                     iface->current_mode->vht_capab,
+                                     &iface->current_mode->he_capab);
 
        if (err) {
                wpa_printf(MSG_ERROR, "DFS failed to calculate CSA freq params");
index 29860a96babcf33b7e953f5fc09fc3081dadcd9f..a333ba137790b94dbf1cc7e7db7ea4ff470b99d6 100644 (file)
@@ -1868,6 +1868,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
                                     hapd->iconf->channel,
                                     hapd->iconf->ieee80211n,
                                     hapd->iconf->ieee80211ac,
+                                    hapd->iconf->ieee80211ax,
                                     hapd->iconf->secondary_channel,
                                     hostapd_get_oper_chwidth(hapd->iconf),
                                     hostapd_get_oper_centr_freq_seg0_idx(
@@ -3206,6 +3207,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
 {
        int channel;
        u8 seg0, seg1;
+       struct hostapd_hw_modes *mode;
 
        if (!params->channel) {
                /* check if the new channel is supported by hw */
@@ -3216,17 +3218,20 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
        if (!channel)
                return -1;
 
+       mode = hapd->iface->current_mode;
+
        /* if a pointer to old_params is provided we save previous state */
        if (old_params &&
            hostapd_set_freq_params(old_params, conf->hw_mode,
                                    hostapd_hw_get_freq(hapd, conf->channel),
                                    conf->channel, conf->ieee80211n,
-                                   conf->ieee80211ac,
+                                   conf->ieee80211ac, conf->ieee80211ax,
                                    conf->secondary_channel,
                                    hostapd_get_oper_chwidth(conf),
                                    hostapd_get_oper_centr_freq_seg0_idx(conf),
                                    hostapd_get_oper_centr_freq_seg1_idx(conf),
-                                   conf->vht_capab))
+                                   conf->vht_capab,
+                                   mode ? &mode->he_capab : NULL))
                return -1;
 
        switch (params->bandwidth) {
index aa430f2e24200fca428f28a0ce34210704f6e1d0..3fdbf893d2b77d2d7ec8eff05c0e21637c134b77 100644 (file)
@@ -361,16 +361,21 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode,
 int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            enum hostapd_hw_mode mode,
                            int freq, int channel, int ht_enabled,
-                           int vht_enabled, int sec_channel_offset,
+                           int vht_enabled, int he_enabled,
+                           int sec_channel_offset,
                            int oper_chwidth, int center_segment0,
-                           int center_segment1, u32 vht_caps)
+                           int center_segment1, u32 vht_caps,
+                           struct he_capabilities *he_cap)
 {
+       if (!he_cap)
+               he_enabled = 0;
        os_memset(data, 0, sizeof(*data));
        data->mode = mode;
        data->freq = freq;
        data->channel = channel;
        data->ht_enabled = ht_enabled;
        data->vht_enabled = vht_enabled;
+       data->he_enabled = he_enabled;
        data->sec_channel_offset = sec_channel_offset;
        data->center_freq1 = freq + sec_channel_offset * 10;
        data->center_freq2 = 0;
index d3efe77f281df2b04705aa05411787dde4c23c1e..2d2a539943c099cc1247066314aad48fae4bde12 100644 (file)
@@ -32,9 +32,11 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode,
 int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            enum hostapd_hw_mode mode,
                            int freq, int channel, int ht_enabled,
-                           int vht_enabled, int sec_channel_offset,
+                           int vht_enabled, int he_enabled,
+                           int sec_channel_offset,
                            int oper_chwidth, int center_segment0,
-                           int center_segment1, u32 vht_caps);
+                           int center_segment1, u32 vht_caps,
+                           struct he_capabilities *he_caps);
 void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
                      int disabled);
 int ieee80211ac_cap_check(u32 hw, u32 conf);
index 2b92fcb9225ff9923a07e2fff5f31b9fc515053b..f82d18fe27c6604291e5973801bdbcff9db184e8 100644 (file)
@@ -2408,9 +2408,9 @@ skip_ht40:
 
        if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq,
                                    freq->channel, freq->ht_enabled,
-                                   vht_freq.vht_enabled,
+                                   vht_freq.vht_enabled, 0,
                                    freq->sec_channel_offset,
-                                   chwidth, seg0, seg1, vht_caps) != 0)
+                                   chwidth, seg0, seg1, vht_caps, NULL) != 0)
                return;
 
        *freq = vht_freq;