فهرست منبع

qcacld-3.0: Refactor stats cfg items

Refactor following stats cfg items
CFG_PERIODIC_STATS_DISPLAY_TIME
CFG_LINK_SPEED_RSSI_MID
CFG_REPORT_MAX_LINK_SPEED
CFG_LINK_SPEED_RSSI_LOW
CFG_LINK_SPEED_RSSI_HIGH

Change-Id: I1b699d5fe5b3182c292cf10c85f842169bf14342
CRs-Fixed: 2362068
Arif Hussain 6 سال پیش
والد
کامیت
cca6043ce0

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

@@ -1270,6 +1270,21 @@ static void mlme_init_sta_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_STA_KEEPALIVE_METHOD);
 }
 
+static void mlme_init_stats_cfg(struct wlan_objmgr_psoc *psoc,
+				struct wlan_mlme_stats_cfg *stats)
+{
+	stats->stats_periodic_display_time =
+		cfg_get(psoc, CFG_PERIODIC_STATS_DISPLAY_TIME);
+	stats->stats_link_speed_rssi_high =
+		cfg_get(psoc, CFG_LINK_SPEED_RSSI_HIGH);
+	stats->stats_link_speed_rssi_med =
+		cfg_get(psoc, CFG_LINK_SPEED_RSSI_MID);
+	stats->stats_link_speed_rssi_low =
+		cfg_get(psoc, CFG_LINK_SPEED_RSSI_LOW);
+	stats->stats_report_max_link_speed_rssi =
+		cfg_get(psoc, CFG_REPORT_MAX_LINK_SPEED);
+}
+
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 static void mlme_init_roam_offload_cfg(struct wlan_objmgr_psoc *psoc,
 				       struct wlan_mlme_lfr_cfg *lfr)
@@ -1986,6 +2001,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 	mlme_init_product_details_cfg(&mlme_cfg->product_details);
 	mlme_init_powersave_params(psoc, &mlme_cfg->ps_params);
 	mlme_init_sta_cfg(psoc, &mlme_cfg->sta);
+	mlme_init_stats_cfg(psoc, &mlme_cfg->stats);
 	mlme_init_twt_cfg(psoc, &mlme_cfg->twt_cfg);
 	mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr);
 	mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags);

+ 2 - 0
components/mlme/dispatcher/inc/cfg_mlme.h

@@ -45,6 +45,7 @@
 #include "cfg_mlme_fe_wmm.h"
 #include "cfg_mlme_powersave.h"
 #include "cfg_mlme_sap.h"
+#include "cfg_mlme_stats.h"
 #include "cfg_mlme_twt.h"
 #include "cfg_mlme_scoring.h"
 #include "cfg_mlme_oce.h"
@@ -87,6 +88,7 @@
 	CFG_SAP_PROTECTION_ALL \
 	CFG_SCORING_ALL \
 	CFG_STA_ALL \
+	CFG_STATS_ALL \
 	CFG_THRESHOLD_ALL \
 	CFG_TIMEOUT_ALL \
 	CFG_TWT_ALL \

+ 162 - 0
components/mlme/dispatcher/inc/cfg_mlme_stats.h

