summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDundi Raviteja <dundi@codeaurora.org>2018-07-05 19:03:19 +0530
committernshrivas <nshrivas@codeaurora.org>2018-07-18 23:13:19 -0700
commit5cc4e1f9fe1257dd6a7ecb98b005050dc87be1e5 (patch)
tree41ef6ab6612d1b8db27517ac8bde10b97d19926a
parent8e9e2120ed94665ce4dd3c34f06d526130a5bd54 (diff)
qcacld-3.0: Add support to send MWS-COEX configurations to FW
Add support to send below two MWS-COEX configurations to FW 1. Enable/disable MWS-COEX 4G (LTE) Quick FTDM 2. Set MWS-COEX 5G-NR power limit Change-Id: I14656ced91c9dec2be85590e6f6c1e7497505a28 CRs-Fixed: 2265352
-rw-r--r--Kbuild3
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h60
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c39
-rw-r--r--core/hdd/src/wlan_hdd_main.c53
4 files changed, 153 insertions, 2 deletions
diff --git a/Kbuild b/Kbuild
index 3d0b8fec4d5c..9fa174bb969d 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1278,7 +1278,8 @@ CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \
-DCONFIG_160MHZ_SUPPORT \
-DCONFIG_MCL \
-DWMI_CMD_STRINGS \
- -DCONFIG_HDD_INIT_WITH_RTNL_LOCK
+ -DCONFIG_HDD_INIT_WITH_RTNL_LOCK \
+ -DMWS_COEX
ifneq ($(CONFIG_HIF_USB), 1)
CDEFINES += -DWLAN_LOGGING_SOCK_SVC_ENABLE
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 82bb498d48c4..be5b2b61593e 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -14827,6 +14827,58 @@ enum hw_filter_mode {
#define CFG_ENABLE_SECONDARY_RATE_MAX (0x3F)
#define CFG_ENABLE_SECONDARY_RATE_DEFAULT (0x17)
+#ifdef MWS_COEX
+/*
+ * <ini>
+ * gMwsCoex4gQuickTdm - Bitmap to control MWS-COEX 4G quick FTDM policy
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * It is a 32 bit value such that the various bits represent as below:
+ * Bit-0 : 0 - Don't allow quick FTDM policy (Default)
+ * 1 - Allow quick FTDM policy
+ * Bit 1-31 : reserved for future use
+ *
+ * It is used to enable or disable MWS-COEX 4G (LTE) Quick FTDM
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+
+#define CFG_MWS_COEX_4G_QUICK_FTDM_NAME "gMwsCoex4gQuickTdm"
+#define CFG_MWS_COEX_4G_QUICK_FTDM_MIN (0x00000000)
+#define CFG_MWS_COEX_4G_QUICK_FTDM_MAX (0xFFFFFFFF)
+#define CFG_MWS_COEX_4G_QUICK_FTDM_DEFAULT (0x00000000)
+
+/*
+ * <ini>
+ * gMwsCoex5gnrPwrLimit - Bitmap to set MWS-COEX 5G-NR power limit
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * It is a 32 bit value such that the various bits represent as below:
+ * Bit-0 : Don't apply user specific power limit,
+ * use internal power limit (Default)
+ * Bit 1-2 : Invalid value (Ignored)
+ * Bit 3-21 : Apply the specified value as the external power limit, in dBm
+ * Bit 22-31 : Invalid value (Ignored)
+ *
+ * It is used to set MWS-COEX 5G-NR power limit
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+
+#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_NAME "gMwsCoex5gnrPwrLimit"
+#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_MIN (0x00000000)
+#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_MAX (0xFFFFFFFF)
+#define CFG_MWS_COEX_5G_NR_PWR_LIMIT_DEFAULT (0x00000000)
+#endif
+
/*---------------------------------------------------------------------------
Type declarations
-------------------------------------------------------------------------*/
@@ -14897,6 +14949,14 @@ struct hdd_config {
/* Bitmap for operating voltage corner mode */
uint32_t vc_mode_cfg_bitmap;
+#ifdef MWS_COEX
+ /* Bitmap for MWS-COEX 4G Quick FTDM */
+ u32 g_mws_coex_4g_quick_tdm;
+
+ /* Bitmap for MWS-COEX 5G-NR power limit */
+ u32 g_mws_coex_5g_nr_pwr_limit;
+#endif
+
uint16_t nNeighborScanPeriod;
uint16_t neighbor_scan_min_period;
uint8_t nNeighborLookupRssiThreshold;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 3dcc8fa68eb6..97aa3d9d268a 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -5619,6 +5619,20 @@ struct reg_table_entry g_registry_table[] = {
CFG_ROAM_FORCE_RSSI_TRIGGER_MIN,
CFG_ROAM_FORCE_RSSI_TRIGGER_MAX),
+#ifdef MWS_COEX
+ REG_VARIABLE(CFG_MWS_COEX_4G_QUICK_FTDM_NAME, WLAN_PARAM_HexInteger,
+ struct hdd_config, g_mws_coex_4g_quick_tdm,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_MWS_COEX_4G_QUICK_FTDM_DEFAULT,
+ CFG_MWS_COEX_4G_QUICK_FTDM_MIN,
+ CFG_MWS_COEX_4G_QUICK_FTDM_MAX),
+ REG_VARIABLE(CFG_MWS_COEX_5G_NR_PWR_LIMIT_NAME, WLAN_PARAM_HexInteger,
+ struct hdd_config, g_mws_coex_5g_nr_pwr_limit,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_MWS_COEX_5G_NR_PWR_LIMIT_DEFAULT,
+ CFG_MWS_COEX_5G_NR_PWR_LIMIT_MIN,
+ CFG_MWS_COEX_5G_NR_PWR_LIMIT_MAX),
+#endif
};
/**
@@ -6561,6 +6575,29 @@ static void hdd_cfg_print_sae(hdd_context_t *hdd_ctx)
}
#endif
+#ifdef MWS_COEX
+/**
+ * hdd_cfg_print_mws_coex() - Print MWS-COEX parameters
+ * @hdd_ctx: Pointer to HDD context
+ *
+ * Return: None
+ */
+static void hdd_cfg_print_mws_coex(hdd_context_t *hdd_ctx)
+{
+ hdd_debug("Name = [%s] Value = [%u]",
+ CFG_MWS_COEX_4G_QUICK_FTDM_NAME,
+ hdd_ctx->config->g_mws_coex_4g_quick_tdm);
+
+ hdd_debug("Name = [%s] Value = [%u]",
+ CFG_MWS_COEX_5G_NR_PWR_LIMIT_NAME,
+ hdd_ctx->config->g_mws_coex_5g_nr_pwr_limit);
+}
+#else
+static void hdd_cfg_print_mws_coex(hdd_context_t *hdd_ctx)
+{
+}
+#endif
+
/**
* hdd_cfg_print() - print the hdd configuration
* @iniTable: pointer to hdd context
@@ -7523,7 +7560,7 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
hdd_debug("Name = [%s] Value = [%u]",
CFG_ROAM_FORCE_RSSI_TRIGGER_NAME,
pHddCtx->config->roam_force_rssi_trigger);
-
+ hdd_cfg_print_mws_coex(pHddCtx);
}
/**
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 5a5d4e00ad49..a85fc3f3ced1 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -10264,6 +10264,53 @@ static int hdd_set_auto_shutdown_cb(hdd_context_t *hdd_ctx)
}
#endif
+#ifdef MWS_COEX
+/**
+ * hdd_set_mws_coex() - Set MWS coex configurations
+ * @adapter: HDD adapter
+ *
+ * This function sends MWS-COEX 4G quick FTDM and
+ * MWS-COEX 5G-NR power limit to FW
+ *
+ * Return: 0 on success and errno on failure.
+ */
+static int hdd_init_mws_coex(hdd_adapter_t *adapter)
+{
+ int ret = 0;
+ hdd_context_t *hdd_ctx;
+
+ if (!adapter) {
+ hdd_err("Invalid Param");
+ return -EINVAL;
+ }
+ hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+
+ ret = sme_cli_set_command(adapter->sessionId,
+ WMI_PDEV_PARAM_MWSCOEX_4G_ALLOW_QUICK_FTDM,
+ hdd_ctx->config->g_mws_coex_4g_quick_tdm,
+ PDEV_CMD);
+ if (ret) {
+ hdd_warn("Unable to send MWS-COEX 4G quick FTDM policy");
+ return ret;
+ }
+
+ ret = sme_cli_set_command(adapter->sessionId,
+ WMI_PDEV_PARAM_MWSCOEX_SET_5GNR_PWR_LIMIT,
+ hdd_ctx->config->g_mws_coex_5g_nr_pwr_limit,
+ PDEV_CMD);
+ if (ret) {
+ hdd_warn("Unable to send MWS-COEX 4G quick FTDM policy");
+ return ret;
+ }
+ return ret;
+}
+#else
+static int hdd_init_mws_coex(hdd_adapter_t *adapter)
+{
+ return 0;
+}
+#endif
+
/**
* hdd_features_init() - Init features
* @hdd_ctx: HDD context
@@ -10332,6 +10379,12 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
goto out;
}
+ ret = hdd_init_mws_coex(adapter);
+ if (ret) {
+ hdd_err("Error initializing mws-coex");
+ goto out;
+ }
+
/* FW capabilities received, Set the Dot11 mode */
sme_setdef_dot11mode(hdd_ctx->hHal);
sme_set_prefer_80MHz_over_160MHz(hdd_ctx->hHal,