Преглед изворни кода

qcacld-3.0: Skip special frame rate info update

To avoid unmeaningful rate fluctuation, when report
rx linkspeed to upper layer, exclude special frames:
arp/ssdp/dhcp/eapol/ipv6 NA/NS/DHCPV6 in low rate.

Change-Id: Ie8989dde506c654525099f9d154abe93162a0bac
CRs-Fixed: 3199636
jinbliu пре 2 година
родитељ
комит
95d8c151df

+ 9 - 1
Kbuild

@@ -2129,7 +2129,8 @@ DP_INC := -I$(WLAN_COMMON_INC)/dp/inc \
 	-I$(WLAN_COMMON_INC)/dp/wifi3.0 \
 	-I$(WLAN_COMMON_INC)/target_if/dp/inc \
 	-I$(WLAN_COMMON_INC)/dp/wifi3.0/monitor \
-	-I$(WLAN_COMMON_INC)/dp/wifi3.0/monitor/1.0
+	-I$(WLAN_COMMON_INC)/dp/wifi3.0/monitor/1.0 \
+	-I$(WLAN_COMMON_INC)/dp/cmn_dp_api
 
 DP_SRC := $(WLAN_COMMON_ROOT)/dp/wifi3.0
 DP_OBJS := $(DP_SRC)/dp_main.o \
@@ -2156,6 +2157,8 @@ DP_OBJS += $(DP_SRC)/monitor/dp_mon.o \
 		$(DP_SRC)/monitor/1.0/dp_mon_1.0.o
 endif
 
+DP_OBJS += $(DP_SRC)/../cmn_dp_api/dp_ratetable.o
+
 ifeq ($(CONFIG_BERYLLIUM), y)
 DP_OBJS += $(DP_SRC)/be/dp_be.o
 DP_OBJS += $(DP_SRC)/be/dp_be_tx.o
@@ -4373,6 +4376,11 @@ cppflags-y += -DCONFIG_CHAN_FREQ_API
 #Flag to enable/disable MCC specific feature regarding unallowed phymodes
 cppflags-y += -DCHECK_REG_PHYMODE
 
+cppflags-$(CONFIG_FEATURE_RX_LINKSPEED_ROAM_TRIGGER) += -DFEATURE_RX_LINKSPEED_ROAM_TRIGGER
+#DP_RATETABLE_SUPPORT is enabled when CONFIG_FEATURE_RX_LINKSPEED_ROAM_TRIGGER is enabled
+cppflags-$(CONFIG_FEATURE_RX_LINKSPEED_ROAM_TRIGGER) += -DDP_RATETABLE_SUPPORT
+ccflags-y += -DALL_POSSIBLE_RATES_SUPPORTED=1
+
 cppflags-$(CONFIG_BAND_6GHZ) += -DCONFIG_BAND_6GHZ
 cppflags-$(CONFIG_6G_SCAN_CHAN_SORT_ALGO) += -DFEATURE_6G_SCAN_CHAN_SORT_ALGO
 cppflags-y += -DCONFIG_REG_6G_PWRMODE

+ 1 - 0
configs/default_defconfig

@@ -153,6 +153,7 @@ ifeq (y,$(findstring y,$(CONFIG_LITHIUM) $(CONFIG_BERYLLIUM)))
 	CONFIG_DDP_MON_RSSI_IN_DBM := y
 	CONFIG_SYSTEM_PM_CHECK := y
 	CONFIG_DISABLE_EAPOL_INTRABSS_FWD := y
+	CONFIG_FEATURE_RX_LINKSPEED_ROAM_TRIGGER := y
 endif
 
 ifeq ($(CONFIG_CLD_HL_SDIO_CORE), y)

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

@@ -10882,6 +10882,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 	bool is_rx_pm_qos_high;
 	bool is_tx_pm_qos_high;
 	enum tput_level tput_level;
+	bool is_tput_level_high;
 	struct bbm_params param = {0};
 	bool legacy_client = false;
 	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
@@ -11051,6 +11052,9 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 		if (!hdd_ctx->pm_qos_request)
 			hdd_pm_qos_update_request(hdd_ctx,
 						  &pm_qos_cpu_mask);
+		is_tput_level_high =
+			tput_level >= TPUT_LEVEL_HIGH ? true : false;
+		cdp_set_bus_vote_lvl_high(soc, is_tput_level_high);
 	}
 
 	if (vote_level_change || tx_level_change || rx_level_change) {
@@ -17279,6 +17283,7 @@ static void __hdd_bus_bw_compute_timer_stop(struct hdd_context *hdd_ctx)
 {
 	struct bbm_params param = {0};
 	bool is_any_adapter_conn = hdd_is_any_adapter_connected(hdd_ctx);
+	ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE)
 		return;
@@ -17296,6 +17301,8 @@ static void __hdd_bus_bw_compute_timer_stop(struct hdd_context *hdd_ctx)
 				      OL_TXRX_PDEV_ID);
 	cdp_pdev_reset_bundle_require_flag(cds_get_context(QDF_MODULE_ID_SOC),
 					   OL_TXRX_PDEV_ID);