@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2012-2018 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains centralized definitions of converged configuration.
+ */
+
+#ifndef __CFG_MLME_STATS_H
+#define __CFG_MLME_STATS_H
+
+enum mlme_stats_link_speed_rpt_type {
+	CFG_STATS_LINK_SPEED_REPORT_ACTUAL = 0,
+	CFG_STATS_LINK_SPEED_REPORT_MAX = 1,
+	CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED = 2,
+};
+
+/*
+ * <ini>
+ * periodic_stats_display_time - time(seconds) after which stats will be printed
+ * @Min: 0
+ * @Max: 256
+ * @Default: 10
+ *
+ * This values specifies the recurring time period after which stats will be
+ * printed in wlan driver logs.
+ *
+ * Usage: Internal / External
+ *
+ * </ini>
+ */
+#define CFG_PERIODIC_STATS_DISPLAY_TIME CFG_INI_UINT( \
+		"periodic_stats_display_time", \
+		0, \
+		256, \
+		10, \
+		CFG_VALUE_OR_DEFAULT, \
+		"time after which stats will be printed")
+
+/*
+ * <ini>
+ * gLinkSpeedRssiMed - Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
+ * @Min: -127
+ * @Max: 0
+ * @Default: -65
+ *
+ * This ini is used to set medium rssi link speed
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal / External
+ *
+ * </ini>
+ */
+#define CFG_LINK_SPEED_RSSI_MID CFG_INI_INT( \
+		"gLinkSpeedRssiMed", \
+		-127, \
+		0, \
+		-65, \
+		CFG_VALUE_OR_DEFAULT, \
+		"medium rssi link speed")
+
+/*
+ * <ini>
+ * gReportMaxLinkSpeed - Max link speed
+ * @Min: CFG_STATS_LINK_SPEED_REPORT_ACTUAL
+ * @Max: CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED
+ * @Default: CFG_STATS_LINK_SPEED_REPORT_ACTUAL
+ *
+ * This ini is used to set Max link speed
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal / External
+ *
+ * </ini>
+ */
+#define CFG_REPORT_MAX_LINK_SPEED CFG_INI_UINT( \
+		"gReportMaxLinkSpeed", \
+		CFG_STATS_LINK_SPEED_REPORT_ACTUAL, \
+		CFG_STATS_LINK_SPEED_REPORT_ACTUAL, \
+		CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Max link speed")
+
+/*
+ * <ini>
+ * gLinkSpeedRssiLow - Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
+ * @Min: -127
+ * @Max: 0
+ * @Default: -80
+ *
+ * This ini is used to set low rssi link speed
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal / External
+ *
+ * </ini>
+ */
+#define CFG_LINK_SPEED_RSSI_LOW CFG_INI_INT( \
+		"gLinkSpeedRssiLow", \
+		-127, \
+		0, \
+		-80, \
+		CFG_VALUE_OR_DEFAULT, \
+		"low rssi link speed")
+
+/*
+ * <ini>
+ * gLinkSpeedRssiHigh - Report the max possible speed with RSSI scaling
+ * @Min: -127
+ * @Max: 0
+ * @Default: -55
+ *
+ * This ini is used to set default eHDD_LINK_SPEED_REPORT
+ * Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal / External
+ *
+ * </ini>
+ */
+#define CFG_LINK_SPEED_RSSI_HIGH CFG_INI_INT( \
+		"gLinkSpeedRssiHigh", \
+		-127, \
+		0, \
+		-55, \
+		CFG_VALUE_OR_DEFAULT, \
+		"max possible rssi link speed")
+
+#define CFG_STATS_ALL \
+	CFG(CFG_PERIODIC_STATS_DISPLAY_TIME) \
+	CFG(CFG_LINK_SPEED_RSSI_HIGH) \
+	CFG(CFG_LINK_SPEED_RSSI_MID) \
+	CFG(CFG_LINK_SPEED_RSSI_LOW) \
+	CFG(CFG_REPORT_MAX_LINK_SPEED)
+
+#endif /* __CFG_MLME_STATS_H */

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

@@ -1136,6 +1136,22 @@ struct wlan_mlme_sta_cfg {
 	enum station_keepalive_method sta_keepalive_method;
 };
 
