> > But just setting orig_flags also won't work, since it'd be > > overwritten again by wiphy_register(), no? > > I told you I successfully tested it, didn't I? Well, I quickly > checked wiphy_register and couldn't understand how it was possible it > worked for me... I guess I didn't believe it ;-) > OK, so after some debugging I understood why I got this working. It's > the way brcmfmac handles channels. > > At the beginning all channels are disabled: see __wl_2ghz_channels & > __wl_5ghz_channels. They have IEEE80211_CHAN_DISABLED set in "flags" > for every channel. > > In early phase brcmfmac calls wiphy_read_of_freq_limits which sets > IEEE80211_CHAN_DISABLED in "orig_flags" for unavailable channels. > > Then brcmf_construct_chaninfo kicks in. Normally it removes > IEEE80211_CHAN_DISABLED from "flags" for most of channels, but it > doesn't happen anymore due to my change: > if (channel->orig_flags & IEEE80211_CHAN_DISABLED) > continue; > > Then brcmfmac calls wiphy_apply_custom_regulatory which sets some > bits like IEEE80211_CHAN_NO_80MHZ and IEEE80211_CHAN_NO_160MHZ in > "flags". > > Finally wiphy_register is called which copies "flags" to > "original_flags". As brcmfmac /respected/ IEEE80211_CHAN_DISABLED set > in orig_flags, it also left IEEE80211_CHAN_DISABLED in flags. This > way I got IEEE80211_CHAN_DISABLED in orig_flags after overwriting > that field inside wiphy_register. > > That's quite crazy, right? Yeah, that was pretty crazy. > I guess you're right after all, I should set IEEE80211_CHAN_DISABLED > in "flags" field, let wiphy_register copy that to "orig_flags" and > sanitize brcmfmac. Makes sense to me. That would also match the way it works when no custom regulatory notifier is used, which makes the OF function more widely applicable. Thanks, johannes -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html