diff options
author | Stephen Chu <stephen.chu@synaptics.corp-partner.google.com> | 2024-01-23 13:24:55 +0800 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-03-04 02:12:23 +0000 |
commit | fa99ea8101ce034078627878ec4f0666442115c5 (patch) | |
tree | 0b7ea43b4dcfe9ba0eb9595e10de725c87e9e02a | |
parent | cd914ded4bd3f41b3533a345c1e0e6f2b84d0df7 (diff) | |
download | dhd43752p-android-gs-bluejay-5.10-android15-beta.tar.gz |
DHD: Skip country on AP/GO, NDP casesandroid-u-qpr3-beta-2.1_r0.4android-15-beta-1_r0.6android-15-beta-1_r0.4android-15-beta-1_r0.2android-15-beta-1_r0.1android-gs-tangorpro-5.10-android15-dpandroid-gs-tangorpro-5.10-android15-betaandroid-gs-pantah-5.10-android15-dpandroid-gs-pantah-5.10-android15-betaandroid-gs-pantah-5.10-android14-qpr3-betaandroid-gs-felix-5.10-android15-dpandroid-gs-felix-5.10-android15-betaandroid-gs-bluejay-5.10-android15-dpandroid-gs-bluejay-5.10-android15-beta
Bug: 317174880
Test: T6pro country code set correctly
Change-Id: Ic7eef1d5951c8d27506fd7b7e30af629f90bd45d
Signed-off-by: Stephen Chu <stephen.chu@synaptics.corp-partner.google.com>
-rw-r--r-- | wl_cfg80211.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/wl_cfg80211.c b/wl_cfg80211.c index c321bba..92940b9 100644 --- a/wl_cfg80211.c +++ b/wl_cfg80211.c @@ -10969,6 +10969,35 @@ s32 wl_mode_to_nl80211_iftype(s32 mode) } static bool +wl_is_ccode_change_allowed(struct net_device *net) +{ + struct wireless_dev *wdev = ndev_to_wdev(net); + struct wiphy *wiphy = wdev->wiphy; + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + struct net_info *iter, *next; + + /* Country code isn't allowed change on AP/GO, NDP established */ + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); + for_each_ndev(cfg, iter, next) { + GCC_DIAGNOSTIC_POP(); + if (iter->ndev) { + if (wl_get_drv_status(cfg, AP_CREATED, iter->ndev)) { + WL_ERR(("AP active. skip country ccode change")); + return false; + } + } + } + +#ifdef WL_NAN + if (wl_cfgnan_is_enabled(cfg) && wl_cfgnan_is_dp_active(net)) { + WL_ERR(("NDP established. skip country ccode change")); + return false; + } +#endif /* WL_NAN */ + return true; +} + +static bool wl_is_ccode_change_required(struct net_device *net, char *country_code, int revinfo) { @@ -11215,6 +11244,12 @@ wl_cfg80211_set_country_code(struct net_device *net, char *country_code, goto exit; } + if (wl_is_ccode_change_allowed(net) == false) { + WL_ERR(("country code change isn't allowed during AP role/NAN connected\n")); + ret = BCME_EPERM; + goto exit; + } + #ifdef WL_AUTO_COUNTRY ret = wl_config_autocountry(cfg, net, country_code); #endif /* WL_AUTO_COUNTRY */ |