+/**
+ * struct wlan_mlme_stats_cfg - MLME stats configuration items
+ * @stats_periodic_display_time: time after which stats will be printed
+ * @stats_link_speed_rssi_high: rssi link speed, high
+ * @stats_link_speed_rssi_med: medium rssi link speed
+ * @stats_link_speed_rssi_low: rssi link speed, low
+ * @stats_report_max_link_speed_rssi: report speed limit
+ */
+struct wlan_mlme_stats_cfg {
+	uint32_t stats_periodic_display_time;
+	int stats_link_speed_rssi_high;
+	int stats_link_speed_rssi_med;
+	int stats_link_speed_rssi_low;
+	uint32_t stats_report_max_link_speed_rssi;
+};
+
 /**
  * enum roaming_dfs_channel_type - Allow dfs channel in roam
  * @CFG_ROAMING_DFS_CHANNEL_DISABLED:   Disallow dfs channel in roam
@@ -1804,6 +1820,7 @@ struct wlan_mlme_reg {
  * @sap_cfg: sap CFG items
  * @nss_chains_ini_cfg: Per vdev nss, chains related CFG items
  * @sta: sta CFG Items
+ * @stats: stats CFG Items
  * @scoring: BSS Scoring related CFG Items
  * @oce: OCE related CFG items
  * @threshold: threshold related cfg items
@@ -1843,6 +1860,7 @@ struct wlan_mlme_cfg {
 	struct wlan_mlme_cfg_sap sap_cfg;
 	struct wlan_mlme_nss_chains nss_chains_ini_cfg;
 	struct wlan_mlme_sta_cfg sta;
+	struct wlan_mlme_stats_cfg stats;
 	struct wlan_mlme_scoring_cfg scoring;
 	struct wlan_mlme_oce oce;
 	struct wlan_mlme_threshold threshold;

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

@@ -2484,6 +2484,64 @@ QDF_STATUS
 ucfg_mlme_get_sta_keepalive_method(struct wlan_objmgr_psoc *psoc,
 				   enum station_keepalive_method *val);
 
+/**
+ * ucfg_mlme_stats_get_periodic_display_time() - get display time
+ * @psoc: pointer to psoc object
+ * @periodic_display_time: buffer to hold value
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
+					  uint32_t *periodic_display_time);
+
+/**
+ * ucfg_mlme_stats_get_cfg_values() - get stats cfg values
+ * @psoc: pointer to psoc object
+ * @link_speed_rssi_high: link speed high limit
+ * @link_speed_rssi_mid: link speed high mid
+ * @link_speed_rssi_low: link speed high low
+ * @link_speed_rssi_report: link speed report limit
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_stats_get_cfg_values(struct wlan_objmgr_psoc *psoc,
+			       int *link_speed_rssi_high,
+			       int *link_speed_rssi_mid,
+			       int *link_speed_rssi_low,
+			       uint32_t *link_speed_rssi_report);
+
+/**
+ * ucfg_mlme_stats_is_link_speed_report_actual() - is link speed report set
+ * actual
+ * @psoc: pointer to psoc object
+ *
+ * Return: True is report set to actual
+ */
+bool
+ucfg_mlme_stats_is_link_speed_report_actual(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_mlme_stats_is_link_speed_report_max() - is link speed report set
+ * max
+ * @psoc: pointer to psoc object
+ *
+ * Return: True is report set to max
+ */
+bool
+ucfg_mlme_stats_is_link_speed_report_max(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_mlme_stats_is_link_speed_report_max_scaled() - is link speed report set
+ * max scaled
+ * @psoc: pointer to psoc object
+ *
+ * Return: True is report set to max scaled
+ */
+bool
+ucfg_mlme_stats_is_link_speed_report_max_scaled(struct wlan_objmgr_psoc *psoc);
+
 /**
  * ucfg_mlme_get_wmm_dir_ac_vi() - Get TSPEC direction
  * for VI

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

@@ -1116,6 +1116,105 @@ ucfg_mlme_set_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS
+ucfg_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
+					  uint32_t *periodic_display_time)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*periodic_display_time =
+			cfg_default(CFG_PERIODIC_STATS_DISPLAY_TIME);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*periodic_display_time =
+		mlme_obj->cfg.stats.stats_periodic_display_time;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_stats_get_cfg_values(struct wlan_objmgr_psoc *psoc,
+			       int *link_speed_rssi_high,
+			       int *link_speed_rssi_mid,
+			       int *link_speed_rssi_low,
+			       uint32_t *link_speed_rssi_report)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*link_speed_rssi_high =
+			cfg_default(CFG_LINK_SPEED_RSSI_HIGH);
+		*link_speed_rssi_mid =
+			cfg_default(CFG_LINK_SPEED_RSSI_MID);
+		*link_speed_rssi_low =
+			cfg_default(CFG_LINK_SPEED_RSSI_LOW);
+		*link_speed_rssi_report =
+			cfg_default(CFG_REPORT_MAX_LINK_SPEED);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*link_speed_rssi_high =
+		mlme_obj->cfg.stats.stats_link_speed_rssi_high;
+	*link_speed_rssi_mid =
+		mlme_obj->cfg.stats.stats_link_speed_rssi_med;
+	*link_speed_rssi_low =
+		mlme_obj->cfg.stats.stats_link_speed_rssi_low;
+	*link_speed_rssi_report =
+		mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+bool ucfg_mlme_stats_is_link_speed_report_actual(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+	int report_link_speed = 0;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		report_link_speed = cfg_default(CFG_REPORT_MAX_LINK_SPEED);
+	else
+		report_link_speed =
+			mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
+
+	return (report_link_speed == CFG_STATS_LINK_SPEED_REPORT_ACTUAL);
+}
+
+bool ucfg_mlme_stats_is_link_speed_report_max(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+	int report_link_speed = 0;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		report_link_speed = cfg_default(CFG_REPORT_MAX_LINK_SPEED);
+	else
+		report_link_speed =
+			mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
+
+	return (report_link_speed == CFG_STATS_LINK_SPEED_REPORT_MAX);
+}
+
+bool
+ucfg_mlme_stats_is_link_speed_report_max_scaled(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+	int report_link_speed = 0;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		report_link_speed = cfg_default(CFG_REPORT_MAX_LINK_SPEED);
+	else
+		report_link_speed =
+			mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
+
+	return (report_link_speed == CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED);
+}
+
 QDF_STATUS
 ucfg_mlme_get_ps_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
 					 uint32_t *inactivity_timeout)

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

@@ -1097,108 +1097,6 @@ enum hdd_dot11_mode {
 #define CFG_ENABLE_DFS_CHNL_SCAN_MAX               (1)
 #define CFG_ENABLE_DFS_CHNL_SCAN_DEFAULT           (1)
 
-enum hdd_link_speed_rpt_type {
-	eHDD_LINK_SPEED_REPORT_ACTUAL = 0,
-	eHDD_LINK_SPEED_REPORT_MAX = 1,
-	eHDD_LINK_SPEED_REPORT_MAX_SCALED = 2,
-};
-
-/*
- * <ini>
- * gReportMaxLinkSpeed - Reporting of max link speed
- * @Min: 0
- * @Max: 2
- * @Default: 0
- *
- * This ini is used to control how max link speed is reported to OS when
- * driver is handling NL80211_CMD_GET_STATION request.
- * 0: report actual link speed;
- * 1: report max possible link speed;
- * 2: report max possible link speed with RSSI scaling.
- *
- * Related: NA.
- *
- * Supported Feature SAP
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-#define CFG_REPORT_MAX_LINK_SPEED           "gReportMaxLinkSpeed"
-#define CFG_REPORT_MAX_LINK_SPEED_MIN       (eHDD_LINK_SPEED_REPORT_ACTUAL)
-#define CFG_REPORT_MAX_LINK_SPEED_MAX       (eHDD_LINK_SPEED_REPORT_MAX_SCALED)
-#define CFG_REPORT_MAX_LINK_SPEED_DEFAULT   (eHDD_LINK_SPEED_REPORT_ACTUAL)
-
-/*
- * <ini>
- * gLinkSpeedRssiHigh - Report the max possible speed with RSSI scaling
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to set default eHDD_LINK_SPEED_REPORT
- * Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_LINK_SPEED_RSSI_HIGH                   "gLinkSpeedRssiHigh"
-#define CFG_LINK_SPEED_RSSI_HIGH_MIN               (-127)
-#define CFG_LINK_SPEED_RSSI_HIGH_MAX               (0)
-#define CFG_LINK_SPEED_RSSI_HIGH_DEFAULT           (-55)
-
-/*
- * <ini>
- * gLinkSpeedRssiMed - Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
- * @Min: -127
- * @Max: 0
- * @Default: -65
- *
- * This ini is used to set medium rssi link speed
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_LINK_SPEED_RSSI_MID                    "gLinkSpeedRssiMed"
-#define CFG_LINK_SPEED_RSSI_MID_MIN                (-127)
-#define CFG_LINK_SPEED_RSSI_MID_MAX                (0)
-#define CFG_LINK_SPEED_RSSI_MID_DEFAULT            (-65)
-
-/*
- * <ini>
- * gLinkSpeedRssiLow - Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
- * @Min: -127
- * @Max: 0
- * @Default: -80
- *
- * This ini is used to set low rssi link speed
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_LINK_SPEED_RSSI_LOW                    "gLinkSpeedRssiLow"
-#define CFG_LINK_SPEED_RSSI_LOW_MIN                (-127)
-#define CFG_LINK_SPEED_RSSI_LOW_MAX                (0)
-#define CFG_LINK_SPEED_RSSI_LOW_DEFAULT            (-80)
-
 #ifdef ENABLE_MTRACE_LOG
 /*
  * Enable MTRACE for all modules
@@ -1239,28 +1137,6 @@ enum hdd_link_speed_rpt_type {
 #define CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT         (60) /*60 SEC */
 #endif
 
-#ifdef MSM_PLATFORM
-/*
- * <ini>
- * periodic_stats_display_time - time(seconds) after which stats will be printed
- * @Min: 0
- * @Max: 256
- * @Default: 10
- *
- * This values specifies the recurring time period after which stats will be
- * printed in wlan driver logs.
- *
- * Usage: Internal / External
- *
- * </ini>
- */
-#define CFG_PERIODIC_STATS_DISPLAY_TIME_NAME       "periodic_stats_display_time"
-#define CFG_PERIODIC_STATS_DISPLAY_TIME_DEFAULT    (10)
-#define CFG_PERIODIC_STATS_DISPLAY_TIME_MIN        (0)
-#define CFG_PERIODIC_STATS_DISPLAY_TIME_MAX        (256)
-
-#endif /* MSM_PLATFORM */
-
 #ifdef DHCP_SERVER_OFFLOAD
 #define CFG_DHCP_SERVER_IP_NAME     "gDHCPServerIP"
 #define CFG_DHCP_SERVER_IP_DEFAULT  ""
@@ -1592,56 +1468,6 @@ enum hdd_link_speed_rpt_type {
 #define CFG_HE_STA_OBSSPD_DEFAULT (0x15b8c2ae)
 
 #endif /* WLAN_FEATURE_11AX */
-#ifdef WLAN_SUPPORT_TWT
-/*
- * <ini>
- * enable_twt - Enable Target Wake Time support.
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to enable or disable TWT support.
- *
- * Related: NA
- *
- * Supported Feature: 11AX
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_ENABLE_TWT_NAME    "enable_twt"
-#define CFG_ENABLE_TWT_MIN     (0)
-#define CFG_ENABLE_TWT_MAX     (1)
-#define CFG_ENABLE_TWT_DEFAULT (1)
-
-/*
- * <ini>
- * twt_congestion_timeout - Target wake time congestion timeout.
- * @Min: 0
- * @Max: 10000
- * @Default: 100
- *
- * STA uses this timer to continuously monitor channel congestion levels to
- * decide whether to start or stop TWT. This ini is used to configure the
- * target wake time congestion timeout value in the units of milliseconds.
- * A value of Zero indicates that this is a host triggered TWT and all the
- * necessary configuration for TWT will be directed from the host.
- *
- * Related: NA
- *
- * Supported Feature: 11AX
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_TWT_CONGESTION_TIMEOUT_NAME    "twt_congestion_timeout"
-#define CFG_TWT_CONGESTION_TIMEOUT_MIN     (0)
-#define CFG_TWT_CONGESTION_TIMEOUT_MAX     (10000)
-#define CFG_TWT_CONGESTION_TIMEOUT_DEFAULT (100)
-
-#endif /* WLAN_SUPPORT_TWT */
 
 /*
  * <ini>
@@ -2148,10 +1974,6 @@ struct hdd_config {
 #endif
 	uint8_t enableDFSChnlScan;
 	uint8_t enable_dfs_pno_chnl_scan;
-	enum hdd_link_speed_rpt_type reportMaxLinkSpeed;
-	int32_t linkSpeedRssiHigh;
-	int32_t linkSpeedRssiMid;
-	int32_t linkSpeedRssiLow;
 	bool prevent_link_down;
 	uint8_t scanAgingTimeout;
 	bool fEnableSNRMonitoring;
@@ -2214,10 +2036,6 @@ struct hdd_config {
 	bool enable_ul_mimo;
 	bool enable_ul_ofdma;
 	uint32_t he_sta_obsspd;
-#endif
-#ifdef WLAN_SUPPORT_TWT
-	bool enable_twt;
-	uint32_t twt_congestion_timeout;
 #endif
 	bool tx_orphan_enable;
 
@@ -2287,7 +2105,6 @@ struct hdd_config {
 	uint32_t tcp_tx_high_tput_thres;
 	uint32_t tcp_delack_timer_count;
 	bool     enable_tcp_param_update;
-	u8  periodic_stats_disp_time;
 #endif /* MSM_PLATFORM */
 #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
 	uint32_t tx_flow_low_watermark;

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

@@ -153,42 +153,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ENABLE_DFS_PNO_CHNL_SCAN_MIN,
 		     CFG_ENABLE_DFS_PNO_CHNL_SCAN_MAX),
 
-	REG_DYNAMIC_VARIABLE(CFG_REPORT_MAX_LINK_SPEED, WLAN_PARAM_Integer,
-			     struct hdd_config, reportMaxLinkSpeed,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_REPORT_MAX_LINK_SPEED_DEFAULT,
-			     CFG_REPORT_MAX_LINK_SPEED_MIN,
-			     CFG_REPORT_MAX_LINK_SPEED_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_LINK_SPEED_RSSI_HIGH, WLAN_PARAM_SignedInteger,
-			     struct hdd_config, linkSpeedRssiHigh,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_HIGH_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_HIGH_MIN,
-			     CFG_LINK_SPEED_RSSI_HIGH_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_LINK_SPEED_RSSI_MID, WLAN_PARAM_SignedInteger,
-			     struct hdd_config, linkSpeedRssiMid,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_MID_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_MID_MIN,
-			     CFG_LINK_SPEED_RSSI_MID_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_LINK_SPEED_RSSI_LOW, WLAN_PARAM_SignedInteger,
-			     struct hdd_config, linkSpeedRssiLow,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_LOW_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_LOW_MIN,
-			     CFG_LINK_SPEED_RSSI_LOW_MAX,
-			     NULL, 0),
-
 	REG_VARIABLE(CFG_SCAN_AGING_PARAM_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, scanAgingTimeout,
 		     VAR_FLAGS_OPTIONAL,
@@ -312,15 +276,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ADVERTISE_CONCURRENT_OPERATION_MIN,
 		     CFG_ADVERTISE_CONCURRENT_OPERATION_MAX),
 
-#ifdef MSM_PLATFORM
-	REG_VARIABLE(CFG_PERIODIC_STATS_DISPLAY_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, periodic_stats_disp_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PERIODIC_STATS_DISPLAY_TIME_DEFAULT,
-		     CFG_PERIODIC_STATS_DISPLAY_TIME_MIN,
-		     CFG_PERIODIC_STATS_DISPLAY_TIME_MAX),
-#endif
-
 #ifdef DHCP_SERVER_OFFLOAD
 	REG_VARIABLE_STRING(CFG_DHCP_SERVER_IP_NAME, WLAN_PARAM_String,
 			    struct hdd_config, dhcpServerIP,
@@ -526,22 +481,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_HE_STA_OBSSPD_MIN,
 		     CFG_HE_STA_OBSSPD_MAX),
 #endif
-#ifdef WLAN_SUPPORT_TWT
-	REG_VARIABLE(CFG_ENABLE_TWT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_twt,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_TWT_DEFAULT,
-		     CFG_ENABLE_TWT_MIN,
-		     CFG_ENABLE_TWT_MAX),
-
-	REG_VARIABLE(CFG_TWT_CONGESTION_TIMEOUT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, twt_congestion_timeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TWT_CONGESTION_TIMEOUT_DEFAULT,
-		     CFG_TWT_CONGESTION_TIMEOUT_MIN,
-		     CFG_TWT_CONGESTION_TIMEOUT_MAX),
-#endif
-
 	REG_VARIABLE(CFG_SCAN_BACKOFF_MULTIPLIER_NAME, WLAN_PARAM_Integer,
 		struct hdd_config, scan_backoff_multiplier,
 		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,

+ 5 - 2
core/hdd/src/wlan_hdd_main.c

@@ -7677,8 +7677,11 @@ static void hdd_display_periodic_stats(struct hdd_context *hdd_ctx,
 	static bool data_in_time_period;
 	ol_txrx_pdev_handle pdev;
 	ol_txrx_soc_handle soc;
+	uint32_t periodic_stats_disp_time = 0;
 
-	if (hdd_ctx->config->periodic_stats_disp_time == 0)
+	ucfg_mlme_stats_get_periodic_display_time(hdd_ctx->psoc,
+						  &periodic_stats_disp_time);
+	if (!periodic_stats_disp_time)
 		return;
 
 	soc = cds_get_context(QDF_MODULE_ID_SOC);
@@ -7698,7 +7701,7 @@ static void hdd_display_periodic_stats(struct hdd_context *hdd_ctx,
 		data_in_time_period = data_in_interval;
 
 	if (counter * hdd_ctx->config->bus_bw_compute_interval >=
-		hdd_ctx->config->periodic_stats_disp_time * 1000) {
+		periodic_stats_disp_time * 1000) {
 		if (data_in_time_period) {
 			wlan_hdd_display_txrx_stats(hdd_ctx);
 			dp_txrx_ext_dump_stats(soc);

+ 66 - 40
core/hdd/src/wlan_hdd_stats.c

@@ -3474,34 +3474,43 @@ static void hdd_fill_station_info_flags(struct station_info *sinfo)
 
 /**
  * hdd_fill_rate_info() - fill rate info of sinfo
+ * @psoc: psoc context
  * @sinfo: station_info struct pointer
  * @stainfo: stainfo pointer
  * @stats: fw txrx status pointer
- * @cfg: hdd config pointer
  *
  * This function will fill rate info of sinfo
  *
  * Return: None
  */
-static void hdd_fill_rate_info(struct station_info *sinfo,
+static void hdd_fill_rate_info(struct wlan_objmgr_psoc *psoc,
+			       struct station_info *sinfo,
 			       struct hdd_station_info *stainfo,
-			       struct hdd_fw_txrx_stats *stats,
-			       struct hdd_config *cfg)
+			       struct hdd_fw_txrx_stats *stats)
 {
 	uint8_t rate_flags;
 	uint8_t mcsidx = 0xff;
 	uint32_t myrate, maxrate, tmprate;
 	int rssidx;
 	int nss = 1;
-
-	hdd_info("reportMaxLinkSpeed %d", cfg->reportMaxLinkSpeed);
-
+	int link_speed_rssi_high = 0;
+	int link_speed_rssi_mid = 0;
+	int link_speed_rssi_low = 0;
+	uint32_t link_speed_rssi_report = 0;
+
+	ucfg_mlme_stats_get_cfg_values(psoc,
+				       &link_speed_rssi_high,
+				       &link_speed_rssi_mid,
+				       &link_speed_rssi_low,
+				       &link_speed_rssi_report);
+
+	hdd_info("reportMaxLinkSpeed %d", link_speed_rssi_report);
 	/* convert to 100kbps expected in rate table */
 	myrate = stats->tx_rate.rate / 100;
 	rate_flags = stainfo->rate_flags;
 	if (!(rate_flags & TX_RATE_LEGACY)) {
 		nss = stainfo->nss;
-		if (eHDD_LINK_SPEED_REPORT_ACTUAL == cfg->reportMaxLinkSpeed) {
+		if (ucfg_mlme_stats_is_link_speed_report_actual(psoc)) {
 			/* Get current rate flags if report actual */
 			if (stats->tx_rate.rate_flags)
 				rate_flags =
@@ -3513,23 +3522,21 @@ static void hdd_fill_rate_info(struct station_info *sinfo,
 			rate_flags = TX_RATE_LEGACY;
 	}
 
-	if (eHDD_LINK_SPEED_REPORT_ACTUAL != cfg->reportMaxLinkSpeed) {
+	if (!ucfg_mlme_stats_is_link_speed_report_actual(psoc)) {
 		/* we do not want to necessarily report the current speed */
-		if (eHDD_LINK_SPEED_REPORT_MAX == cfg->reportMaxLinkSpeed) {
+		if (ucfg_mlme_stats_is_link_speed_report_max(psoc)) {
 			/* report the max possible speed */
 			rssidx = 0;
-		} else if (eHDD_LINK_SPEED_REPORT_MAX_SCALED ==
-				cfg->reportMaxLinkSpeed) {
+		} else if (ucfg_mlme_stats_is_link_speed_report_max_scaled(
+					psoc)) {
 			/* report the max possible speed with RSSI scaling */
-			if (stats->rssi >= cfg->linkSpeedRssiHigh) {
+			if (stats->rssi >= link_speed_rssi_high) {
 				/* report the max possible speed */
 				rssidx = 0;
-			} else if (stats->rssi >=
-					cfg->linkSpeedRssiMid) {
+			} else if (stats->rssi >= link_speed_rssi_mid) {
 				/* report middle speed */
 				rssidx = 1;
-			} else if (stats->rssi >=
-					cfg->linkSpeedRssiLow) {
+			} else if (stats->rssi >= link_speed_rssi_low) {
 				/* report middle speed */
 				rssidx = 2;
 			} else {
@@ -3539,7 +3546,7 @@ static void hdd_fill_rate_info(struct station_info *sinfo,
 		} else {
 			/* unknown, treat as eHDD_LINK_SPEED_REPORT_MAX */
 			hdd_err("Invalid value for reportMaxLinkSpeed: %u",
-				cfg->reportMaxLinkSpeed);
+				link_speed_rssi_report);
 			rssidx = 0;
 		}
 
@@ -3618,19 +3625,19 @@ static void hdd_fill_rate_info(struct station_info *sinfo,
 
 /**
  * wlan_hdd_fill_station_info() - fill station_info struct
+ * @psoc: psoc context
  * @sinfo: station_info struct pointer
  * @stainfo: stainfo pointer
  * @stats: fw txrx status pointer
- * @cfg: hdd config pointer
  *
  * This function will fill station_info struct
  *
  * Return: None
  */
-static void wlan_hdd_fill_station_info(struct station_info *sinfo,
+static void wlan_hdd_fill_station_info(struct wlan_objmgr_psoc *psoc,
+				       struct station_info *sinfo,
 				       struct hdd_station_info *stainfo,
-				       struct hdd_fw_txrx_stats *stats,
-				       struct hdd_config *cfg)
+				       struct hdd_fw_txrx_stats *stats)
 {
 	qdf_time_t curr_time, dur;
 
@@ -3648,7 +3655,7 @@ static void wlan_hdd_fill_station_info(struct station_info *sinfo,
 	sinfo->tx_retries = stats->tx_retries;
 
 	/* tx rate info */
-	hdd_fill_rate_info(sinfo, stainfo, stats, cfg);
+	hdd_fill_rate_info(psoc, sinfo, stainfo, stats);
 
 	hdd_fill_station_info_flags(sinfo);
 
@@ -3929,7 +3936,8 @@ int wlan_hdd_get_station_remote(struct wiphy *wiphy,
 		peer_info.rssi + WLAN_HDD_TGT_NOISE_FLOOR_DBM;
 	wlan_hdd_fill_rate_info(ap_ctx, &peer_info);
 
-	wlan_hdd_fill_station_info(sinfo, stainfo, &ap_ctx->txrx_stats, cfg);
+	wlan_hdd_fill_station_info(hddctx->psoc, sinfo, stainfo,
+				   &ap_ctx->txrx_stats);
 
 	return status;
 }
@@ -3939,7 +3947,6 @@ int wlan_hdd_get_station_remote(struct wiphy *wiphy,
  * to be sent to the userspace.
  *
  * @mac_handle: The mac handle
- * @config: The HDD config structure
  * @sinfo: The station_info struct to be filled
  * @tx_rate_flags: The TX rate flags computed from tx rate
  * @tx_mcs_index; The TX mcs index computed from tx rate
@@ -3949,7 +3956,6 @@ int wlan_hdd_get_station_remote(struct wiphy *wiphy,
  * Return: 0 for success
  */
 static int hdd_report_max_rate(mac_handle_t mac_handle,
-			       struct hdd_config *config,
 			       struct station_info *sinfo,
 			       uint8_t tx_rate_flags,
 			       uint8_t tx_mcs_index,
@@ -3974,6 +3980,10 @@ static int hdd_report_max_rate(mac_handle_t mac_handle,
 	int mode = 0, max_ht_idx;
 	QDF_STATUS stat = QDF_STATUS_E_FAILURE;
 	struct hdd_context *hdd_ctx;
+	int link_speed_rssi_high = 0;
+	int link_speed_rssi_mid = 0;
+	int link_speed_rssi_low = 0;
+	uint32_t link_speed_rssi_report = 0;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	if (!hdd_ctx) {
@@ -3981,20 +3991,26 @@ static int hdd_report_max_rate(mac_handle_t mac_handle,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	ucfg_mlme_stats_get_cfg_values(hdd_ctx->psoc,
+				       &link_speed_rssi_high,
+				       &link_speed_rssi_mid,
+				       &link_speed_rssi_low,
+				       &link_speed_rssi_report);
+
 	/* we do not want to necessarily report the current speed */
-	if (eHDD_LINK_SPEED_REPORT_MAX == config->reportMaxLinkSpeed) {
+	if (ucfg_mlme_stats_is_link_speed_report_max(hdd_ctx->psoc)) {
 		/* report the max possible speed */
 		rssidx = 0;
-	} else if (eHDD_LINK_SPEED_REPORT_MAX_SCALED ==
-		   config->reportMaxLinkSpeed) {
+	} else if (ucfg_mlme_stats_is_link_speed_report_max_scaled(
+				hdd_ctx->psoc)) {
 		/* report the max possible speed with RSSI scaling */
-		if (sinfo->signal >= config->linkSpeedRssiHigh) {
+		if (sinfo->signal >= link_speed_rssi_high) {
 			/* report the max possible speed */
 			rssidx = 0;
-		} else if (sinfo->signal >= config->linkSpeedRssiMid) {
+		} else if (sinfo->signal >= link_speed_rssi_mid) {
 			/* report middle speed */
 			rssidx = 1;
-		} else if (sinfo->signal >= config->linkSpeedRssiLow) {
+		} else if (sinfo->signal >= link_speed_rssi_low) {
 			/* report middle speed */
 			rssidx = 2;
 		} else {
@@ -4004,7 +4020,7 @@ static int hdd_report_max_rate(mac_handle_t mac_handle,
 	} else {
 		/* unknown, treat as eHDD_LINK_SPEED_REPORT_MAX */
 		hdd_err("Invalid value for reportMaxLinkSpeed: %u",
-			config->reportMaxLinkSpeed);
+			link_speed_rssi_report);
 		rssidx = 0;
 	}
 
@@ -4365,13 +4381,16 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 	uint8_t rate_flags, tx_rate_flags, rx_rate_flags;
 	uint8_t tx_mcs_index, rx_mcs_index;
 	struct hdd_context *hdd_ctx = (struct hdd_context *) wiphy_priv(wiphy);
-	struct hdd_config *pCfg = hdd_ctx->config;
 	mac_handle_t mac_handle;
 	uint16_t maxRate = 0;
 	int8_t snr = 0;
 	uint16_t my_tx_rate, my_rx_rate;
 	uint8_t tx_nss = 1, rx_nss = 1;
 	int32_t rcpi_value;
+	int link_speed_rssi_high = 0;
+	int link_speed_rssi_mid = 0;
+	int link_speed_rssi_low = 0;
+	uint32_t link_speed_rssi_report = 0;
 
 	if (eConnectionState_Associated != sta_ctx->conn_info.connState) {
 		hdd_debug("Not associated");
@@ -4391,6 +4410,12 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 		return 0;
 	}
 
+	ucfg_mlme_stats_get_cfg_values(hdd_ctx->psoc,
+				       &link_speed_rssi_high,
+				       &link_speed_rssi_mid,
+				       &link_speed_rssi_low,
+				       &link_speed_rssi_report);
+
 	if (hdd_ctx->rcpi_enabled)
 		wlan_hdd_get_rcpi(adapter, (uint8_t *)mac, &rcpi_value,
 				  RCPI_MEASUREMENT_TYPE_AVG_MGMT);
@@ -4457,7 +4482,8 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 			rx_nss--;
 		}
 
-		if (eHDD_LINK_SPEED_REPORT_ACTUAL == pCfg->reportMaxLinkSpeed) {
+		if (ucfg_mlme_stats_is_link_speed_report_actual(
+					hdd_ctx->psoc)) {
 			/* Get current rate flags if report actual */
 			/* WMA fails to find mcs_index for legacy tx rates */
 			if (tx_mcs_index == INVALID_MCS_IDX && my_tx_rate)
@@ -4480,9 +4506,9 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 	}
 
 	hdd_debug("RSSI %d, RLMS %u, rssi high %d, rssi mid %d, rssi low %d",
-		  sinfo->signal, pCfg->reportMaxLinkSpeed,
-		  (int)pCfg->linkSpeedRssiHigh, (int)pCfg->linkSpeedRssiMid,
-		  (int)pCfg->linkSpeedRssiLow);
+		  sinfo->signal, link_speed_rssi_report,
+		  link_speed_rssi_high, link_speed_rssi_mid,
+		  link_speed_rssi_low);
 	hdd_debug("Rate info: TX: %d, RX: %d", my_tx_rate, my_rx_rate);
 	hdd_debug("Rate flags: TX: 0x%x, RX: 0x%x", (int)tx_rate_flags,
 		  (int)rx_rate_flags);
@@ -4493,8 +4519,8 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 	/* assume basic BW. anything else will override this later */
 	hdd_set_rate_bw(&sinfo->txrate, HDD_RATE_BW_20);
 
-	if (eHDD_LINK_SPEED_REPORT_ACTUAL != pCfg->reportMaxLinkSpeed) {
-		if (!hdd_report_max_rate(mac_handle, pCfg, sinfo,
+	if (!ucfg_mlme_stats_is_link_speed_report_actual(hdd_ctx->psoc)) {
+		if (!hdd_report_max_rate(mac_handle, sinfo,
 					 tx_rate_flags, tx_mcs_index,
 					 my_tx_rate, tx_nss)) {
 			/* Keep GUI happy */