From f3ea89016b9aeb891c57d4eb04a54834b461d940 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Tue, 14 Aug 2018 17:06:12 +0800 Subject: [PATCH] qcacmn: Indicate roc event to up layer for idle roc request It won't indicate roc event to up layer for idle roc request, which casue p2p listen command pending. Change-Id: I7a1c3c83411c63b790db1500a283d062dd87d63b CRs-Fixed: 2298546 --- umac/p2p/core/src/wlan_p2p_off_chan_tx.c | 5 +++++ umac/p2p/core/src/wlan_p2p_roc.c | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/umac/p2p/core/src/wlan_p2p_off_chan_tx.c b/umac/p2p/core/src/wlan_p2p_off_chan_tx.c index 849dafced0c8..275442a70850 100644 --- a/umac/p2p/core/src/wlan_p2p_off_chan_tx.c +++ b/umac/p2p/core/src/wlan_p2p_off_chan_tx.c @@ -1900,6 +1900,11 @@ QDF_STATUS p2p_process_mgmt_tx_cancel( struct p2p_roc_context *cur_roc_ctx; struct cancel_roc_context cancel_roc; + if (!cancel_tx || !(cancel_tx->cookie)) { + p2p_info("invalid cancel info"); + return QDF_STATUS_SUCCESS; + } + p2p_debug("cookie:0x%llx", cancel_tx->cookie); cur_tx_ctx = p2p_find_tx_ctx(cancel_tx->p2p_soc_obj, diff --git a/umac/p2p/core/src/wlan_p2p_roc.c b/umac/p2p/core/src/wlan_p2p_roc.c index c75bfdd28eab..13b85f291e6e 100644 --- a/umac/p2p/core/src/wlan_p2p_roc.c +++ b/umac/p2p/core/src/wlan_p2p_roc.c @@ -233,7 +233,8 @@ static QDF_STATUS p2p_destroy_roc_ctx(struct p2p_roc_context *roc_ctx, p2p_soc_obj, roc_ctx, up_layer_event, in_roc_queue); if (up_layer_event) { - p2p_send_roc_event(roc_ctx, ROC_EVENT_READY_ON_CHAN); + if (roc_ctx->roc_state < ROC_STATE_ON_CHAN) + p2p_send_roc_event(roc_ctx, ROC_EVENT_READY_ON_CHAN); p2p_send_roc_event(roc_ctx, ROC_EVENT_COMPLETED); } @@ -864,12 +865,7 @@ QDF_STATUS p2p_process_cancel_roc_req( } if (curr_roc_ctx->roc_state == ROC_STATE_IDLE) { - status = qdf_list_remove_node(&p2p_soc_obj->roc_q, - (qdf_list_node_t *)curr_roc_ctx); - if (status == QDF_STATUS_SUCCESS) - qdf_mem_free(curr_roc_ctx); - else - p2p_err("Failed to remove roc req, status %d", status); + status = p2p_destroy_roc_ctx(curr_roc_ctx, true, true); } else if (curr_roc_ctx->roc_state == ROC_STATE_CANCEL_IN_PROG) { p2p_debug("Receive cancel roc req when roc req is canceling, cookie %llx",