Explorar o código

qcacld-3.0: enable legacy coex feature

Because newest firmware codes already been changed, the previous
coex configure command are invalid. Firmware need host driver
to enable WMI_SERVICE_THREE_WAY_COEX_CONFIG_LEGACY service during
wlan init. Add a new parameter "gThreeWayCoexConfigLegacyEnable" to
initial config file. If this parameter value is zero,set coex
priorities command will return error.

Change-Id: Ief1617e2ba5363e276c55135198613a0e54b71d5
CRs-Fixed: 2482734
guangde %!s(int64=6) %!d(string=hai) anos
pai
achega
3fa3701975

+ 5 - 0
fw_offload/core/inc/wlan_fw_offload_main.h

@@ -62,6 +62,8 @@
  * @btc_mpta_helper_enable: Enable/Disable tri-radio MPTA helper
  * @btc_mpta_helper_enable: Enable/Disable tri-radio MPTA helper
  * @bt_sco_allow_wlan_2g_scan: Enable/Disble wlan 2g scan when
  * @bt_sco_allow_wlan_2g_scan: Enable/Disble wlan 2g scan when
  *                             BT SCO connection is on
  *                             BT SCO connection is on
+ * @btc_three_way_coex_config_legacy_enable: Enable/Disable tri-radio coex
+ *                             config legacy feature
  */
  */
 struct wlan_fwol_coex_config {
 struct wlan_fwol_coex_config {
 	uint8_t btc_mode;
 	uint8_t btc_mode;
@@ -79,6 +81,9 @@ struct wlan_fwol_coex_config {
 	bool    btc_mpta_helper_enable;
 	bool    btc_mpta_helper_enable;
 #endif
 #endif
 	bool bt_sco_allow_wlan_2g_scan;
 	bool bt_sco_allow_wlan_2g_scan;
+#ifdef FEATURE_COEX_CONFIG
+	bool    btc_three_way_coex_config_legacy_enable;
+#endif
 };
 };
 
 
 #define FWOL_THERMAL_LEVEL_MAX 4
 #define FWOL_THERMAL_LEVEL_MAX 4

+ 27 - 0
fw_offload/core/src/wlan_fw_offload_main.c

@@ -52,6 +52,32 @@ fwol_mpta_helper_config_get(struct wlan_objmgr_psoc *psoc,
 }
 }
 #endif
 #endif
 
 
+/**
+ * fwol_three_way_coex_config_legacy_config_get: Populate
+ * btc_three_way_coex_config_legacy_enable from cfg
+ * @psoc: The global psoc handler
+ * @coex_config: The cfg structure
+ *
+ * Return: none
+ */
+#ifdef FEATURE_COEX_CONFIG
+static void
+fwol_three_way_coex_config_legacy_config_get(
+			struct wlan_objmgr_psoc *psoc,
+			struct wlan_fwol_coex_config *coex_config)
+{
+	coex_config->btc_three_way_coex_config_legacy_enable =
+			cfg_get(psoc, CFG_THREE_WAY_COEX_CONFIG_LEGACY);
+}
+#else
+static void
+fwol_three_way_coex_config_legacy_config_get(
+			struct wlan_objmgr_psoc *psoc,
+			struct wlan_fwol_coex_config *coex_config)
+{
+}
+#endif
+
 static void
 static void
 fwol_init_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
 fwol_init_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
 			     struct wlan_fwol_coex_config *coex_config)
 			     struct wlan_fwol_coex_config *coex_config)
@@ -79,6 +105,7 @@ fwol_init_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
 	fwol_mpta_helper_config_get(psoc, coex_config);
 	fwol_mpta_helper_config_get(psoc, coex_config);
 	coex_config->bt_sco_allow_wlan_2g_scan =
 	coex_config->bt_sco_allow_wlan_2g_scan =
 				cfg_get(psoc, CFG_BT_SCO_ALLOW_WLAN_2G_SCAN);
 				cfg_get(psoc, CFG_BT_SCO_ALLOW_WLAN_2G_SCAN);
+	fwol_three_way_coex_config_legacy_config_get(psoc, coex_config);
 }
 }
 
 
 static void
 static void

+ 33 - 2
fw_offload/dispatcher/inc/cfg_coex.h

@@ -273,7 +273,6 @@
  * This ini is used to enable or disable wlan 2g scan
  * This ini is used to enable or disable wlan 2g scan
  * when BT SCO connection is on.
  * when BT SCO connection is on.
  *
  *
- *
  * Usage: External
  * Usage: External
  *
  *
  * </ini>
  * </ini>
@@ -283,6 +282,37 @@
 		1, \
 		1, \
 		"Bt Sco Allow Wlan 2G Scan")
 		"Bt Sco Allow Wlan 2G Scan")
 
 
+#ifdef FEATURE_COEX_CONFIG
+/*
+ * <ini>
+ * gThreeWayCoexConfigLegacyEnable - Enable coex config legacy feature
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable or disable three way coex config legacy feature.
+ * This feature is designed only for non-mobile solution.
+ * When the feature is disabled, Firmware use the default configuration to
+ * set the coex priority of three antenna(WLAN, BT, ZIGBEE).
+ * when enable this feature, customer can use the vendor command to set antenna
+ * coex priority dynamically.
+ *
+ * Supported Feature: three way coex config
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THREE_WAY_COEX_CONFIG_LEGACY CFG_INI_BOOL( \
+		"gThreeWayCoexConfigLegacyEnable", \
+		0, \
+		"Enable/Disable COEX Config Legacy")
+
+#define THREE_WAY_COEX_CONFIG_LEGACY_CFG CFG(CFG_THREE_WAY_COEX_CONFIG_LEGACY)
+#else
+#define THREE_WAY_COEX_CONFIG_LEGACY_CFG
+#endif
+
 #define CFG_COEX_ALL \
 #define CFG_COEX_ALL \
 	CFG(CFG_BTC_MODE) \
 	CFG(CFG_BTC_MODE) \
 	CFG(CFG_ANTENNA_ISOLATION) \
 	CFG(CFG_ANTENNA_ISOLATION) \
@@ -296,5 +326,6 @@
 	CFG(CFG_BT_INTERFERENCE_HIGH_LL) \
 	CFG(CFG_BT_INTERFERENCE_HIGH_LL) \
 	CFG(CFG_BT_INTERFERENCE_HIGH_UL) \
 	CFG(CFG_BT_INTERFERENCE_HIGH_UL) \
 	COEX_MPTA_HELPER_CFG \
 	COEX_MPTA_HELPER_CFG \
-	CFG(CFG_BT_SCO_ALLOW_WLAN_2G_SCAN)
+	CFG(CFG_BT_SCO_ALLOW_WLAN_2G_SCAN) \
+	THREE_WAY_COEX_CONFIG_LEGACY_CFG
 #endif
 #endif