From 2d15eaf50742f076f60bcea2844855c2705eb877 Mon Sep 17 00:00:00 2001 From: liubin7 Date: Sat, 30 Nov 2019 10:36:54 +0800 Subject: [PATCH] use bt_coex_mode_set to deterministically signify the DHCP start / Stop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the current infrastructure , “setPowerSave false” is known for DHCP start and “setPowerSave true” for DHCP stop. Thus, the BT Coex will give preference to Wi-Fi during this period of DHCP start – stop. This setPowerSave false / true interface is not only triggered on DHCP start / stop but this is also a public API which can be triggered by the applications when they want the Wi-Fi system to go in to WIFI_MODE_FULL_HIGH_PERF. Thus , the “setpowersave false“ will be triggered but not the corresponding “true” . As a result , the BT Coex module shall assume that the DHCP is still in progress and keeps giving preference to Wi-Fi. and WifiNative.setBluetoothCoexistenceMode() is invoked only when DHCP start & stop, hence we can use bt_coex_mode_set to deterministically signify the DHCP start / Stop and send DHCP start / stop indication to FW Change-Id: If5cca595aec22b7a10af4b127a5f75118d1ddc26 Signed-off-by: liubin7 Reviewed-on: https://gerrit.mot.com/1464100 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Submit-Approved: Jira Key --- core/hdd/src/wlan_hdd_power.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 7099e39b2498..bdf3f1344a25 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2621,8 +2621,10 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, if (hdd_adapter_is_connected_sta(adapter)) { hdd_debug("vdev mode %d enable dhcp protection", adapter->device_mode); - allow_power_save ? hdd_stop_dhcp_ind(adapter) : - hdd_start_dhcp_ind(adapter); + if ( hdd_ctx->bt_coex_mode_set ) { + allow_power_save ? hdd_stop_dhcp_ind(adapter) : + hdd_start_dhcp_ind(adapter); + } } else { hdd_debug("vdev mod %d disconnected ignore dhcp protection", adapter->device_mode);