Browse Source

qcacld-3.0: Add ini to pass xLNA bypass config to FW

Add new ini CFG_SET_SAP_XLNA_BYPASS under fw_offload to allow host
to pass config to FW. WMI_PDEV_PARAM_SET_SAP_XLNA_BYPASS makes the
SAP xLNA bypass configureable.

Change-Id: Ie501005f3035f14b3f23cdd260f401a6af81b798
CRs-fixed: 2632088
Lincoln Tran 5 years ago
parent
commit
4cb4b007a1

+ 2 - 0
components/fw_offload/core/inc/wlan_fw_offload_main.h

@@ -190,6 +190,7 @@ struct wlan_fwol_neighbor_report_cfg {
  * @enable_fw_log_type: Set the FW log type
  * @enable_fw_module_log_level: enable fw module log level
  * @enable_fw_module_log_level_num: enablefw module log level num
+ * @sap_xlna_bypass: bypass SAP xLNA
  * @is_rate_limit_enabled: Enable/disable RA rate limited
  * @tsf_gpio_pin: TSF GPIO Pin config
  * @tsf_irq_host_gpio_pin: TSF GPIO Pin config
@@ -225,6 +226,7 @@ struct wlan_fwol_cfg {
 	uint16_t enable_fw_log_type;
 	uint8_t enable_fw_module_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
 	uint8_t enable_fw_module_log_level_num;
+	bool sap_xlna_bypass;
 #ifdef FEATURE_WLAN_RA_FILTERING
 	bool is_rate_limit_enabled;
 #endif

+ 1 - 0
components/fw_offload/core/src/wlan_fw_offload_main.c

@@ -539,6 +539,7 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 	ucfg_fwol_fetch_tsf_irq_host_gpio_pin(psoc, fwol_cfg);
 	ucfg_fwol_fetch_tsf_sync_host_gpio_pin(psoc, fwol_cfg);
 	ucfg_fwol_fetch_dhcp_server_settings(psoc, fwol_cfg);
+	fwol_cfg->sap_xlna_bypass = cfg_get(psoc, CFG_SET_SAP_XLNA_BYPASS);
 
 	return status;
 }

+ 26 - 2
components/fw_offload/dispatcher/inc/cfg_fwol_generic.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -705,6 +705,29 @@
 		CFG_VALUE_OR_DEFAULT, \
 		"Secondary Retry Rate feature subset control")
 
+/*
+ * <ini>
+ * sap_xlna_bypass - Enable/Disable xLNA bypass
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable/disable SAP xLNA bypass in the FW
+ *
+ * Related: None
+ *
+ * Supported Feature: SAP
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+
+#define CFG_SET_SAP_XLNA_BYPASS CFG_INI_BOOL( \
+		"xlna_bypass", \
+		0, \
+		"SAP xLNA bypass control")
+
 #define CFG_FWOL_GENERIC_ALL \
 	CFG_FWOL_DHCP \
 	CFG(CFG_ENABLE_ANI) \
@@ -730,6 +753,7 @@
 	__CFG_IS_SAE_ENABLED \
 	CFG(CFG_ENABLE_GCMP) \
 	CFG(CFG_TX_SCH_DELAY) \
-	CFG(CFG_ENABLE_SECONDARY_RATE)
+	CFG(CFG_ENABLE_SECONDARY_RATE) \
+	CFG(CFG_SET_SAP_XLNA_BYPASS)
 
 #endif

+ 17 - 0
components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h

@@ -276,6 +276,16 @@ QDF_STATUS ucfg_fwol_get_enable_fw_module_log_level(
 				uint8_t **enable_fw_module_log_level,
 				uint8_t *enable_fw_module_log_level_num);
 
+/**
+ * ucfg_fwol_get_sap_xlna_bypass() - Assigns sap_xlna_bypass value
+ * @psoc: pointer to the psoc object
+ * @sap_xlna_bypass: pointer to return sap_xlna_bypass bool
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS ucfg_fwol_get_sap_xlna_bypass(struct wlan_objmgr_psoc *psoc,
+					 bool *sap_xlna_bypass);
+
 #ifdef FEATURE_WLAN_RA_FILTERING
 /**
  * ucfg_fwol_set_is_rate_limit_enabled() - Sets the is_rate_limit_enabled value
@@ -724,6 +734,13 @@ ucfg_fwol_get_enable_fw_module_log_level(
 	return QDF_STATUS_E_FAILURE;
 }
 
+static inline QDF_STATUS
+ucfg_fwol_get_sap_xlna_bypass(struct wlan_objmgr_psoc *psoc,
+			      uint8_t *sap_xlna_bypass)
+{
+	return QDF_STATUS_E_FAILURE;
+}
+
 static inline QDF_STATUS
 ucfg_fwol_get_tsf_gpio_pin(struct wlan_objmgr_psoc *psoc,
 			   uint32_t *tsf_gpio_pin)

+ 15 - 0
components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c

@@ -504,6 +504,21 @@ QDF_STATUS ucfg_fwol_get_enable_fw_module_log_level(
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS ucfg_fwol_get_sap_xlna_bypass(struct wlan_objmgr_psoc *psoc,
+					 bool *sap_xlna_bypass)
+{
+	struct wlan_fwol_psoc_obj *fwol_obj;
+
+	fwol_obj = fwol_get_psoc_obj(psoc);
+	if (!fwol_obj) {
+		fwol_err("Failed to get FWOL obj");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*sap_xlna_bypass = fwol_obj->cfg.sap_xlna_bypass;
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef FEATURE_WLAN_RA_FILTERING
 QDF_STATUS ucfg_fwol_set_is_rate_limit_enabled(struct wlan_objmgr_psoc *psoc,
 					       bool is_rate_limit_enabled)

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

@@ -5508,6 +5508,7 @@ int hdd_set_fw_params(struct hdd_adapter *adapter)
 	bool bval = false;
 	uint8_t enable_tx_sch_delay, dfs_chan_ageout_time;
 	uint32_t dtim_sel_diversity, enable_secondary_rate;
+	bool sap_xlna_bypass;
 
 	hdd_enter_dev(adapter->dev);
 
@@ -5568,6 +5569,18 @@ int hdd_set_fw_params(struct hdd_adapter *adapter)
 		goto error;
 	}
 
+	ret = -1;
+	if (QDF_IS_STATUS_SUCCESS(ucfg_fwol_get_sap_xlna_bypass(
+				  hdd_ctx->psoc, &sap_xlna_bypass))) {
+		ret = sme_cli_set_command(adapter->vdev_id,
+					  WMI_PDEV_PARAM_SET_SAP_XLNA_BYPASS,
+					  sap_xlna_bypass, PDEV_CMD);
+	}
+	if (ret) {
+		hdd_err("Failed to set WMI_PDEV_PARAM_SET_SAP_XLNA_BYPASS");
+		goto error;
+	}
+
 	wlan_mlme_get_dfs_chan_ageout_time(hdd_ctx->psoc,
 					   &dfs_chan_ageout_time);
 	ret = sme_cli_set_command(adapter->vdev_id,