aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnkita Bajaj <bankita@codeaurora.org>2019-05-30 14:14:55 (GMT)
committerJouni Malinen <jouni@codeaurora.org>2019-06-14 20:10:51 (GMT)
commitef59f987296251f7209313cc28fd10df4e3b307f (patch)
tree335580273293becd85f9fc731625846388aafb3a
parent4068d683f549be2b480592215b967b107b8adaf8 (diff)
downloadhostap-ef59f987296251f7209313cc28fd10df4e3b307f.zip
hostap-ef59f987296251f7209313cc28fd10df4e3b307f.tar.gz
hostap-ef59f987296251f7209313cc28fd10df4e3b307f.tar.bz2
WNM: Provide option to disable/enable BTM support in STA
Add support to disable/enable BTM support using configuration and wpa_cli command. This is useful mainly for testing purposes. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--wpa_supplicant/config.c3
-rw-r--r--wpa_supplicant/config.h10
-rw-r--r--wpa_supplicant/config_file.c2
-rw-r--r--wpa_supplicant/wnm_sta.c3
-rw-r--r--wpa_supplicant/wpa_supplicant.c6
-rw-r--r--wpa_supplicant/wpa_supplicant.conf6
6 files changed, 29 insertions, 1 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index e7cba48..7a62f96 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -4869,6 +4869,9 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(gas_rand_mac_addr, 0, 2), 0 },
{ INT_RANGE(dpp_config_processing, 0, 2), 0 },
{ INT_RANGE(coloc_intf_reporting, 0, 1), 0 },
+#ifdef CONFIG_WNM
+ { INT_RANGE(disable_btm, 0, 1), CFG_CHANGED_DISABLE_BTM },
+#endif /* CONFIG_WNM */
};
#undef FUNC
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index abbd8c9..6a297ec 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -374,6 +374,7 @@ struct wpa_cred {
#define CFG_CHANGED_P2P_PASSPHRASE_LEN BIT(16)
#define CFG_CHANGED_SCHED_SCAN_PLANS BIT(17)
#define CFG_CHANGED_WOWLAN_TRIGGERS BIT(18)
+#define CFG_CHANGED_DISABLE_BTM BIT(19)
/**
* struct wpa_config - wpa_supplicant configuration data
@@ -1527,6 +1528,15 @@ struct wpa_config {
* By default, permanent MAC address is used.
*/
int p2p_interface_random_mac_addr;
+
+ /**
+ * disable_btm - Disable BSS transition management in STA
+ * - Set to 0 to enable BSS transition management
+ * - Set to 1 to disable BSS transition management
+ *
+ * By default BSS transition management is enabled
+ */
+ int disable_btm;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index fe5a011..77c326d 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1545,6 +1545,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->p2p_interface_random_mac_addr)
fprintf(f, "p2p_interface_random_mac_addr=%d\n",
config->p2p_interface_random_mac_addr);
+ if (config->disable_btm)
+ fprintf(f, "disable_btm=1\n");
}
#endif /* CONFIG_NO_CONFIG_WRITE */
diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
index f5a4cb7..c147649 100644
--- a/wpa_supplicant/wnm_sta.c
+++ b/wpa_supplicant/wnm_sta.c
@@ -1371,6 +1371,9 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
const u8 *vendor;
#endif /* CONFIG_MBO */
+ if (wpa_s->conf->disable_btm)
+ return;
+
if (end - pos < 5)
return;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index f82d18f..2002b12 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1711,7 +1711,8 @@ static void wpas_ext_capab_byte(struct wpa_supplicant *wpa_s, u8 *pos, int idx)
case 2: /* Bits 16-23 */
#ifdef CONFIG_WNM
*pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */
- *pos |= 0x08; /* Bit 19 - BSS Transition */
+ if (!wpa_s->conf->disable_btm)
+ *pos |= 0x08; /* Bit 19 - BSS Transition */
#endif /* CONFIG_WNM */
break;
case 3: /* Bits 24-31 */
@@ -6630,6 +6631,9 @@ void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s)
wpa_s->conf->wowlan_triggers);
}
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_DISABLE_BTM)
+ wpa_supplicant_set_default_scan_ies(wpa_s);
+
#ifdef CONFIG_WPS
wpas_wps_update_config(wpa_s);
#endif /* CONFIG_WPS */
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 842a8db..1159bdc 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -1516,6 +1516,12 @@ fast_reauth=1
# Transitioning between states).
#fst_llt=100
+# BSS Transition Management
+# disable_btm - Disable BSS transition management in STA
+# Set to 0 to enable BSS transition management (default behavior)
+# Set to 1 to disable BSS transition management
+#disable_btm=0
+
# Example blocks:
# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers