HE: Add support to configure operating mode control support
This adds support for sta_set_wireless OMControl argument.
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
diff --git a/sta.c b/sta.c
index f943a87..4eb0dad 100644
--- a/sta.c
+++ b/sta.c
@@ -6025,6 +6025,56 @@
}
+static int sta_set_om_ctrl_supp(struct sigma_dut *dut, const char *intf,
+ int val)
+{
+#ifdef NL80211_SUPPORT
+ struct nl_msg *msg;
+ int ret = 0;
+ struct nlattr *params;
+ int ifindex;
+
+ ifindex = if_nametoindex(intf);
+ if (ifindex == 0) {
+ sigma_dut_print(dut, DUT_MSG_ERROR,
+ "%s: Index for interface %s failed, val:%d",
+ __func__, intf, val);
+ return -1;
+ }
+
+ if (!(msg = nl80211_drv_msg(dut, dut->nl_ctx, ifindex, 0,
+ NL80211_CMD_VENDOR)) ||
+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, ifindex) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_QCA) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
+ QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION) ||
+ !(params = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
+ nla_put_u8(msg,
+ QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_OM_CTRL_SUPP,
+ val)) {
+ sigma_dut_print(dut, DUT_MSG_ERROR,
+ "%s: err in adding vendor_cmd and vendor_data, val: %d",
+ __func__, val);
+ nlmsg_free(msg);
+ return -1;
+ }
+ nla_nest_end(msg, params);
+
+ ret = send_and_recv_msgs(dut, dut->nl_ctx, msg, NULL, NULL);
+ if (ret) {
+ sigma_dut_print(dut, DUT_MSG_ERROR,
+ "%s: err in send_and_recv_msgs, ret=%d, val=%d",
+ __func__, ret, val);
+ }
+ return ret;
+#else /* NL80211_SUPPORT */
+ sigma_dut_print(dut, DUT_MSG_ERROR,
+ "HE OM ctrl cannot be changed without NL80211_SUPPORT defined");
+ return -1;
+#endif /* NL80211_SUPPORT */
+}
+
+
static void sta_reset_default_wcn(struct sigma_dut *dut, const char *intf,
const char *type)
{
@@ -6111,6 +6161,11 @@
sigma_dut_print(dut, DUT_MSG_ERROR,
"ErrorCode,Failed to set MU EDCA override disable");
}
+
+ if (sta_set_om_ctrl_supp(dut, intf, 1)) {
+ sigma_dut_print(dut, DUT_MSG_ERROR,
+ "Failed to set OM ctrl supp");
+ }
#endif /* NL80211_SUPPORT */
if (sta_set_tx_beamformee(dut, intf, 1)) {
@@ -7093,6 +7148,22 @@
}
}
+ val = get_param(cmd, "OMControl");
+ if (val) {
+ int set_val = 1;
+
+ if (strcasecmp(val, "Enable") == 0)
+ set_val = 1;
+ else if (strcasecmp(val, "Disable") == 0)
+ set_val = 0;
+
+ if (sta_set_om_ctrl_supp(dut, intf, set_val)) {
+ send_resp(dut, conn, SIGMA_ERROR,
+ "ErrorCode,Failed to set OM ctrl supp");
+ return 0;
+ }
+ }
+
val = get_param(cmd, "ADDBAResp_BufSize");
if (val) {
int buf_size;