@@ -4501,6 +4501,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
PARSE_TEST_PROBABILITY(corrupt_gtk_rekey_mic_probability)
} else if (os_strcmp(buf, "ecsa_ie_only") == 0) {
conf->ecsa_ie_only = atoi(pos);
+ } else if (os_strcmp(buf, "csa_ie_only") == 0) {
+ conf->csa_ie_only = atoi(pos);
} else if (os_strcmp(buf, "bss_load_test") == 0) {
WPA_PUT_LE16(bss->bss_load_test, atoi(pos));
pos = os_strchr(pos, ':');
@@ -3340,6 +3340,10 @@ own_ip_addr=127.0.0.1
# (channel switch operating class is needed)
#ecsa_ie_only=0
#
+# Include only CSA IE without ECSA IE
+# (the operating class is not mentioned)
+#csa_ie_only=0
+
# Delay EAPOL-Key messages 1/4 and 3/4 by not sending the frame until the last
# attempt (wpa_pairwise_update_count). This will trigger a timeout on all
# previous attempts and thus delays the frame. (testing only)
@@ -1153,6 +1153,7 @@ struct hostapd_config {
double ignore_reassoc_probability;
double corrupt_gtk_rekey_mic_probability;
int ecsa_ie_only;
+ int csa_ie_only;
bool delay_eapol_tx;
#endif /* CONFIG_TESTING_OPTIONS */
@@ -516,6 +516,11 @@ static u8 * hostapd_eid_ecsa(struct hostapd_data *hapd, u8 *eid)
if (!hapd->cs_freq_params.channel || !hapd->iface->cs_oper_class)
return eid;
+#ifdef CONFIG_TESTING_OPTIONS
+ if (hapd->iconf->csa_ie_only)
+ return eid;
+#endif /* CONFIG_TESTING_OPTIONS */
+
*eid++ = WLAN_EID_EXT_CHANSWITCH_ANN;
*eid++ = 4;
*eid++ = hapd->cs_block_tx;
@@ -172,6 +172,17 @@ def test_ap_csa_ecsa_only(dev, apdev):
wait_channel_switch(dev[0], 2462)
hwsim_utils.test_connectivity(dev[0], ap)
+@remote_compatible
+def test_ap_csa_csa_only(dev, apdev):
+ """AP Channel Switch, one switch with only CSA IE"""
+ csa_supported(dev[0])
+ ap = connect(dev[0], apdev, csa_ie_only="1")
+
+ hwsim_utils.test_connectivity(dev[0], ap)
+ switch_channel(ap, 10, 2462, extra="ht")
+ wait_channel_switch(dev[0], 2462)
+ hwsim_utils.test_connectivity(dev[0], ap)
+
@remote_compatible
def test_ap_csa_invalid(dev, apdev):
"""AP Channel Switch - invalid channel"""