Skip to content

airoha: fix seg0 that is zeroed after config reload and does not match new channel

Elena Vengerova requested to merge helen_fix_seg0 into devel

To be honest I'm not sure how all this is intended to work.

hostapd gets the command to update config via ubus or control interface (particularly channel may be updated). centr_freq_seg0 is always lost after such config reload. I see that this code is affected by different patches (for example, 340-reload_freq_change.patch that looks bit strange for me), but result is incorrect - central freq and channel do not match each other.

When I tried to use the code from upstream hostapd, the result was incorrect as well - simple inheriting of the centr_freq_seg0 from the old config does not work if new channel differs from the old one. I do not understand why hostapd does not re-calculate central freq automatically. I really wonder also why this parameter is allowed to be specified in hostapd.conf - cenrtal freq is calculated accurately by width and channel.

So, I've just invented correction for centr_freq_seg0 for the case when new channel is not auto and centr_freq_seg0 is not provided in the new config. Looks working on Kristian's setup for me.

Merge request reports