sta_set_wireless: Configuration support for BSS max idle period

Add configuration support for BSS max idle period to advertise
in (Re)Association Request frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
diff --git a/sta.c b/sta.c
index 488403e..b1e8bc0 100644
--- a/sta.c
+++ b/sta.c
@@ -7360,6 +7360,21 @@
 }
 
 
+static int sta_set_bss_max_idle_period(struct sigma_dut *dut, const char *intf,
+				       int val)
+{
+#ifdef NL80211_SUPPORT
+	return wcn_wifi_test_config_set_u16(
+		dut, intf,
+		QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_BSS_MAX_IDLE_PERIOD, val);
+#else /* NL80211_SUPPORT */
+	sigma_dut_print(dut, DUT_MSG_ERROR,
+			"BSS max idle period cannot be set without NL80211_SUPPORT defined");
+	return -1;
+#endif /* NL80211_SUPPORT */
+}
+
+
 static int sta_set_fullbw_ulmumimo(struct sigma_dut *dut, const char *intf,
 				   int val)
 {
@@ -7494,6 +7509,11 @@
 					"Failed to set OM ctrl supp");
 		}
 
+		if (sta_set_bss_max_idle_period(dut, intf, 0)) {
+			sigma_dut_print(dut, DUT_MSG_ERROR,
+				  "Failed to reset BSS max idle period");
+		}
+
 		if (sta_set_tx_su_ppdu_cfg(dut, intf, 1)) {
 			sigma_dut_print(dut, DUT_MSG_ERROR,
 					"Failed to set Tx SU PPDU enable");
@@ -9171,6 +9191,13 @@
 		}
 	}
 
+	val = get_param(cmd, "BSSMaxIdlePeriod");
+	if (val && sta_set_bss_max_idle_period(dut, intf, atoi(val))) {
+		send_resp(dut, conn, SIGMA_ERROR,
+			  "ErrorCode,Failed to set BSS max idle period");
+		return STATUS_SENT_ERROR;
+	}
+
 	val = get_param(cmd, "ADDBAResp_BufSize");
 	if (val) {
 		int buf_size;