Răsfoiți Sursa

qcacld-3.0: Add param to configure channel avoidance indication from FW

Currently, when WWAN channel changes, the list of WLAN channels that
needs to be avoided is given to WLAN FW. WLAN FW indicates the list
to host. Upon receiving Channel avoidance indication, host switches
the operating-channel of SAP (if any and conflicting).

When there is a frequent channel change from WWAN side, it causes
frequent SAP disconnection. To mitigate this problem, as part of
this change send the configuration to the WLAN FW which delays
the channel avoidance indication before sending it to host.

Change-Id: If67775d59b9f61d3592a5f6609d3b002899e5daf
CRs-Fixed: 2615917
Sourav Mohapatra 5 ani în urmă
părinte
comite
eb7227cc06

+ 4 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -2233,6 +2233,10 @@ static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_MWS_COEX_4G_QUICK_FTDM);
 	mwc->mws_coex_5g_nr_pwr_limit =
 		cfg_get(psoc, CFG_MWS_COEX_5G_NR_PWR_LIMIT);
+	mwc->mws_coex_pcc_channel_avoid_delay =
+		cfg_get(psoc, CFG_MWS_COEX_PCC_CHANNEL_AVOID_DELAY);
+	mwc->mws_coex_scc_channel_avoid_delay =
+		cfg_get(psoc, CFG_MWS_COEX_SCC_CHANNEL_AVOID_DELAY);
 }
 #else
 static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc,

+ 48 - 2
components/mlme/dispatcher/inc/cfg_mlme_mwc.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018,2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -79,9 +79,55 @@
 	CFG_VALUE_OR_DEFAULT, \
 	"set mws-coex 5g-nr power limit")
 
+/*
+ * <ini>
+ * mws_coex_pcc_channel_avoid_delay - configures the duration, when WWAN PCC
+ * (Primary Component Carrier) conflicts with WLAN channel.
+ * @Min: 0x00
+ * @Max: 0xFF
+ * @Default: 0x3C
+ *
+ * It is used to set MWS-COEX WWAN PCC channel avoidance delay
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_MWS_COEX_PCC_CHANNEL_AVOID_DELAY CFG_INI_UINT(\
+		"mws_coex_pcc_channel_avoid_delay", \
+		0x00, \
+		0xFF, \
+		0x3C, \
+		CFG_VALUE_OR_DEFAULT, \
+		"set mws-coex PCC channel avoidance delay")
+
+/*
+ * <ini>
+ * mws_coex_scc_channel_avoid_delay - configures the duration, when WWAN SCC
+ * (Secondary Component Carrier) conflicts with WLAN channel.
+ * @Min: 0x00
+ * @Max: 0xFF
+ * @Default: 0x78
+ *
+ * It is used to set MWS-COEX WWAN SCC channel avoidance delay
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_MWS_COEX_SCC_CHANNEL_AVOID_DELAY CFG_INI_UINT(\
+		"mws_coex_scc_channel_avoid_delay", \
+		0x00, \
+		0xFF, \
+		0x78, \
+		CFG_VALUE_OR_DEFAULT, \
+		"set mws-coex SCC channel avoidance delay")
+
 #define CFG_MWC_ALL \
 	CFG(CFG_MWS_COEX_4G_QUICK_FTDM) \
-	CFG(CFG_MWS_COEX_5G_NR_PWR_LIMIT)
+	CFG(CFG_MWS_COEX_5G_NR_PWR_LIMIT) \
+	CFG(CFG_MWS_COEX_PCC_CHANNEL_AVOID_DELAY) \
+	CFG(CFG_MWS_COEX_SCC_CHANNEL_AVOID_DELAY)
 
 #else
 #define CFG_MWC_ALL

+ 4 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -2133,10 +2133,14 @@ struct wlan_mlme_fe_rrm {
  * struct wlan_mlme_mwc - MWC related configs
  * @mws_coex_4g_quick_tdm:  bitmap to set mws-coex 5g-nr power limit
  * @mws_coex_5g_nr_pwr_limit: bitmap to set mws-coex 5g-nr power limit
+ * @mws_coex_pcc_channel_avoid_delay: PCC avoidance delay in seconds
+ * @mws_coex_scc_channel_avoid_delay: SCC avoidance delay in seconds
  **/
 struct wlan_mlme_mwc {
 	uint32_t mws_coex_4g_quick_tdm;
 	uint32_t mws_coex_5g_nr_pwr_limit;
+	uint32_t mws_coex_pcc_channel_avoid_delay;
+	uint32_t mws_coex_scc_channel_avoid_delay;
 };
 #else
 struct wlan_mlme_mwc {

+ 24 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -3685,6 +3685,30 @@ ucfg_mlme_get_mws_coex_4g_quick_tdm(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
 				       uint32_t *val);
+
+/**
+ * ucfg_mlme_get_mws_coex_pcc_channel_avoid_delay() - Get mws coex pcc
+ *                                                    avoid channel delay
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_mws_coex_pcc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc,
+					       uint32_t *val);
+
+/**
+ * ucfg_mlme_get_mws_coex_scc_channel_avoid_delay() - Get mws coex scc
+ *                                                    avoidance channel delay
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc,
+					       uint32_t *val);
 #endif
 
 /**

+ 36 - 0
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1481,6 +1481,42 @@ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+ucfg_mlme_get_mws_coex_pcc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc,
+					       uint32_t *val)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj) {
+		*val = cfg_default(CFG_MWS_COEX_PCC_CHANNEL_AVOID_DELAY);
+		mlme_legacy_err("mlme obj null");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	*val = mlme_obj->cfg.mwc.mws_coex_pcc_channel_avoid_delay;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc,
+					       uint32_t *val)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj) {
+		*val = cfg_default(CFG_MWS_COEX_SCC_CHANNEL_AVOID_DELAY);
+		mlme_legacy_err("mlme obj null");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	*val = mlme_obj->cfg.mwc.mws_coex_scc_channel_avoid_delay;
+
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 QDF_STATUS

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

@@ -11849,6 +11849,8 @@ static int hdd_init_mws_coex(struct hdd_context *hdd_ctx)
 {
 	int ret = 0;
 	uint32_t mws_coex_4g_quick_tdm = 0, mws_coex_5g_nr_pwr_limit = 0;
+	uint32_t mws_coex_pcc_channel_avoid_delay = 0;
+	uint32_t mws_coex_scc_channel_avoid_delay = 0;
 
 	ucfg_mlme_get_mws_coex_4g_quick_tdm(hdd_ctx->psoc,
 					    &mws_coex_4g_quick_tdm);
@@ -11872,6 +11874,23 @@ static int hdd_init_mws_coex(struct hdd_context *hdd_ctx)
 		return ret;
 	}
 
+	ucfg_mlme_get_mws_coex_pcc_channel_avoid_delay(
+					hdd_ctx->psoc,
+					&mws_coex_pcc_channel_avoid_delay);
+
+	ret = sme_cli_set_command(0, WMI_PDEV_PARAM_MWSCOEX_PCC_CHAVD_DELAY,
+				  mws_coex_pcc_channel_avoid_delay,
+				  PDEV_CMD);
+	if (ret)
+		return ret;
+
+	ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(
+					hdd_ctx->psoc,
+					&mws_coex_scc_channel_avoid_delay);
+
+	ret = sme_cli_set_command(0, WMI_PDEV_PARAM_MWSCOEX_SCC_CHAVD_DELAY,
+				  mws_coex_scc_channel_avoid_delay,
+				  PDEV_CMD);
 	return ret;
 }
 #else