From 22d1bb4ea2ee032a9259434a55e3fd52077347d4 Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Wed, 8 Feb 2017 21:08:56 -0800 Subject: qcacld-3.0: Fix Rx throughput level calculation Currently the rx throughput level is getting set to TP_NONE immediately after it goes high. This will send incorrect values for tcp_adv_win_scaling to cnss-daemon. Fix the RX throuhgput level by making next_rx_level a static variable. Now if next_rx_level is calculated to be HIGH, it will stay HIGH until RX throughput falls below the threshold Change-Id: Iaa36e4ff6d846e29b3beadd998a3d6fd334c1a5b CRs-Fixed: 2004944 --- core/hdd/src/wlan_hdd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 120733650dae..71e9ab277871 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5384,7 +5384,7 @@ static void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, uint64_t temp_rx = 0; uint64_t temp_tx = 0; enum pld_bus_width_type next_vote_level = PLD_BUS_WIDTH_NONE; - enum wlan_tp_level next_rx_level = WLAN_SVC_TP_NONE; + static enum wlan_tp_level next_rx_level = WLAN_SVC_TP_NONE; enum wlan_tp_level next_tx_level = WLAN_SVC_TP_NONE; uint32_t delack_timer_cnt = hdd_ctx->config->tcp_delack_timer_count; uint16_t index = 0; @@ -5431,7 +5431,6 @@ static void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, hdd_ctx->prev_rx = rx_packets; - next_rx_level = WLAN_SVC_TP_LOW; if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh) { if ((hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH) && (++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) { @@ -5439,6 +5438,7 @@ static void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, } } else { hdd_ctx->rx_high_ind_cnt = 0; + next_rx_level = WLAN_SVC_TP_LOW; } if (hdd_ctx->cur_rx_level != next_rx_level) { -- cgit v1.2.3