diff options
author | Juho Ha <juhoha@google.com> | 2018-02-28 19:37:47 +0900 |
---|---|---|
committer | Terry (Woncheol) Heo <terryheo@google.com> | 2018-02-28 14:04:39 +0000 |
commit | 5c11b46b255d1278f3b1a53f6ab7770ccfb9dfd5 (patch) | |
tree | fbca2fffd1a08b8842be5fac3da6331766dbe44e | |
parent | a836b2d10357a016747f606cf4a8a04ab4d359f2 (diff) | |
download | imx-v4.9-o-mr1-iot-preview-7.tar.gz |
Set wifi country code from kernel command lineandroid-o-mr1-iot-preview-7o-mr1-iot-preview-7
Introduce two kernel cmdline args bcmdhd.wl_country_para
and bcmdhd.wl_country_rev.
Default value are 'US' and 140.
Bug: 70135717, Bug: 69175538
Test: connect to wifi network using 5500MHz band
Change-Id: I430b5ea7d401882ab8c97983df9e22665369a5c5
Signed-off-by:Tian Yang <yang.tian@nxp.com>
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_linux.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c index 98552808e89e..652765ce3e0f 100644 --- a/drivers/net/wireless/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/bcmdhd/dhd_linux.c @@ -10540,6 +10540,17 @@ exit: } #endif /* WLADPS || WLADPS_PRIVATE_CMD */ + /* Usage: passing 'bcmdhd.wl_country_para=$CUSTOMIZED_COUNTRY bcmdhd.wl_country_rev=$CUSTOMIZED_REV' + * from kernel command line */ + static char wl_country_para[WLC_CNTRY_BUF_SZ] = {'U', 'S'}; + static int wl_country_rev = 140; + + module_param_string(wl_country_para, wl_country_para, sizeof(wl_country_para), 0644); + MODULE_PARM_DESC(wl_country_para,"String of country_para:VALUE for country code."); + + module_param(wl_country_rev, int, 0644); + MODULE_PARM_DESC(wl_country_rev,"String of country_para:VALUE for country code rev."); + int dhd_preinit_ioctls(dhd_pub_t *dhd) { @@ -10985,6 +10996,9 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) dhd->info->rxthread_enabled = TRUE; #endif /* Set Country code */ + strcpy(dhd->conf->cspec.ccode, wl_country_para); + dhd->conf->cspec.rev = wl_country_rev; + if (dhd->dhd_cspec.ccode[0] != 0) { printf("Set country %s, revision %d\n", dhd->dhd_cspec.ccode, dhd->dhd_cspec.rev); ret = dhd_iovar(dhd, 0, "country", (char *)&dhd->dhd_cspec, sizeof(wl_country_t), |