diff options
| author | Felix Fietkau <nbd@nbd.name> | 2023-09-01 20:39:15 +0200 |
|---|---|---|
| committer | Felix Fietkau <nbd@nbd.name> | 2023-09-02 19:39:24 +0200 |
| commit | b460ec66ed04bfac85cf25200d15b4d39e8afcf1 (patch) | |
| tree | 277ea763f4b20876ad26f135fdd8e531177d90bf /package/network | |
| parent | 02214ab8dce59ee6b599f8dfdacb0297dc5dcc24 (diff) | |
| download | upstream-b460ec66ed04bfac85cf25200d15b4d39e8afcf1.tar.gz upstream-b460ec66ed04bfac85cf25200d15b4d39e8afcf1.tar.bz2 upstream-b460ec66ed04bfac85cf25200d15b4d39e8afcf1.zip | |
hostapd: use proper helper functions for setting seg0/seg1 idx and chwidth
Simplifies code and removes #ifdef statements
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network')
| -rw-r--r-- | package/network/services/hostapd/src/src/ap/ucode.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 080fe48b11a..33160561d4d 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -333,36 +333,13 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs) conf->channel = intval; if ((intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL))) && !errno) conf->secondary_channel = intval; -#ifdef CONFIG_IEEE80211AC - if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL))) && !errno) { - conf->vht_oper_centr_freq_seg0_idx = intval; -#ifdef CONFIG_IEEE80211AX - conf->he_oper_centr_freq_seg0_idx = intval; -#endif -#ifdef CONFIG_IEEE80211BE - conf->eht_oper_centr_freq_seg0_idx = intval; -#endif - } - if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg1_idx", NULL))) && !errno) { - conf->vht_oper_centr_freq_seg1_idx = intval; -#ifdef CONFIG_IEEE80211AX - conf->he_oper_centr_freq_seg1_idx = intval; -#endif -#ifdef CONFIG_IEEE80211BE - conf->eht_oper_centr_freq_seg1_idx = intval; -#endif - } + if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL))) && !errno) + hostapd_set_oper_centr_freq_seg0_idx(conf, intval); + if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg1_idx", NULL))) && !errno) + hostapd_set_oper_centr_freq_seg1_idx(conf, intval); intval = ucv_int64_get(ucv_object_get(info, "oper_chwidth", NULL)); - if (!errno) { - conf->vht_oper_chwidth = intval; -#ifdef CONFIG_IEEE80211AX - conf->he_oper_chwidth = intval; -#endif -#ifdef CONFIG_IEEE80211BE - conf->eht_oper_chwidth = intval; -#endif - } -#endif + if (!errno) + hostapd_set_oper_chwidth(conf, intval); out: if (conf->channel) |
