As an aside, the alternative would be to simply not ignore any
attempts to set the regulatory domain, regardless of whether it's 00
or the chip is already set to that country.
It doesn't happen that often, so it's not clear it's worth avoiding it at all.
There are some things i'd have to fix to make it work resiliently well
(for example, i know we set the 2g bw cap where we do because it has
to be done with the interface down), but i can fix those if needed.
On Thu, Oct 19, 2023 at 10:18 AM Daniel Berlin <dberlin@xxxxxxxxxxx> wrote:
Currently, we ignore the default country in the reg notifier.
We also register a custom regulatory domain, which is set
as the default.
As a result, the chip is likely to be set to the correct country,
but the regulatory domain will not match it.
When the regulatory notifier is then called, we see the countries
are the same and do not change anything, even though the domain
is wrong.
This patch forces us to reset the bands on the first country change
even if the chip is already set to that country.
We also restore the original band info before reconstructing channel
info, as the new regdom power limits may be higher than what is
currently set.
Signed-off-by: Daniel Berlin <dberlin@xxxxxxxxxxx>
---
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 38 +++++++++++++++----
.../broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +
2 files changed, 33 insertions(+), 7 deletions(-)
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature