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>
This commit is contained in:
Abhinav Kulkarni 2025-06-18 12:58:18 +05:30 committed by Fabio Baltieri
commit 5321b1b70b
2 changed files with 25 additions and 1 deletions

View file

@ -596,4 +596,25 @@ config WIFI_NM_WPA_CTRL_RESP_TIMEOUT_S
Timeout for the control interface commands to get a response from the Timeout for the control interface commands to get a response from the
supplicant. supplicant.
config WIFI_NM_HOSTAPD_REGULATORY_REGION
string "Select Wi-Fi Regulatory Domain"
default "00"
depends on WIFI_NM_HOSTAPD_AP
help
Region/Country code (ISO/IEC 3166-1).Used to set regulatory domain.
Set as needed to indicate country in which device is operating.
This can limit available channels and transmit power.
These two octets are used as the first two octets of the Country String
(dot11CountryString). "00" stands for World Wide mode.
config WIFI_NM_HOSTAPD_REGULATORY_ENV
int "Select Wi-Fi Regulatory Environment"
default 32
depends on WIFI_NM_HOSTAPD_AP
help
The third octet of the Country String (dot11CountryString)
This parameter is used to set the third octet of the country string.
All supported environments of current region can be used with
default value of 0x20 or 32.
endif # WIFI_NM_WPA_SUPPLICANT endif # WIFI_NM_WPA_SUPPLICANT

View file

@ -351,7 +351,10 @@ struct hostapd_config *hostapd_config_read2(const char *fname)
bss->logger_stdout_level = HOSTAPD_LEVEL_INFO; bss->logger_stdout_level = HOSTAPD_LEVEL_INFO;
bss->logger_stdout = 0xffff; bss->logger_stdout = 0xffff;
bss->nas_identifier = os_strdup("ap.example.com"); bss->nas_identifier = os_strdup("ap.example.com");
os_memcpy(conf->country, "US ", 3); /* Set regulatory domain */
os_memcpy(conf->country, CONFIG_WIFI_NM_HOSTAPD_REGULATORY_REGION, 2);
/* Set regulatory environment */
conf->country[2] = CONFIG_WIFI_NM_HOSTAPD_REGULATORY_ENV;
conf->hw_mode = HOSTAPD_MODE_IEEE80211G; conf->hw_mode = HOSTAPD_MODE_IEEE80211G;
bss->wps_state = WPS_STATE_CONFIGURED; bss->wps_state = WPS_STATE_CONFIGURED;
bss->eap_server = 1; bss->eap_server = 1;