Browse Source

qcacld-3.0: Check dot11Mode before set 11be_capab

If host ini gDot11Mode set to lower dot11mode which doesn't
support 802.11be, override the target en_11be flag to false.

Change-Id: If11928f2a662e45ff310ae9bbd3866dbc1ed4b7d
CRs-Fixed: 3319707
Liangwei Dong 2 years ago
parent
commit
a6a40dcccd
1 changed files with 24 additions and 0 deletions
  1. 24 0
      core/hdd/src/wlan_hdd_main.c

+ 24 - 0
core/hdd/src/wlan_hdd_main.c

@@ -1550,6 +1550,23 @@ hdd_set_dynamic_macaddr_update_capability(struct hdd_context *hdd_ctx,
 }
 #endif
 
+#ifdef WLAN_FEATURE_11BE
+static bool hdd_dot11Mode_support_11be(enum hdd_dot11_mode dot11Mode)
+{
+	if (dot11Mode != eHDD_DOT11_MODE_AUTO &&
+	    dot11Mode < eHDD_DOT11_MODE_11be)
+		return false;
+
+	return true;
+}
+#else
+static bool hdd_dot11Mode_support_11be(enum hdd_dot11_mode dot11Mode)
+{
+	return false;
+}
+#endif
+
+
 static void hdd_update_tgt_services(struct hdd_context *hdd_ctx,
 				    struct wma_tgt_services *cfg)
 {
@@ -1576,6 +1593,13 @@ static void hdd_update_tgt_services(struct hdd_context *hdd_ctx,
 	if ((config->dot11Mode == eHDD_DOT11_MODE_11ac ||
 	     config->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) && !cfg->en_11ac)
 		config->dot11Mode = eHDD_DOT11_MODE_AUTO;
+	/* 11BE mode support */
+	if (!hdd_dot11Mode_support_11be(config->dot11Mode) &&
+	    cfg->en_11be) {
+		hdd_debug("dot11Mode %d override target en_11be to false",
+			  config->dot11Mode);
+		cfg->en_11be = false;
+	}
 
 	/* ARP offload: override user setting if invalid  */
 	arp_offload_enable =