diff --git a/Makefile b/Makefile index 549f892..a6e4d80 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,7 @@ CONFIG_IP_R_MONITOR = n #arp VOQ and high rate CONFIG_RTW_UP_MAPPING_RULE = tos # Enable VHT rate on 2.4G channel or not CONFIG_RTW_VHT_2G4 = y +CONFIG_RTW_IOCTL_SET_COUNTRY = y ########################## Debug ########################### CONFIG_RTW_DEBUG = y @@ -1294,6 +1295,10 @@ else EXTRA_CFLAGS += -DRTW_VHT_2G4=0 endif +ifeq ($(CONFIG_RTW_IOCTL_SET_COUNTRY), y) +EXTRA_CFLAGS += -DCONFIG_RTW_IOCTL_SET_COUNTRY +endif + ifeq ($(CONFIG_PLATFORM_I386_PC), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT diff --git a/core/rtw_chplan.c b/core/rtw_chplan.c index 5895d6b..5d7754f 100644 --- a/core/rtw_chplan.c +++ b/core/rtw_chplan.c @@ -877,6 +877,7 @@ exit: #endif /* CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP or RTW_DEF_MODULE_REGULATORY_CERT */ static const struct country_chplan country_chplan_map[] = { + COUNTRY_CHPLAN_ENT("00", 0x7F, 1, 0x000), /* Unspecified */ COUNTRY_CHPLAN_ENT("AD", 0x26, 1, 0x000), /* Andorra */ COUNTRY_CHPLAN_ENT("AE", 0x35, 1, 0xFFB), /* United Arab Emirates */ COUNTRY_CHPLAN_ENT("AF", 0x42, 1, 0x000), /* Afghanistan */ diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index ec37eec..26c0fb6 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -2328,9 +2328,9 @@ inline u8 rtw_set_chplan_cmd(_adapter *adapter, int flags, u8 chplan, u8 swconfi inline u8 rtw_set_country_cmd(_adapter *adapter, int flags, const char *country_code, u8 swconfig) { const struct country_chplan *ent; - - if (is_alpha(country_code[0]) == _FALSE - || is_alpha(country_code[1]) == _FALSE + if ((is_alpha(country_code[0]) == _FALSE + || is_alpha(country_code[1]) == _FALSE) + && (strncmp(country_code, "00", 2) != 0) ) { RTW_PRINT("%s input country_code is not alpha2\n", __func__); return _FAIL;