From b22da3d8526a935aa31e086e63f60ff3246cb61c Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Sat, 09 Dec 2023 07:24:11 +0000
Subject: [PATCH] add stmac read mac form eeprom
---
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wldev_common.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wldev_common.c b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wldev_common.c
old mode 100644
new mode 100755
index 801d332..9cf13d2
--- a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wldev_common.c
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wldev_common.c
@@ -508,16 +508,30 @@
int wldev_set_country(
struct net_device *dev, char *country_code, bool notify, int revinfo)
{
- int error = 0;
#if defined(BCMDONGLEHOST)
- struct dhd_pub *dhd = dhd_get_pub(dev);
+ int error = -1;
+ wl_country_t cspec = {{0}, 0, {0}};
if (!country_code)
- return -1;
- error = dhd_conf_country(dhd, "country", country_code);
- dhd_bus_country_set(dev, &dhd->dhd_cspec, notify);
+ return error;
+
+ cspec.rev = revinfo;
+ strlcpy(cspec.country_abbrev, country_code, WL_CCODE_LEN + 1);
+ strlcpy(cspec.ccode, country_code, WL_CCODE_LEN + 1);
+ error = dhd_conf_map_country_list(dhd_get_pub(dev), &cspec);
+ if (error)
+ dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec);
+ error = dhd_conf_set_country(dhd_get_pub(dev), &cspec);
+ if (error < 0) {
+ WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n",
+ __FUNCTION__, country_code, cspec.ccode, cspec.rev));
+ return error;
+ }
+ dhd_conf_fix_country(dhd_get_pub(dev));
+ dhd_conf_get_country(dhd_get_pub(dev), &cspec);
+ dhd_bus_country_set(dev, &cspec, notify);
printf("%s: set country for %s as %s rev %d\n",
- __FUNCTION__, country_code, dhd->dhd_cspec.ccode, dhd->dhd_cspec.rev);
+ __FUNCTION__, country_code, cspec.ccode, cspec.rev);
#endif /* defined(BCMDONGLEHOST) */
- return error;
+ return 0;
}
--
Gitblit v1.6.2