From ec685dbcda84dce2ab8ec993c76f242e8a3d6b15 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 13 Sep 2017 16:14:34 -0700 Subject: [PATCH] qcacld-3.0: Correctly call wlansap_cancel_remain_on_channel() Over time the wlansap() APIs changed from being passed the global context to being passed the SAP context. Apparently two invocations of wlansap_cancel_remain_on_channel() were not correctly updated, so update them. Change-Id: I53c54c639ed2695439e4f5cf506e7f23732ab8de CRs-Fixed: 2109408 --- core/hdd/src/wlan_hdd_p2p.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 2a890f55c7db..eaafb2872710 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -450,11 +450,11 @@ static void wlan_hdd_cancel_pending_roc(struct hdd_adapter *adapter) mutex_unlock(&cfg_state->remain_on_chan_ctx_lock); if (adapter->device_mode == QDF_P2P_GO_MODE) { - wlansap_cancel_remain_on_channel((WLAN_HDD_GET_CTX - (adapter))->pcds_context, roc_scan_id); - } else if (adapter->device_mode == QDF_P2P_CLIENT_MODE - || adapter->device_mode == - QDF_P2P_DEVICE_MODE) { + void *sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter); + + wlansap_cancel_remain_on_channel(sap_ctx, roc_scan_id); + } else if (adapter->device_mode == QDF_P2P_CLIENT_MODE || + adapter->device_mode == QDF_P2P_DEVICE_MODE) { sme_cancel_remain_on_channel(WLAN_HDD_GET_HAL_CTX (adapter), adapter->sessionId, roc_scan_id); @@ -570,16 +570,14 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) if ((QDF_STA_MODE == pAdapter->device_mode) || (QDF_P2P_CLIENT_MODE == pAdapter->device_mode) || - (QDF_P2P_DEVICE_MODE == pAdapter->device_mode) - ) { + (QDF_P2P_DEVICE_MODE == pAdapter->device_mode)) { sme_cancel_remain_on_channel(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, roc_scan_id); } else if ((QDF_SAP_MODE == pAdapter->device_mode) || - (QDF_P2P_GO_MODE == pAdapter->device_mode) - ) { - wlansap_cancel_remain_on_channel( - (WLAN_HDD_GET_CTX(pAdapter))->pcds_context, - roc_scan_id); + (QDF_P2P_GO_MODE == pAdapter->device_mode)) { + void *sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(pAdapter); + + wlansap_cancel_remain_on_channel(sap_ctx, roc_scan_id); } hdd_tdls_notify_p2p_roc(hdd_ctx, P2P_ROC_END);