]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Additions to hostapd_set_freq_params()
authorMuna Sinada <quic_msinada@quicinc.com>
Tue, 19 Apr 2022 18:04:16 +0000 (11:04 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 29 Apr 2022 14:40:13 +0000 (17:40 +0300)
Modify hostapd_set_freq_params() to include EHT parameters and update
the calling functions to match.

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
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
src/drivers/driver.h
wpa_supplicant/mesh.c
wpa_supplicant/wpa_supplicant.c

index 027b459a083aac011c77e372cfcc859650e0b7bd..817fbe6036a4b3d19657e20f3dc153cce22e5306 100644 (file)
@@ -551,7 +551,7 @@ 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 edmg, u8 edmg_channel,
                     int ht_enabled, int vht_enabled,
-                    int he_enabled,
+                    int he_enabled, bool eht_enabled,
                     int sec_channel_offset, int oper_chwidth,
                     int center_segment0, int center_segment1)
 {
@@ -560,12 +560,15 @@ int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
 
        if (hostapd_set_freq_params(&data, mode, freq, channel, edmg,
                                    edmg_channel, ht_enabled,
-                                   vht_enabled, he_enabled, sec_channel_offset,
-                                   oper_chwidth,
+                                   vht_enabled, he_enabled, eht_enabled,
+                                   sec_channel_offset, oper_chwidth,
                                    center_segment0, center_segment1,
                                    cmode ? cmode->vht_capab : 0,
                                    cmode ?
-                                   &cmode->he_capab[IEEE80211_MODE_AP] : NULL))
+                                   &cmode->he_capab[IEEE80211_MODE_AP] : NULL,
+                                   cmode ?
+                                   &cmode->eht_capab[IEEE80211_MODE_AP] :
+                                   NULL))
                return -1;
 
        if (hapd->driver == NULL)
@@ -814,7 +817,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 he_enabled, bool eht_enabled,
                          int sec_channel_offset, int oper_chwidth,
                          int center_segment0, int center_segment1,
                          bool radar_background)
@@ -835,11 +838,13 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
 
        if (hostapd_set_freq_params(&data, mode, freq, channel, 0, 0,
                                    ht_enabled,
-                                   vht_enabled, he_enabled, sec_channel_offset,
+                                   vht_enabled, he_enabled, eht_enabled,
+                                   sec_channel_offset,
                                    oper_chwidth, center_segment0,
                                    center_segment1,
                                    cmode->vht_capab,
-                                   &cmode->he_capab[IEEE80211_MODE_AP])) {
+                                   &cmode->he_capab[IEEE80211_MODE_AP],
+                                   &cmode->eht_capab[IEEE80211_MODE_AP])) {
                wpa_printf(MSG_ERROR, "Can't set freq params");
                return -1;
        }
index e5669a0c937ccdfa574f45b6db5816c2a9225586..b4fb766ee8ffad5e6b9a0ad04af57223e1ed8cc2 100644 (file)
@@ -66,8 +66,8 @@ 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 edmg, u8 edmg_channel,
-                    int ht_enabled, int vht_enabled,
-                    int he_enabled, int sec_channel_offset, int oper_chwidth,
+                    int ht_enabled, int vht_enabled, int he_enabled,
+                    bool eht_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);
@@ -130,7 +130,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 he_enabled, bool eht_enabled,
                          int sec_channel_offset, int oper_chwidth,
                          int center_segment0, int center_segment1,
                          bool radar_background);
index 7212f501fe76fc3c1008f337922825404636a069..eaa403326c0ad71a511c1e0a2968673722abb926 100644 (file)
@@ -1950,12 +1950,14 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
                                    iconf->channel, iconf->enable_edmg,
                                    iconf->edmg_channel, iconf->ieee80211n,
                                    iconf->ieee80211ac, iconf->ieee80211ax,
+                                   iconf->ieee80211be,
                                    iconf->secondary_channel,
                                    hostapd_get_oper_chwidth(iconf),
                                    hostapd_get_oper_centr_freq_seg0_idx(iconf),
                                    hostapd_get_oper_centr_freq_seg1_idx(iconf),
                                    cmode->vht_capab,
