From ba6006ec38b874452ff927a0c88ded3a2ae27644 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Sun, 21 Apr 2019 23:50:13 -0400 Subject: [PATCH] qcacld-3.0: Set MCC quota for STA+CLI Set MCC quota is mainly for miracast p2p interface when STA+CLI or STA+GO. Change the condition checking to consider the other (SAP) existing but not start, to avoid set quota failure. Change-Id: I2acfd2bf86991d884c40657dfdd027a235df1270 CRs-Fixed: 2439269 --- core/hdd/src/wlan_hdd_p2p.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index ebbc61e06a531..a623be7e971b4 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1339,6 +1339,8 @@ int wlan_hdd_set_mcc_p2p_quota(struct hdd_adapter *adapter, int32_t ret = 0; uint32_t concurrent_state; struct hdd_context *hdd_ctx; + uint32_t sta_cli_bit_mask = QDF_STA_MASK | QDF_P2P_CLIENT_MASK; + uint32_t sta_go_bit_mask = QDF_STA_MASK | QDF_P2P_GO_MASK; if (!adapter) { hdd_err("Invalid adapter"); @@ -1356,9 +1358,8 @@ int wlan_hdd_set_mcc_p2p_quota(struct hdd_adapter *adapter, * Check if concurrency mode is active. * Need to modify this code to support MCC modes other than STA/P2P */ - if ((concurrent_state == - (QDF_STA_MASK | QDF_P2P_CLIENT_MASK)) || - (concurrent_state == (QDF_STA_MASK | QDF_P2P_GO_MASK))) { + if (((concurrent_state & sta_cli_bit_mask) == sta_cli_bit_mask) || + ((concurrent_state & sta_go_bit_mask) == sta_go_bit_mask)) { hdd_info("STA & P2P are both enabled"); /* @@ -1375,7 +1376,6 @@ int wlan_hdd_set_mcc_p2p_quota(struct hdd_adapter *adapter, set_value = set_first_connection_operating_channel( hdd_ctx, set_value, adapter->device_mode); - set_value = set_second_connection_operating_channel( hdd_ctx, set_value, adapter->vdev_id); @@ -1398,6 +1398,8 @@ void wlan_hdd_set_mcc_latency(struct hdd_adapter *adapter, int set_value) { uint32_t concurrent_state; struct hdd_context *hdd_ctx; + uint32_t sta_cli_bit_mask = QDF_STA_MASK | QDF_P2P_CLIENT_MASK; + uint32_t sta_go_bit_mask = QDF_STA_MASK | QDF_P2P_GO_MASK; if (!adapter) { hdd_err("Invalid adapter"); @@ -1416,9 +1418,8 @@ void wlan_hdd_set_mcc_latency(struct hdd_adapter *adapter, int set_value) * Check if concurrency mode is active. * Need to modify this code to support MCC modes other than STA/P2P */ - if ((concurrent_state == - (QDF_STA_MASK | QDF_P2P_CLIENT_MASK)) || - (concurrent_state == (QDF_STA_MASK | QDF_P2P_GO_MASK))) { + if (((concurrent_state & sta_cli_bit_mask) == sta_cli_bit_mask) || + ((concurrent_state & sta_go_bit_mask) == sta_go_bit_mask)) { hdd_info("STA & P2P are both enabled"); /* * The channel number and latency are formatted in