[WCNCR00167017] p2p: Fix overriding flags in 2g/5g ieee80211_channel
[Description]
If 00(Worldwide)'s channel 149~165 has PASSIVE-SCAN flags, after change to
another country, the country also has PASSIVE-SCAN flags instead of the
country's setting in db.txt.
The issue flow:
1. Register wlan wiphy (wiphy_register()@core.c)
chan->orig_flags
= chan->flags
= 0
2. Apply WW regdomain (handle_channel()@reg.c):
chan->flags
= chan->orig_flags|reg_channel_flags
= 0 |WW_channel_flags
3. Register p2p wiphy:
chan->orig_flags
= chan->flags
= WW channel flags
4. Apply US regdomain:
chan->flags
= chan->orig_flags|reg_channel_flags
= WW_channel_flags|US_channel_flags (includes WW flags)
When module inserted, both wlan/p2p register wiphy in sequence.
Wlan/p2p use the same 2g/5g ieee80211_channel, its flags are empty.
After wlan is registered, kernel updates the flags as WW.
Then p2p uses the WW flags to register instead of using empty flags,
and changes chan->orig_flags.
It makes kernel believe driver's default flags is WW instead of 0,
when country is changed to US, both WW and US flags are applied.
[Solution]
Clear flags before p2p registers wiphy in flow 3.
CR-Id: WCNCR00167017
Feature: p2p
Signed-off-by: ZD Hu <zd.hu@mediatek.com>
1 file changed