+
+	cdp_set_bus_vote_lvl_high(soc, false);
 	hdd_ctx->bw_vote_time = 0;
 
 exit:

+ 2 - 0
core/hdd/src/wlan_hdd_station_info.c

@@ -2237,6 +2237,8 @@ static int hdd_get_station_info_ex(struct hdd_context *hdd_ctx,
 	if (wlan_hdd_get_station_stats(adapter))
 		hdd_err_rl("wlan_hdd_get_station_stats fail");
 
+	wlan_hdd_get_peer_rx_rate_stats(adapter);
+
 	if (big_data_stats_req) {
 		if (wlan_hdd_get_big_data_station_stats(adapter)) {
 			hdd_err_rl("wlan_hdd_get_big_data_station_stats fail");

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

@@ -5997,6 +5997,8 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
 
 	wlan_hdd_get_station_stats(adapter);
 
+	wlan_hdd_get_peer_rx_rate_stats(adapter);
+
 	adapter->rssi = adapter->hdd_stats.summary_stat.rssi;
 	snr = adapter->hdd_stats.summary_stat.snr;
 
@@ -7237,6 +7239,44 @@ int wlan_hdd_get_link_speed(struct hdd_adapter *adapter, uint32_t *link_speed)
 	return 0;
 }
 
+#ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER
+void wlan_hdd_get_peer_rx_rate_stats(struct hdd_adapter *adapter)
+{
+	struct cdp_peer_stats *peer_stats;
+	QDF_STATUS status;
+	ol_txrx_soc_handle soc;
+	uint8_t *peer_mac_addr;
+
+	soc = cds_get_context(QDF_MODULE_ID_SOC);
+
+	/*
+	 *  If througput is high, do not get rx rate
+	 *  info to avoid the performance penalty
+	 */
+	if (cdp_get_bus_lvl_high(soc) == true)
+		return;
+
+	peer_stats = qdf_mem_malloc(sizeof(*peer_stats));
+	if (!peer_stats)
+		return;
+
+	peer_mac_addr = adapter->session.station.conn_info.bssid.bytes;
+
+	status = cdp_host_get_peer_stats(soc,
+					 adapter->vdev_id,
+					 peer_mac_addr,
+					 peer_stats);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		qdf_mem_free(peer_stats);
+		osif_err("cdp_host_get_peer_stats failed. error: %d", status);
+		return;
+	}
+
+	adapter->hdd_stats.class_a_stat.rx_rate = peer_stats->rx.last_rx_rate;
+	qdf_mem_free(peer_stats);
+}
+#endif
+
 int wlan_hdd_get_station_stats(struct hdd_adapter *adapter)
 {
 	int ret = 0;

+ 21 - 0
core/hdd/src/wlan_hdd_stats.h

@@ -489,6 +489,27 @@ int wlan_hdd_get_linkspeed_for_peermac(struct hdd_adapter *adapter,
  */
 int wlan_hdd_get_link_speed(struct hdd_adapter *adapter, uint32_t *link_speed);
 
+#ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER
+/**
+ * wlan_hdd_get_peer_rx_rate_stats() - STA gets rx rate stats
+ * @adapter: adapter upon which the measurement is requested
+ *
+ * STA gets rx rate stats through using the existed API
+ * cdp_host_get_peer_stats. The reason that we make this
+ * function is to avoid being disrupted by the flag
+ * "get_station_fw_request_needed"
+ *
+ * Return: void
+ */
+void
+wlan_hdd_get_peer_rx_rate_stats(struct hdd_adapter *adapter);
+#else
+static inline void
+wlan_hdd_get_peer_rx_rate_stats(struct hdd_adapter *adapter)
+{
+}
+#endif
+
 /**
  * wlan_hdd_get_station_stats() - Get station statistics
  * @adapter: adapter for which statistics are desired

+ 5 - 1
core/hdd/src/wlan_hdd_wext.c

@@ -7723,7 +7723,11 @@ static int iw_set_packet_filter_params(struct net_device *dev,
 
 static int hdd_get_wlan_stats(struct hdd_adapter *adapter)
 {
-	return wlan_hdd_get_station_stats(adapter);
+	int stats = wlan_hdd_get_station_stats(adapter);
+
+	wlan_hdd_get_peer_rx_rate_stats(adapter);
+
+	return stats;
 }
 
 static int __iw_get_statistics(struct net_device *dev,