Bladeren bron

qcacld-3.0: Add 11BE phy mode in csr/sap layer

Implement 11BE phy mode in csr/sap layer

Change-Id: I7f35379b94dcb64dec0da463b95967125dc7fd14
CRs-Fixed: 2908011
bings 4 jaren geleden
bovenliggende
commit
b9792c62d3

+ 2 - 0
core/hdd/src/wlan_hdd_wext.c

@@ -6489,6 +6489,8 @@ static int __iw_get_char_setnone(struct net_device *dev,
 				snprintf(extra, WE_MAX_STR_LEN,
 					 "11AX_HE_160");
 			break;
+		default:
+			break;
 		}
 
 		wrqu->data.length = strlen(extra) + 1;

+ 5 - 1
core/sap/src/sap_module.c

@@ -1220,7 +1220,11 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
 		    sap_context->csr_roamProfile.phyMode ==
 		    eCSR_DOT11_MODE_11ax ||
 		    sap_context->csr_roamProfile.phyMode ==
-		    eCSR_DOT11_MODE_11ax_ONLY) {
+		    eCSR_DOT11_MODE_11ax_ONLY ||
+		    CSR_IS_DOT11_PHY_MODE_11BE(
+			sap_context->csr_roamProfile.phyMode) ||
+		    CSR_IS_DOT11_PHY_MODE_11BE_ONLY(
+			sap_context->csr_roamProfile.phyMode)) {
 			max_fw_bw = sme_get_vht_ch_width();
 			if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
 				ch_width = CH_WIDTH_160MHZ;

+ 13 - 1
core/sme/inc/csr_api.h

@@ -122,11 +122,23 @@ typedef enum {
 	eCSR_DOT11_MODE_AUTO = 0x0400,
 	eCSR_DOT11_MODE_11ax = 0x0800,
 	eCSR_DOT11_MODE_11ax_ONLY = 0x1000,
+	eCSR_DOT11_MODE_11be = 0x2000,
+	eCSR_DOT11_MODE_11be_ONLY = 0x4000,
 
 	/* specify the number of maximum bits for phyMode */
-	eCSR_NUM_PHY_MODE = 16,
+	eCSR_NUM_PHY_MODE = 18,
 } eCsrPhyMode;
 
+#ifdef WLAN_FEATURE_11BE
+#define CSR_IS_DOT11_PHY_MODE_11BE(dot11mode) \
+	((dot11mode) == eCSR_DOT11_MODE_11be)
+#define CSR_IS_DOT11_PHY_MODE_11BE_ONLY(dot11mode) \
+	((dot11mode) == eCSR_DOT11_MODE_11be_ONLY)
+#else
+#define CSR_IS_DOT11_PHY_MODE_11BE(dot11mode) 0
+#define CSR_IS_DOT11_PHY_MODE_11BE_ONLY(dot11mode) 0
+#endif
+
 /**
  * enum eCsrRoamBssType - BSS type in CSR operations
  * @eCSR_BSS_TYPE_INFRASTRUCTURE: Infrastructure station

+ 28 - 3
core/sme/inc/csr_internal.h

@@ -86,6 +86,8 @@ enum csr_cfgdot11mode {
 	eCSR_CFG_DOT11_MODE_AUTO,
 	eCSR_CFG_DOT11_MODE_11AX,
 	eCSR_CFG_DOT11_MODE_11AX_ONLY,
+	eCSR_CFG_DOT11_MODE_11BE,
+	eCSR_CFG_DOT11_MODE_11BE_ONLY,
 	eCSR_CFG_DOT11_MODE_MAX,
 };
 
@@ -633,6 +635,7 @@ struct csr_roamstruct {
 	 (eCSR_DOT11_MODE_11n & (phyMode)) || \
 	 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
 	 (eCSR_DOT11_MODE_11ax & (phyMode)) || \
+	 (eCSR_DOT11_MODE_11be & (phyMode)) || \
 	 (eCSR_DOT11_MODE_AUTO & (phyMode)))
 
 #define CSR_IS_PHY_MODE_11n(phy_mode) \
@@ -652,19 +655,41 @@ struct csr_roamstruct {
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11N_ONLY) || \
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11AC_ONLY) || \
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX) || \
-	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY))
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY) || \
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11BE) || \
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11BE_ONLY))
 
 #define CSR_IS_DOT11_MODE_11AC(dot11mode) \
 	((dot11mode == eCSR_CFG_DOT11_MODE_AUTO) || \
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11AC) || \
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11AC_ONLY) || \
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX) || \
-	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY))
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY) || \
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11BE) || \
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11BE_ONLY))
 
 #define CSR_IS_DOT11_MODE_11AX(dot11mode) \
 	((dot11mode == eCSR_CFG_DOT11_MODE_AUTO) || \
 	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX) || \
-	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY))
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY) || \
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11BE) || \
+	 (dot11mode == eCSR_CFG_DOT11_MODE_11BE_ONLY))
+
+#define CSR_IS_DOT11_MODE_11BE(dot11mode) \
+	(((dot11mode) == eCSR_CFG_DOT11_MODE_AUTO) || \
+	 ((dot11mode) == eCSR_CFG_DOT11_MODE_11BE) || \
+	 ((dot11mode) == eCSR_CFG_DOT11_MODE_11BE_ONLY))
+
+#ifdef WLAN_FEATURE_11BE
+#define CSR_IS_CFG_DOT11_PHY_MODE_11BE(dot11mode) \
+	((dot11mode) == eCSR_CFG_DOT11_MODE_11BE)
+
+#define CSR_IS_CFG_DOT11_PHY_MODE_11BE_ONLY(dot11mode) \
+	((dot11mode) == eCSR_CFG_DOT11_MODE_11BE_ONLY)
+#else
+#define CSR_IS_CFG_DOT11_PHY_MODE_11BE(dot11mode) 0
+#define CSR_IS_CFG_DOT11_PHY_MODE_11BE_ONLY(dot11mode) 0
+#endif
 /*
  * this function returns true if the NIC is operating exclusively in
  * the 2.4 GHz band, meaning. it is NOT operating in the 5.0 GHz band.

+ 13 - 2
core/sme/src/common/sme_api.c

@@ -15154,9 +15154,15 @@ void sme_update_score_config(mac_handle_t mac_handle, eCsrPhyMode phy_mode,
 
 	config.vdev_nss_24g = vdev_ini_cfg.rx_nss[NSS_CHAINS_BAND_2GHZ];
 	config.vdev_nss_5g = vdev_ini_cfg.rx_nss[NSS_CHAINS_BAND_5GHZ];
-
+#ifdef WLAN_FEATURE_11BE
 	if (phy_mode == eCSR_DOT11_MODE_AUTO ||
-	    phy_mode == eCSR_DOT11_MODE_11ax ||
+	    CSR_IS_DOT11_PHY_MODE_11BE(phy_mode) ||
+	    CSR_IS_DOT11_PHY_MODE_11BE_ONLY(phy_mode)) {
+		config.eht_cap = 1;
+		config.he_cap = 1;
+	}
+#endif
+	if (phy_mode == eCSR_DOT11_MODE_11ax ||
 	    phy_mode == eCSR_DOT11_MODE_11ax_ONLY)
 		config.he_cap = 1;
 
@@ -15169,6 +15175,11 @@ void sme_update_score_config(mac_handle_t mac_handle, eCsrPhyMode phy_mode,
 	    phy_mode == eCSR_DOT11_MODE_11n_ONLY)
 		config.ht_cap = 1;
 
+#ifdef WLAN_FEATURE_11BE
+	if (!IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+		config.eht_cap = 0;
+#endif
+
 	if (!IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
 		config.he_cap = 0;
 

+ 47 - 1
core/sme/src/csr/csr_api_roam.c

@@ -1006,6 +1006,14 @@ QDF_STATUS csr_update_channel_list(struct mac_context *mac)
 	    (mac->roam.configParam.uCfgDot11Mode ==
 	     eCSR_CFG_DOT11_MODE_11AX_ONLY))
 		pChanList->he_en = true;
+#ifdef WLAN_FEATURE_11BE
+	if ((mac->roam.configParam.uCfgDot11Mode == eCSR_CFG_DOT11_MODE_AUTO) ||
+	    CSR_IS_CFG_DOT11_PHY_MODE_11BE(
+		mac->roam.configParam.uCfgDot11Mode) ||
+	    CSR_IS_CFG_DOT11_PHY_MODE_11BE_ONLY(
+		mac->roam.configParam.uCfgDot11Mode))
+		pChanList->eht_en = true;
+#endif
 
 	pChanList->numChan = num_channel;
 	mlme_store_fw_scan_channels(mac->psoc, pChanList);
@@ -2966,6 +2974,7 @@ QDF_STATUS csr_roam_prepare_bss_config(struct mac_context *mac,
 		} else if (band == REG_BAND_5G) {
 			pBssConfig->uCfgDot11Mode = eCSR_CFG_DOT11_MODE_11A;
 		} else if (band == REG_BAND_6G) {
+			// Still use 11AX even 11BE is supported
 			pBssConfig->uCfgDot11Mode =
 						eCSR_CFG_DOT11_MODE_11AX_ONLY;
 		}
@@ -10334,6 +10343,10 @@ csr_roam_chk_lnk_swt_ch_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	else if (IS_WLAN_PHYMODE_VHT(pSwitchChnInd->ch_phymode) ||
 		 IS_WLAN_PHYMODE_HE(pSwitchChnInd->ch_phymode))
 		roam_info->mode = SIR_SME_PHY_MODE_VHT;
+#ifdef WLAN_FEATURE_11BE
+	else if (IS_WLAN_PHYMODE_EHT(pSwitchChnInd->ch_phymode))
+		roam_info->mode = SIR_SME_PHY_MODE_VHT;
+#endif
 	else
 		roam_info->mode = SIR_SME_PHY_MODE_LEGACY;
 
@@ -11183,7 +11196,36 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
 		}
 		*band = wlan_reg_freq_to_band(opr_ch_freq);
 		break;
+#ifdef WLAN_FEATURE_11BE
+	case eCSR_CFG_DOT11_MODE_11BE:
+	case eCSR_CFG_DOT11_MODE_11BE_ONLY:
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE)) {
+			*dot11_mode = mac_ctx->roam.configParam.uCfgDot11Mode;
+		} else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) {
+			*dot11_mode = eCSR_CFG_DOT11_MODE_11AX;
+		} else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
+			/*
+			 * If the operating channel is in 2.4 GHz band, check
+			 * for INI item to disable VHT operation in 2.4 GHz band
+			 */
+			if (WLAN_REG_IS_24GHZ_CH_FREQ(opr_ch_freq) &&
+			    !vht_24_ghz)
+				/* Disable 11AC operation */
+				*dot11_mode = eCSR_CFG_DOT11_MODE_11N;
+			else
+				*dot11_mode = eCSR_CFG_DOT11_MODE_11AC;
+		} else {
+			*dot11_mode = eCSR_CFG_DOT11_MODE_11N;
+		}
+		*band = wlan_reg_freq_to_band(opr_ch_freq);
+		break;
+#endif
 	case eCSR_CFG_DOT11_MODE_AUTO:
+#ifdef WLAN_FEATURE_11BE
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE)) {
+			*dot11_mode = eCSR_CFG_DOT11_MODE_11BE;
+		} else
+#endif
 		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) {
 			*dot11_mode = eCSR_CFG_DOT11_MODE_11AX;
 		} else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
@@ -11310,7 +11352,8 @@ csr_roam_get_phy_mode_band_for_bss(struct mac_context *mac_ctx,
 		eCSR_ENCRYPT_TYPE_NONE)))
 		&& ((eCSR_CFG_DOT11_MODE_11N == cfg_dot11_mode) ||
 		    (eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode) ||
-		    (eCSR_CFG_DOT11_MODE_11AX == cfg_dot11_mode))) {
+		    (eCSR_CFG_DOT11_MODE_11AX == cfg_dot11_mode) ||
+		    CSR_IS_CFG_DOT11_PHY_MODE_11BE(cfg_dot11_mode))) {
 		/* We cannot do 11n here */
 		if (wlan_reg_is_24ghz_ch_freq(bss_op_ch_freq))
 			cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11G;
@@ -11319,6 +11362,9 @@ csr_roam_get_phy_mode_band_for_bss(struct mac_context *mac_ctx,
 	}
 	sme_debug("dot11mode: %d phyMode %d fw sup AX %d", cfg_dot11_mode,
 		  profile->phyMode, IS_FEATURE_SUPPORTED_BY_FW(DOT11AX));
+#ifdef WLAN_FEATURE_11BE
+	sme_debug("BE :%d", IS_FEATURE_SUPPORTED_BY_FW(DOT11BE));
+#endif
 	return cfg_dot11_mode;
 }
 