-                                   &cmode->he_capab[IEEE80211_MODE_AP]) == 0)
+                                   &cmode->he_capab[IEEE80211_MODE_AP],
+                                   &cmode->eht_capab[IEEE80211_MODE_AP]) == 0)
                params.freq = &freq;
 
        res = hostapd_drv_set_ap(hapd, &params);
index ed9978b6e7f43ca5e9b59a5411319acb336ac386..e46dd7ede3b82d5fd333f9023cdcbfb3d2dd7c27 100644 (file)
@@ -888,7 +888,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->ieee80211ax, iface->conf->ieee80211be,
                iface->conf->secondary_channel,
                hostapd_get_oper_chwidth(iface->conf),
                hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
@@ -981,12 +981,14 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
                                      iface->conf->ieee80211n,
                                      iface->conf->ieee80211ac,
                                      iface->conf->ieee80211ax,
+                                     iface->conf->ieee80211be,
                                      secondary_channel,
                                      new_vht_oper_chwidth,
                                      oper_centr_freq_seg0_idx,
                                      oper_centr_freq_seg1_idx,
                                      cmode->vht_capab,
-                                     &cmode->he_capab[ieee80211_mode]);
+                                     &cmode->he_capab[ieee80211_mode],
+                                     &cmode->eht_capab[ieee80211_mode]);
 
        if (err) {
                wpa_printf(MSG_ERROR,
@@ -1059,6 +1061,7 @@ static void hostpad_dfs_update_background_chain(struct hostapd_iface *iface)
                                  iface->conf->ieee80211n,
                                  iface->conf->ieee80211ac,
                                  iface->conf->ieee80211ax,
+                                 iface->conf->ieee80211be,
                                  sec, hostapd_get_oper_chwidth(iface->conf),
                                  oper_centr_freq_seg0_idx,
                                  oper_centr_freq_seg1_idx, true)) {
index 32d2225610dffd072667beadf3b319d67c7984ad..6b46e798e244b368269a0260df4a82a071f63573 100644 (file)
@@ -2076,6 +2076,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
                                     hapd->iconf->ieee80211n,
                                     hapd->iconf->ieee80211ac,
                                     hapd->iconf->ieee80211ax,
+                                    hapd->iconf->ieee80211be,
                                     hapd->iconf->secondary_channel,
                                     hostapd_get_oper_chwidth(hapd->iconf),
                                     hostapd_get_oper_centr_freq_seg0_idx(
@@ -3461,12 +3462,14 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
                                    conf->channel, conf->enable_edmg,
                                    conf->edmg_channel, conf->ieee80211n,
                                    conf->ieee80211ac, conf->ieee80211ax,
-                                   conf->secondary_channel,
+                                   conf->ieee80211be, 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,
                                    mode ? &mode->he_capab[IEEE80211_MODE_AP] :
+                                   NULL,
+                                   mode ? &mode->eht_capab[IEEE80211_MODE_AP] :
                                    NULL))
                return -1;
 
index f168d4e9290f70ac6900b9399a0803f4a8976c9b..732124f4d15e38ea195b4922d67fe50af83286d9 100644 (file)
@@ -383,10 +383,11 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            int freq, int channel, int enable_edmg,
                            u8 edmg_channel, int ht_enabled,
                            int vht_enabled, int he_enabled,
-                           int sec_channel_offset,
+                           bool eht_enabled, int sec_channel_offset,
                            int oper_chwidth, int center_segment0,
                            int center_segment1, u32 vht_caps,
-                           struct he_capabilities *he_cap)
+                           struct he_capabilities *he_cap,
+                           struct eht_capabilities *eht_cap)
 {
        if (!he_cap || !he_cap->he_supported)
                he_enabled = 0;
@@ -397,6 +398,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
        data->ht_enabled = ht_enabled;
        data->vht_enabled = vht_enabled;
        data->he_enabled = he_enabled;
+       data->eht_enabled = eht_enabled;
        data->sec_channel_offset = sec_channel_offset;
        data->center_freq1 = freq + sec_channel_offset * 10;
        data->center_freq2 = 0;
@@ -415,9 +417,9 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                                 &data->edmg);
 
        if (is_6ghz_freq(freq)) {
-               if (!data->he_enabled) {
+               if (!data->he_enabled && !data->eht_enabled) {
                        wpa_printf(MSG_ERROR,
-                                  "Can't set 6 GHz mode - HE isn't enabled");
+                                  "Can't set 6 GHz mode - HE or EHT aren't enabled");
                        return -1;
                }
 
@@ -480,7 +482,20 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                return 0;
        }
 
-       if (data->he_enabled) switch (oper_chwidth) {
+#if 0 /* FIX: Figure out how to handle CHANWIDTH_320MHZ */
+       if (data->eht_enabled) switch (oper_chwidth) {
+       case CHANWIDTH_320MHZ:
+               if (!(eht_cap->phy_cap[EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_IDX] &
+                     EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_MASK)) {
+                       wpa_printf(MSG_ERROR,
+                                  "320 MHz channel width is not supported in 5 or 6 GHz");
+                       return -1;
+               }
+               break;
+       }
+#endif
+
+       if (data->he_enabled || data->eht_enabled) switch (oper_chwidth) {
        case CHANWIDTH_USE_HT:
                if (sec_channel_offset == 0)
                        break;
@@ -543,7 +558,8 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                break;
        }
 
-       if (data->he_enabled || data->vht_enabled) switch (oper_chwidth) {
+       if (data->eht_enabled || data->he_enabled ||
+           data->vht_enabled) switch (oper_chwidth) {
        case CHANWIDTH_USE_HT:
                if (center_segment1 ||
                    (center_segment0 != 0 &&
index 0e92aa0f2bc5e6bdf58db849f0051ea33b74455d..d87a2caff52dbcef9d30638404f1c8b64e347b1a 100644 (file)
@@ -40,10 +40,11 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            int freq, int channel, int edmg, u8 edmg_channel,
                            int ht_enabled,
                            int vht_enabled, int he_enabled,
-                           int sec_channel_offset,
+                           bool eht_enabled, int sec_channel_offset,
                            int oper_chwidth, int center_segment0,
                            int center_segment1, u32 vht_caps,
-                           struct he_capabilities *he_caps);
+                           struct he_capabilities *he_caps,
+                           struct eht_capabilities *eht_cap);
 void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
                      int disabled);
 int ieee80211ac_cap_check(u32 hw, u32 conf);
index d8220e956773d4b2818bd1c720c52e01b476d602..7e83f0246e11f91fbe597e24b74b4d9a694381ed 100644 (file)
@@ -803,6 +803,11 @@ struct hostapd_freq_params {
         * radar_background - Whether radar/CAC background is requested
         */
        bool radar_background;
+
+       /**
+        * eht_enabled - Whether EHT is enabled
+        */
+       bool eht_enabled;
 };
 
 /**
index d6b8a1ad9e368329c2f1c8a83ae9351da868113f..b67396d5a15e52edb449cd7e83f1ffb53a28124e 100644 (file)
@@ -225,12 +225,13 @@ static int wpas_mesh_update_freq_params(struct wpa_supplicant *wpa_s)
                    ifmsh->conf->ieee80211n,
                    ifmsh->conf->ieee80211ac,
                    ifmsh->conf->ieee80211ax,
+                   false,
                    ifmsh->conf->secondary_channel,
                    hostapd_get_oper_chwidth(ifmsh->conf),
                    hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
                    hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
                    ifmsh->conf->vht_capab,
-                   he_capab)) {
+                   he_capab, NULL)) {
                wpa_printf(MSG_ERROR, "Error updating mesh frequency params");
                wpa_supplicant_mesh_deinit(wpa_s, true);
                return -1;
index 64cad0af21d67afad21ec709023c8029ac881350..4237174ab61815e55e9c773d9c1398e5c0237088 100644 (file)
@@ -2759,9 +2759,11 @@ skip_to_6ghz:
                                    freq->channel, ssid->enable_edmg,
                                    ssid->edmg_channel, freq->ht_enabled,
                                    vht_freq.vht_enabled, freq->he_enabled,
+                                   false,
                                    freq->sec_channel_offset,
                                    chwidth, seg0, seg1, vht_caps,
-                                   &mode->he_capab[ieee80211_mode]) != 0)
+                                   &mode->he_capab[ieee80211_mode],
+                                   NULL) != 0)
                return;
 
        *freq = vht_freq;