From 702be3e4f19d79604e245648e91505fb4ec68f3e Mon Sep 17 00:00:00 2001 From: Venkata Sharath Chandra Manchala Date: Thu, 28 Mar 2019 12:24:39 -0700 Subject: [PATCH] qcacld-3.0: Handle memory allocation for rx threads appropriately Avoid allocating and initializing memory for rx threads when in monitor mode as they are not used. Change-Id: I7521697e3f7033e85fad0b416d8a34aab28755d5 CRs-Fixed: 2424812 --- core/hdd/src/wlan_hdd_tx_rx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index ee50ef024a401..fce8f6050252f 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -2902,6 +2902,9 @@ static void hdd_ini_tcp_settings(struct hdd_config *config, static void hdd_set_rx_mode_value(struct hdd_context *hdd_ctx) { uint32_t rx_mode = hdd_ctx->config->rx_mode; + enum QDF_GLOBAL_MODE con_mode = 0; + + con_mode = hdd_get_conparam(); /* RPS has higher priority than dynamic RPS when both bits are set */ if (rx_mode & CFG_ENABLE_RPS && rx_mode & CFG_ENABLE_DYNAMIC_RPS) @@ -2914,8 +2917,12 @@ static void hdd_set_rx_mode_value(struct hdd_context *hdd_ctx) if (rx_mode & CFG_ENABLE_RX_THREAD) hdd_ctx->enable_rxthread = true; - else if (rx_mode & CFG_ENABLE_DP_RX_THREADS) - hdd_ctx->enable_dp_rx_threads = true; + else if (rx_mode & CFG_ENABLE_DP_RX_THREADS) { + if (con_mode == QDF_GLOBAL_MONITOR_MODE) + hdd_ctx->enable_dp_rx_threads = false; + else + hdd_ctx->enable_dp_rx_threads = true; + } if (rx_mode & CFG_ENABLE_RPS) hdd_ctx->rps = true;