Skip to content

Commit 5321b1b

Browse files
abhinavnxpfabiobaltieri
authored andcommitted
modules: hostap: Updated reg domain details
Added kconfig for regulatory domain in hostapd. Default is set to 00 as World Wide mode. Also added 3rd octet kconfig to set regulatory environment and set it to 32 for all supported environments. Signed-off-by: Abhinav Kulkarni <abhinav.kulkarni@nxp.com>
1 parent 4b3cd02 commit 5321b1b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

modules/hostap/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,4 +596,25 @@ config WIFI_NM_WPA_CTRL_RESP_TIMEOUT_S
596596
Timeout for the control interface commands to get a response from the
597597
supplicant.
598598

599+
config WIFI_NM_HOSTAPD_REGULATORY_REGION
600+
string "Select Wi-Fi Regulatory Domain"
601+
default "00"
602+
depends on WIFI_NM_HOSTAPD_AP
603+
help
604+
Region/Country code (ISO/IEC 3166-1).Used to set regulatory domain.
605+
Set as needed to indicate country in which device is operating.
606+
This can limit available channels and transmit power.
607+
These two octets are used as the first two octets of the Country String
608+
(dot11CountryString). "00" stands for World Wide mode.
609+
610+
config WIFI_NM_HOSTAPD_REGULATORY_ENV
611+
int "Select Wi-Fi Regulatory Environment"
612+
default 32
613+
depends on WIFI_NM_HOSTAPD_AP
614+
help
615+
The third octet of the Country String (dot11CountryString)
616+
This parameter is used to set the third octet of the country string.
617+
All supported environments of current region can be used with
618+
default value of 0x20 or 32.
619+
599620
endif # WIFI_NM_WPA_SUPPLICANT

modules/hostap/src/hapd_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,10 @@ struct hostapd_config *hostapd_config_read2(const char *fname)
351351
bss->logger_stdout_level = HOSTAPD_LEVEL_INFO;
352352
bss->logger_stdout = 0xffff;
353353
bss->nas_identifier = os_strdup("ap.example.com");
354-
os_memcpy(conf->country, "US ", 3);
354+
/* Set regulatory domain */
355+
os_memcpy(conf->country, CONFIG_WIFI_NM_HOSTAPD_REGULATORY_REGION, 2);
356+
/* Set regulatory environment */
357+
conf->country[2] = CONFIG_WIFI_NM_HOSTAPD_REGULATORY_ENV;
355358
conf->hw_mode = HOSTAPD_MODE_IEEE80211G;
356359
bss->wps_state = WPS_STATE_CONFIGURED;
357360
bss->eap_server = 1;

0 commit comments

Comments
 (0)