Re: [PATCH v2 6/9] brcm80211: smac: enable/disable radio on regulatory updates
From: Arend van Spriel <hidden>
Date: 2012-06-13 09:29:03
On 06/05/2012 04:34 PM, Seth Forshee wrote:
quoted hunk ↗ jump to hunk
Currently the radio disable state is only updated during initialization, and it's only checked against the internal world domain. This is unnecessary, as there are always valid channels against this domain. Instead, check whether any channels are enabled in the regulatory notifier and update the radio state accordingly. Reviewed-by: Arend Van Spriel <redacted> Reviewed-by: Pieter-Paul Giesberts <redacted> Signed-off-by: Seth Forshee <redacted> --- drivers/net/wireless/brcm80211/brcmsmac/channel.c | 67 ++++++++------------- 1 file changed, 26 insertions(+), 41 deletions(-)diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c index 65ef60b..7182b58 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c@@ -1235,12 +1194,38 @@ static int brcms_reg_notifier(struct wiphy *wiphy, + + if (likely(ch_found)) { + mboolclr(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE); + } else { + mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE); + wiphy_err(wlc->wiphy, "wl%d: %s: no valid channel for \"%s\"\n", + wlc->pub->unit, __func__, request->alpha2); + } +
When we were having fun in staging GregKH indicated that use of likely() should be justified with profiling data. Probably not really needed here. Gr. AvS