]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Provide punct_bitmap to hostapd_set_freq_params()
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 8 Mar 2024 08:01:30 +0000 (10:01 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 8 Mar 2024 08:01:30 +0000 (10:01 +0200)
This is needed to be able to check validity of the channel parameters
for cases where EHT puncturing impacts what can be enabled for
HT/VHT/HE.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/ap_drv_ops.c
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/mesh.c
wpa_supplicant/wpa_supplicant.c

index 60d66e4c0888e1d576586b541e3dfcf21a48fd34..e89f53060658c300018ea8505d53e1fa0a5471ae 100644 (file)
@@ -629,7 +629,7 @@ int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
                                    &cmode->he_capab[IEEE80211_MODE_AP] : NULL,
                                    cmode ?
                                    &cmode->eht_capab[IEEE80211_MODE_AP] :
-                                   NULL))
+                                   NULL, hostapd_get_punct_bitmap(hapd)))
                return -1;
 
        if (hapd->driver == NULL)
@@ -977,7 +977,8 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
                                    center_segment1,
                                    cmode->vht_capab,
                                    &cmode->he_capab[IEEE80211_MODE_AP],
-                                   &cmode->eht_capab[IEEE80211_MODE_AP])) {
+                                   &cmode->eht_capab[IEEE80211_MODE_AP],
+                                   hostapd_get_punct_bitmap(hapd))) {
                wpa_printf(MSG_ERROR, "Can't set freq params");
                return -1;
        }
index e50f0a0c976e075b8eeef3fe45d1e9e1bc7eeb37..e339c2002fabad2d8ac8842f43ae7ba9660de549 100644 (file)
@@ -2616,7 +2616,8 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
                                    hostapd_get_oper_centr_freq_seg1_idx(iconf),
                                    cmode->vht_capab,
                                    &cmode->he_capab[IEEE80211_MODE_AP],
-                                   &cmode->eht_capab[IEEE80211_MODE_AP]) == 0)
+                                   &cmode->eht_capab[IEEE80211_MODE_AP],
+                                   hostapd_get_punct_bitmap(hapd)) == 0)
                params.freq = &freq;
 
        for (i = 0; i < hapd->iface->num_hw_features; i++) {
index 5e36cff10b67b98ac649a26c3bd7631678dd6f20..fc2e8d83cda7e36438517dc8cc936037ea22c3e9 100644 (file)
@@ -1010,7 +1010,8 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
                                      oper_centr_freq_seg1_idx,
                                      cmode->vht_capab,
                                      &cmode->he_capab[ieee80211_mode],
-                                     &cmode->eht_capab[ieee80211_mode]);
+                                     &cmode->eht_capab[ieee80211_mode],
+                                     hostapd_get_punct_bitmap(iface->bss[0]));
 
        if (err) {
                wpa_printf(MSG_ERROR,
index 0b805ba107f8ff8aeabd14a5152fea2b326ccc8f..577e6eaad4dae583dd29673f8020e445568d67da 100644 (file)
@@ -3915,7 +3915,8 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
                                    mode ? &mode->he_capab[IEEE80211_MODE_AP] :
                                    NULL,
                                    mode ? &mode->eht_capab[IEEE80211_MODE_AP] :
-                                   NULL))
+                                   NULL,
+                                   hostapd_get_punct_bitmap(hapd)))
                return -1;
 
        switch (params->bandwidth) {
index f45d2e9ed98c19c2617c9c1d749a30e21ceae7e7..ea547f7ea037a4e9f89fa96dea07d5e98637efd3 100644 (file)
@@ -391,7 +391,8 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            int center_segment0,
                            int center_segment1, u32 vht_caps,
                            struct he_capabilities *he_cap,
-                           struct eht_capabilities *eht_cap)
+                           struct eht_capabilities *eht_cap,
+                           u16 punct_bitmap)
 {
        if (!he_cap || !he_cap->he_supported)
                he_enabled = 0;
index 82e02823829e586bd103ea416c2e45089373dc59..8ce31e4f01e127aee6894c03282fda85bcdaab10 100644 (file)
@@ -45,7 +45,8 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            int center_segment0,
                            int center_segment1, u32 vht_caps,
                            struct he_capabilities *he_caps,
-                           struct eht_capabilities *eht_cap);
+                           struct eht_capabilities *eht_cap,
+                           u16 punct_bitmap);
 void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
                      int disabled);
 int ieee80211ac_cap_check(u32 hw, u32 conf);
index 486fc6a094e083b6caf94e2e6ded218f31a29c77..85c1ea8ba270b3105cc2d4d15f971df5c43c5ee3 100644 (file)
@@ -231,7 +231,7 @@ static int wpas_mesh_update_freq_params(struct wpa_supplicant *wpa_s)
                    hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
                    hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
                    ifmsh->conf->vht_capab,
-                   he_capab, NULL)) {
+                   he_capab, NULL, 0)) {
                wpa_printf(MSG_ERROR, "Error updating mesh frequency params");
                wpa_supplicant_mesh_deinit(wpa_s, true);
                return -1;
index fe05e244d77a4990eedad726af1f51ea4d35d02a..98ecb7a74483403380657e5692a5e5c39b5935fa 100644 (file)
@@ -3064,7 +3064,7 @@ skip_80mhz:
                                    freq->sec_channel_offset,
                                    chwidth, seg0, seg1, vht_caps,
                                    &mode->he_capab[ieee80211_mode],
-                                   &mode->eht_capab[ieee80211_mode]) != 0)
+                                   &mode->eht_capab[ieee80211_mode], 0) != 0)
                return false;
 
        *freq = vht_freq;