diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-08-11 15:41:45 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-08-11 15:43:43 +0200 |
commit | c5988f4c01ff2e74a9588507b621d0ea5986cabe (patch) | |
tree | fbc8c8996b1fd450ed4d851f9ab9609024de9056 | |
parent | ced285487144e1138e3d2b986b3e070a9b4fd412 (diff) |
hostapd: fix center frequency calculation for channel 149 and above
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | package/network/services/hostapd/src/src/utils/ucode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/package/network/services/hostapd/src/src/utils/ucode.c b/package/network/services/hostapd/src/src/utils/ucode.c index dba261e41a..b9e7d871c7 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -119,7 +119,12 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs) if (!sec_channel) return ret; - center_ofs = freq_val >= 5900 ? 0 : 3; + if (freq_val >= 5900) + center_ofs = 0; + else if (freq_val >= 5745) + center_ofs = 20; + else + center_ofs = 35; tmp_channel = channel - center_ofs; tmp_channel &= ~((8 << width) - 1); center_idx = tmp_channel + center_ofs + (4 << width) - 1; |