+ 177 - 13
core/sme/src/csr/csr_util.c

@@ -317,6 +317,10 @@ const char *csr_phy_mode_str(eCsrPhyMode phy_mode)
 		return "11ax";
 	case eCSR_DOT11_MODE_11ax_ONLY:
 		return "11ax_only";
+	case eCSR_DOT11_MODE_11be:
+		return "11be";
+	case eCSR_DOT11_MODE_11be_ONLY:
+		return "11be_only";
 	default:
 		return "unknown";
 	}
@@ -581,7 +585,11 @@ csr_get_vdev_dot11_mode(struct mac_context *mac,
 	if (CSR_IS_DOT11_MODE_11AX(curr_dot11_mode) &&
 	    vdev_dot11_mode == MLME_VDEV_DOT11_MODE_11AX)
 		dot11_mode = eCSR_CFG_DOT11_MODE_11AX;
-
+#ifdef WLAN_FEATURE_11BE
+	if (CSR_IS_DOT11_MODE_11BE(curr_dot11_mode) &&
+	    vdev_dot11_mode == MLME_VDEV_DOT11_MODE_11BE)
+		dot11_mode = eCSR_CFG_DOT11_MODE_11BE;
+#endif
 	sme_debug("INI vdev_dot11_mode %d new dot11_mode %d",
 		  vdev_dot11_mode, dot11_mode);
 
@@ -710,7 +718,9 @@ static void csr_calc_chb_for_sap_phymode(struct mac_context *mac_ctx,
 	} else if (*sap_phymode == eCSR_DOT11_MODE_11ac ||
 		   *sap_phymode == eCSR_DOT11_MODE_11ac_ONLY ||
 		   *sap_phymode == eCSR_DOT11_MODE_11ax ||
-		   *sap_phymode == eCSR_DOT11_MODE_11ax_ONLY) {
+		   *sap_phymode == eCSR_DOT11_MODE_11ax_ONLY ||
+		   CSR_IS_DOT11_PHY_MODE_11BE(*sap_phymode) ||
+		   CSR_IS_DOT11_PHY_MODE_11BE_ONLY(*sap_phymode)) {
 		/*11AC only 80/40/20 Mhz supported in Rome */
 		if (mac_ctx->roam.configParam.nVhtChannelWidth ==
 				(WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ + 1)) {
@@ -1330,6 +1340,11 @@ csr_translate_to_phy_mode_from_bss_desc(struct mac_context *mac_ctx,
 	case eSIR_11AX_NW_TYPE:
 		phyMode = eCSR_DOT11_MODE_11ax;
 		break;
+#ifdef WLAN_FEATURE_11BE
+	case eSIR_11BE_NW_TYPE:
+		phyMode = eCSR_DOT11_MODE_11be;
+		break;
+#endif
 	case eSIR_11AC_NW_TYPE:
 	default:
 		phyMode = eCSR_DOT11_MODE_11ac;
@@ -1345,6 +1360,11 @@ uint32_t csr_translate_to_wni_cfg_dot11_mode(struct mac_context *mac,
 
 	switch (csrDot11Mode) {
 	case eCSR_CFG_DOT11_MODE_AUTO:
+#ifdef WLAN_FEATURE_11BE
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+			ret = MLME_DOT11_MODE_11BE;
+		else
+#endif
 		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
 			ret = MLME_DOT11_MODE_11AX;
 		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
@@ -1398,6 +1418,28 @@ uint32_t csr_translate_to_wni_cfg_dot11_mode(struct mac_context *mac,
 		else
 			ret = MLME_DOT11_MODE_11N;
 		break;
+#ifdef WLAN_FEATURE_11BE
+	case eCSR_CFG_DOT11_MODE_11BE_ONLY:
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+			ret = MLME_DOT11_MODE_11BE_ONLY;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
+			ret = MLME_DOT11_MODE_11AX_ONLY;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
+			ret = MLME_DOT11_MODE_11AC;
+		else
+			ret = MLME_DOT11_MODE_11N;
+		break;
+	case eCSR_CFG_DOT11_MODE_11BE:
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+			ret = MLME_DOT11_MODE_11BE;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
+			ret = MLME_DOT11_MODE_11AX;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
+			ret = MLME_DOT11_MODE_11AC;
+		else
+			ret = MLME_DOT11_MODE_11N;
+		break;
+#endif
 	default:
 		sme_warn("doesn't expect %d as csrDo11Mode", csrDot11Mode);
 		if (BAND_2G == mac->mlme_cfg->gen.band)
@@ -1439,14 +1481,22 @@ QDF_STATUS csr_get_phy_mode_from_bss(struct mac_context *mac,
 				phyMode = eCSR_DOT11_MODE_11ac;
 			if (pIes->he_cap.present)
 				phyMode = eCSR_DOT11_MODE_11ax;
+			if (pIes->eht_cap.present)
+				phyMode = eCSR_DOT11_MODE_11be;
 		} else if (WLAN_REG_IS_6GHZ_CHAN_FREQ(
 					pBSSDescription->chan_freq)) {
-			if (pIes->he_cap.present)
+			if (pIes->eht_cap.present)
+				phyMode = eCSR_DOT11_MODE_11be;
+			else if (pIes->he_cap.present)
 				phyMode = eCSR_DOT11_MODE_11ax;
 			else
 				sme_debug("Warning - 6Ghz AP no he cap");
-		} else if (pIes->he_cap.present)
-			phyMode = eCSR_DOT11_MODE_11ax;
+		} else {
+			if (pIes->he_cap.present)
+				phyMode = eCSR_DOT11_MODE_11ax;
+			if (pIes->eht_cap.present)
+				phyMode = eCSR_DOT11_MODE_11be;
+		}
 
 		*pPhyMode = phyMode;
 	}
@@ -1538,6 +1588,7 @@ static bool csr_get_phy_mode_in_use(struct mac_context *mac_ctx,
 		case eCSR_DOT11_MODE_11n:
 		case eCSR_DOT11_MODE_11ac:
 		case eCSR_DOT11_MODE_11ax:
+		case eCSR_DOT11_MODE_11be:
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
 			break;
 
@@ -1573,6 +1624,7 @@ static bool csr_get_phy_mode_in_use(struct mac_context *mac_ctx,
 			break;
 		case eCSR_DOT11_MODE_11ac:
 		case eCSR_DOT11_MODE_11ax:
+		case eCSR_DOT11_MODE_11be:
 		default:
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
 			break;
@@ -1605,6 +1657,7 @@ static bool csr_get_phy_mode_in_use(struct mac_context *mac_ctx,
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
 			break;
 		case eCSR_DOT11_MODE_11ax:
+		case eCSR_DOT11_MODE_11be:
 		default:
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX;
 			break;
@@ -1618,6 +1671,42 @@ static bool csr_get_phy_mode_in_use(struct mac_context *mac_ctx,
 		}
 		break;
 
+	case eCSR_DOT11_MODE_11be:
+		fMatch = true;
+		switch (bssPhyMode) {
+		case eCSR_DOT11_MODE_11g:
+		case eCSR_DOT11_MODE_11g_ONLY:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11G;
+			break;
+		case eCSR_DOT11_MODE_11b:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11B;
+			break;
+		case eCSR_DOT11_MODE_11a:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11A;
+			break;
+		case eCSR_DOT11_MODE_11n:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+			break;
+		case eCSR_DOT11_MODE_11ac:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+			break;
+		case eCSR_DOT11_MODE_11ax:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX;
+			break;
+		case eCSR_DOT11_MODE_11be:
+		default:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11BE;
+			break;
+		}
+		break;
+
+	case eCSR_DOT11_MODE_11be_ONLY:
+		if (CSR_IS_DOT11_PHY_MODE_11BE(bssPhyMode)) {
+			fMatch = true;
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11BE;
+		}
+		break;
+
 	default:
 		fMatch = true;
 		switch (bssPhyMode) {
@@ -1640,6 +1729,9 @@ static bool csr_get_phy_mode_in_use(struct mac_context *mac_ctx,
 		case eCSR_DOT11_MODE_11ax:
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX;
 			break;
+		case eCSR_DOT11_MODE_11be:
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11BE;
+			break;
 		default:
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_AUTO;
 			break;
@@ -1648,7 +1740,19 @@ static bool csr_get_phy_mode_in_use(struct mac_context *mac_ctx,
 	}
 
 	if (fMatch && pCfgDot11ModeToUse) {
-		if (cfgDot11Mode == eCSR_CFG_DOT11_MODE_11AX) {
+		if (CSR_IS_CFG_DOT11_PHY_MODE_11BE(cfgDot11Mode)) {
+#ifdef WLAN_FEATURE_11BE
+			if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+				*pCfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11BE;
+			else
+#endif
+			if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
+				*pCfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AX;
+			else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
+				*pCfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AC;
+			else
+				*pCfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11N;
+		} else if (cfgDot11Mode == eCSR_CFG_DOT11_MODE_11AX) {
 			if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
 				*pCfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AX;
 			else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
@@ -1703,11 +1807,6 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode,
 		return fMatch;
 
 	bss_chan_freq = pSirBssDesc->chan_freq;
-	if (WLAN_REG_IS_6GHZ_CHAN_FREQ(bss_chan_freq)) {
-		if (pReturnCfgDot11Mode)
-			*pReturnCfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX;
-		return true;
-	}
 
 	if ((0 == phyMode) || (eCSR_DOT11_MODE_AUTO & phyMode)) {
 		if (eCSR_CFG_DOT11_MODE_ABG ==
@@ -1715,6 +1814,11 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode,
 			phyMode = eCSR_DOT11_MODE_abg;
 		} else if (eCSR_CFG_DOT11_MODE_AUTO ==
 				mac->roam.configParam.uCfgDot11Mode) {
+#ifdef WLAN_FEATURE_11BE
+			if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+				phyMode = eCSR_DOT11_MODE_11be;
+			else
+#endif
 			if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
 				phyMode = eCSR_DOT11_MODE_11ax;
 			else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
@@ -1774,6 +1878,8 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode,
 				(eCSR_CFG_DOT11_MODE_11AC ==
 					cfgDot11ModeToUse) ||
 				(eCSR_CFG_DOT11_MODE_11AX ==
+					cfgDot11ModeToUse) ||
+				CSR_IS_CFG_DOT11_PHY_MODE_11BE(
 					cfgDot11ModeToUse))) {
 			/* We cannot do 11n here */
 			if (WLAN_REG_IS_24GHZ_CH_FREQ(bss_chan_freq)) {
@@ -1798,7 +1904,23 @@ enum csr_cfgdot11mode csr_find_best_phy_mode(struct mac_context *mac,
 
 	if ((0 == phyMode) ||
 	    (eCSR_DOT11_MODE_AUTO & phyMode) ||
-	    (eCSR_DOT11_MODE_11ax & phyMode)) {
+	    (eCSR_DOT11_MODE_11be & phyMode)) {
+#ifdef WLAN_FEATURE_11BE
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE)) {
+			cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11BE;
+		} else
+#endif
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) {
+			cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AX;
+		} else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
+			cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AC;
+		} else {
+			/* Default to 11N mode if user has configured 11ac mode
+			 * and FW doesn't supports 11ac mode .
+			 */
+			cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11N;
+		}
+	} else if (eCSR_DOT11_MODE_11ax & phyMode) {
 		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) {
 			cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AX;
 		} else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
@@ -1842,6 +1964,11 @@ enum reg_phymode csr_convert_to_reg_phy_mode(eCsrPhyMode csr_phy_mode,
 {
 	if (csr_phy_mode == eCSR_DOT11_MODE_AUTO)
 		return REG_PHYMODE_MAX - 1;
+#ifdef WLAN_FEATURE_11BE
+	else if (CSR_IS_DOT11_PHY_MODE_11BE(csr_phy_mode) ||
+		 CSR_IS_DOT11_PHY_MODE_11BE_ONLY(csr_phy_mode))
+		return REG_PHYMODE_11BE;
+#endif
 	else if (csr_phy_mode == eCSR_DOT11_MODE_11ax ||
 		 csr_phy_mode == eCSR_DOT11_MODE_11ax_ONLY)
 		return REG_PHYMODE_11AX;
@@ -1887,6 +2014,10 @@ eCsrPhyMode csr_convert_from_reg_phy_mode(enum reg_phymode phymode)
 		return eCSR_DOT11_MODE_11ac;
 	case REG_PHYMODE_11AX:
 		return eCSR_DOT11_MODE_11ax;
+#ifdef WLAN_FEATURE_11BE
+	case REG_PHYMODE_11BE:
+		return eCSR_DOT11_MODE_11be;
+#endif
 	case REG_PHYMODE_MAX:
 		return eCSR_DOT11_MODE_AUTO;
 	default:
@@ -2806,7 +2937,28 @@ csr_get_cfg_dot11_mode_from_csr_phy_mode(struct csr_roam_profile *pProfile,
 		else
 			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
 		break;
-
+#ifdef WLAN_FEATURE_11BE
+	case eCSR_DOT11_MODE_11be:
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11BE;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+		else
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+		break;
+	case eCSR_DOT11_MODE_11be_ONLY:
+		if (IS_FEATURE_SUPPORTED_BY_FW(DOT11BE))
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11BE_ONLY;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX_ONLY;
+		else if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+		else
+			cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+		break;
+#endif
 	default:
 		/* No need to assign anything here */
 		break;
@@ -3087,6 +3239,18 @@ enum csr_cfgdot11mode csr_phy_mode_to_dot11mode(enum wlan_phymode phy_mode)
 	case WLAN_PHYMODE_11AXA_HE160:
 	case WLAN_PHYMODE_11AXA_HE80_80:
 		return eCSR_CFG_DOT11_MODE_11AX;
+#ifdef WLAN_FEATURE_11BE
+	case WLAN_PHYMODE_11BEA_EHT20:
+	case WLAN_PHYMODE_11BEG_EHT20:
+	case WLAN_PHYMODE_11BEA_EHT40:
+	case WLAN_PHYMODE_11BEG_EHT40PLUS:
+	case WLAN_PHYMODE_11BEG_EHT40MINUS:
+	case WLAN_PHYMODE_11BEG_EHT40:
+	case WLAN_PHYMODE_11BEA_EHT80:
+	case WLAN_PHYMODE_11BEG_EHT80:
+	case WLAN_PHYMODE_11BEA_EHT160:
+		return eCSR_CFG_DOT11_MODE_11BE;
+#endif
 	default:
 		sme_err("invalid phy mode %d", phy_mode);
 		return eCSR_CFG_DOT11_MODE_MAX;