Explorar el Código

qcacld-3.0: Add support for sifs burst duration ini

qcacld-2.0 to qcacld-3.0 propagation.

Add code for implementing sifs burst duration ini to be sent to be FW
as part of WMI_PDEV_PARAM_BURST_DUR command.

Change-Id: I96ccda760045ecd54592b649116f3e7fe4a4f31b
CRs-Fixed: 1028623
(cherry picked from commit 7a367f1535299b73d1886529e0a557853d943518)
Manjeet Singh hace 8 años
padre
commit
e7ecb7cbb8

+ 11 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -3491,6 +3491,15 @@ enum dot11p_mode {
 #define CFG_FILTER_MULTICAST_REPLAY_MAX      (1)
 #define CFG_FILTER_MULTICAST_REPLAY_DEFAULT  (1)
 
+/*
+ * This parameter will control SIFS burst duration in FW from 0 to 12 ms.
+ * Default value is set to 8ms.
+ */
+#define CFG_SIFS_BURST_DURATION_NAME     "g_sifs_burst_duration"
+#define CFG_SIFS_BURST_DURATION_MIN      (0)
+#define CFG_SIFS_BURST_DURATION_MAX      (12)
+#define CFG_SIFS_BURST_DURATION_DEFAULT  (8)
+
 
 /*---------------------------------------------------------------------------
    Type declarations
@@ -4151,6 +4160,8 @@ struct hdd_config {
 	enum cfg_sub_20_channel_width enable_sub_20_channel_width;
 	bool indoor_channel_support;
 	bool multicast_replay_filter;
+	/* parameter for indicating sifs burst duration to fw */
+	uint8_t sifs_burst_duration;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

+ 4 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -241,6 +241,10 @@
 #define HDD_MIN_TX_POWER (-100) /* minimum tx power */
 #define HDD_MAX_TX_POWER (+100) /* maximum tx power */
 
+/* FW expects burst duration in 1020*ms */
+#define SIFS_BURST_DUR_MULTIPLIER 1020
+#define SIFS_BURST_DUR_MAX        12240
+
 /* If IPA UC data path is enabled, target should reserve extra tx descriptors
  * for IPA data path.
  * Then host data path should allow less TX packet pumping in case

+ 7 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -4003,6 +4003,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		CFG_FILTER_MULTICAST_REPLAY_DEFAULT,
 		CFG_FILTER_MULTICAST_REPLAY_MIN,
 		CFG_FILTER_MULTICAST_REPLAY_MAX),
+
+	REG_VARIABLE(CFG_SIFS_BURST_DURATION_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, sifs_burst_duration,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_SIFS_BURST_DURATION_DEFAULT,
+		     CFG_SIFS_BURST_DURATION_MIN,
+		     CFG_SIFS_BURST_DURATION_MAX),
 };
 
 /**

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

@@ -7410,6 +7410,7 @@ int hdd_wlan_startup(struct device *dev)
 	int ret;
 	void *hif_sc;
 	bool rtnl_held;
+	int set_value;
 
 	ENTER();
 
@@ -7524,6 +7525,15 @@ int hdd_wlan_startup(struct device *dev)
 	if (hdd_ctx->config->fIsImpsEnabled)
 		hdd_set_idle_ps_config(hdd_ctx, true);
 
+	if (hdd_ctx->config->sifs_burst_duration) {
+		set_value = (SIFS_BURST_DUR_MULTIPLIER) *
+			hdd_ctx->config->sifs_burst_duration;
+
+		if ((set_value > 0) && (set_value <= SIFS_BURST_DUR_MAX))
+			wma_cli_set_command(0, (int)WMI_PDEV_PARAM_BURST_DUR,
+					    set_value, PDEV_CMD);
+	}
+
 	qdf_mc_timer_start(&hdd_ctx->iface_change_timer,
 			   hdd_ctx->config->iface_change_wait_time * 5000);
 	goto success;