Browse Source

qcacld-3.0: Check band capability as well to decide wifi standard

Currently host does not consider band capability when it decides
supported wifi standard info. This results in incorrect supported
wifi standard info. For example if dot11 mode ini is set to auto
and 6 GHz is disabled from band capability and if host does not
support 11BE, in this case if host does not consider band
capability it reports supported wifi standard as wifi 6E, but
ideally it should not report wifi 6E as it wifi 6E mandates
6 GHz support.

To address above issue, consider band capability as well to
decide supported wifi standard.

Change-Id: Iae7804a73d8ba36ec855fdc4c00ca3106e43b350
CRs-Fixed: 3282169
Ashish Kumar Dhanotiya 2 years ago
parent
commit
598a31450c
4 changed files with 53 additions and 20 deletions
  1. 37 13
      core/hdd/src/wlan_hdd_main.c
  2. 12 0
      core/sme/inc/sme_api.h
  3. 1 6
      core/sme/src/common/sme_api.c
  4. 3 1
      core/wma/src/wma_main.c

+ 37 - 13
core/hdd/src/wlan_hdd_main.c

@@ -12978,11 +12978,27 @@ static bool hdd_is_cfg_dot11_mode_11be(enum hdd_dot11_mode dot11_mode)
 	return (dot11_mode == eHDD_DOT11_MODE_11be ||
 		dot11_mode == eHDD_DOT11_MODE_11be_ONLY);
 }
+
+/**
+ * hdd_is_host_11be_supported() - Check if 11 be is supported or not
+ *
+ * Return: True, if 11be is supported else return false
+ */
+static bool hdd_is_11be_supported(void)
+{
+	return true;
+}
 #else
+
 static bool hdd_is_cfg_dot11_mode_11be(enum hdd_dot11_mode dot11_mode)
 {
 	return false;
 }
+
+static bool hdd_is_11be_supported(void)
+{
+	return false;
+}
 #endif
 
 /**
@@ -12991,25 +13007,30 @@ static bool hdd_is_cfg_dot11_mode_11be(enum hdd_dot11_mode dot11_mode)
  *
  * Return: WMI_HOST_WIFI_STANDARD
  */
-static WMI_HOST_WIFI_STANDARD hdd_get_wifi_standard(struct hdd_context *hdd_ctx)
+static WMI_HOST_WIFI_STANDARD hdd_get_wifi_standard(struct hdd_context *hdd_ctx,
+						    uint32_t band_capability)
 {
 	WMI_HOST_WIFI_STANDARD wifi_standard = WMI_HOST_WIFI_STANDARD_4;
 
-	if (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_AUTO ||
-	    hdd_is_cfg_dot11_mode_11be(hdd_ctx->config->dot11Mode))
+	if (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_AUTO) {
+		if (hdd_is_11be_supported())
+			wifi_standard = WMI_HOST_WIFI_STANDARD_7;
+		else if (band_capability & BIT(REG_BAND_6G))
+			wifi_standard = WMI_HOST_WIFI_STANDARD_6E;
+		else
+			wifi_standard = WMI_HOST_WIFI_STANDARD_6;
+	} else if (hdd_is_cfg_dot11_mode_11be(hdd_ctx->config->dot11Mode)) {
 		wifi_standard = WMI_HOST_WIFI_STANDARD_7;
-
-	if (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ax ||
-	    (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ax_ONLY)) {
-		if (wlan_reg_is_6ghz_supported(hdd_ctx->psoc))
-			wifi_standard =  WMI_HOST_WIFI_STANDARD_6E;
+	} else if (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ax ||
+		   (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ax_ONLY)) {
+		if (band_capability & BIT(REG_BAND_6G))
+			wifi_standard = WMI_HOST_WIFI_STANDARD_6E;
 		else
 			wifi_standard = WMI_HOST_WIFI_STANDARD_6;
-	}
-
-	if ((hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ac) ||
-	    (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY))
+	} else if ((hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ac) ||
+		   (hdd_ctx->config->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY)) {
 		wifi_standard = WMI_HOST_WIFI_STANDARD_5;
+	}
 
 	return wifi_standard;
 }
@@ -13034,7 +13055,6 @@ static void hdd_populate_feature_set_cds_config(struct cds_config_info *cds_cfg,
 	psoc = hdd_ctx->psoc;
 
 	cds_cfg->get_wifi_features = hdd_ctx->config->get_wifi_features;
-	cds_cfg->cds_feature_set.wifi_standard = hdd_get_wifi_standard(hdd_ctx);
 
 	status = ucfg_mlme_get_band_capability(hdd_ctx->psoc, &band_capability);
 	if (QDF_IS_STATUS_ERROR(status))
@@ -13043,6 +13063,10 @@ static void hdd_populate_feature_set_cds_config(struct cds_config_info *cds_cfg,
 	band_capability =
 		hdd_update_band_cap_from_dot11mode(hdd_ctx, band_capability);
 
+	cds_cfg->cds_feature_set.wifi_standard =
+				hdd_get_wifi_standard(hdd_ctx,
+						      band_capability);
+
 	cds_cfg->cds_feature_set.sap_5g_supported =
 					band_capability & BIT(REG_BAND_5G);
 

+ 12 - 0
core/sme/inc/sme_api.h

@@ -4521,11 +4521,23 @@ enum csr_cfgdot11mode sme_phy_mode_to_dot11mode(enum wlan_phymode phy_mode);
  * Return: Max EHT channel width supported by FW (eg. 80, 160, 320)
  */
 uint32_t sme_get_eht_ch_width(void);
+
+/**
+ * sme_is_11be_capable() - Check if 11 be is supported or not
+ *
+ * Return: True if 11be is supported
+ */
+bool sme_is_11be_capable(void);
 #else /* !WLAN_FEATURE_11BE */
 static inline uint32_t sme_get_eht_ch_width(void)
 {
 	return 0;
 }
+
+static inline bool sme_is_11be_capable(void)
+{
+	return false;
+}
 #endif /* WLAN_FEATURE_11BE */
 
 /**

+ 1 - 6
core/sme/src/common/sme_api.c

@@ -16199,15 +16199,10 @@ QDF_STATUS sme_switch_channel(mac_handle_t mac_handle,
 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
 
 #ifdef WLAN_FEATURE_11BE
-static inline bool sme_is_11be_capable(void)
+bool sme_is_11be_capable(void)
 {
 	return sme_is_feature_supported_by_fw(DOT11BE);
 }
-#else
-static inline bool sme_is_11be_capable(void)
-{
-	return false;
-}
 #endif
 
 QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,

+ 3 - 1
core/wma/src/wma_main.c

@@ -468,7 +468,9 @@ static void wma_set_feature_set_info(tp_wma_handle wma_handle,
 			tdls_feature_set.enable_tdls_capability_enhance;
 	}
 
-	feature_set->enable_p2p_6e = policy_mgr_is_6ghz_conc_mode_supported(
+	if (feature_set->sap_6g_supported)
+		feature_set->enable_p2p_6e =
+					policy_mgr_is_6ghz_conc_mode_supported(
 							psoc,
 							PM_P2P_CLIENT_MODE);