From 4c01170c3c7391d09c7deaa7b77ab0dd19e2fcf6 Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Tue, 20 Apr 2021 13:23:22 +0530 Subject: [PATCH] qcacld-3.0: Use separate request context for NAN and NDP Currently single request context is used for NAN discovery and NDP. If NAN disable request is sent to the FW and FW sends NDP end indication and didn't send NAN disable indication. In this case, wait event for NAN disable indication will be completed as part of NDP end indication. This is because same request context is used for both NAN discovery and NDP. To resolve this, use separate request for NAN discovery and NDP. Change-Id: Ic42e32c5cfd818188ca96d6cba3cbec1ed85a3ec CRs-Fixed: 2921287 --- components/nan/core/src/nan_main.c | 10 +++++----- components/nan/core/src/nan_main_i.h | 8 +++++--- components/nan/dispatcher/src/nan_ucfg_api.c | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/components/nan/core/src/nan_main.c b/components/nan/core/src/nan_main.c index a7efd8543b37..88ff2e851d45 100644 --- a/components/nan/core/src/nan_main.c +++ b/components/nan/core/src/nan_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -743,7 +743,7 @@ static QDF_STATUS nan_handle_ndp_end_rsp( /* Unblock the wait here if NDP_END request is a failure */ if (rsp->status != 0) { - request = osif_request_get(psoc_nan_obj->request_context); + request = osif_request_get(psoc_nan_obj->ndp_request_ctx); if (request) { osif_request_complete(request); osif_request_put(request); @@ -811,7 +811,7 @@ static QDF_STATUS nan_handle_end_ind( NDP_END_IND, ind); /* Unblock the NDP_END wait */ - request = osif_request_get(psoc_nan_obj->request_context); + request = osif_request_get(psoc_nan_obj->ndp_request_ctx); if (request) { osif_request_complete(request); osif_request_put(request); @@ -876,7 +876,7 @@ fail: done: call_back = psoc_nan_obj->cb_obj.ucfg_nan_request_process_cb; if (call_back) - call_back(psoc_nan_obj->request_context); + call_back(psoc_nan_obj->nan_disc_request_ctx); return QDF_STATUS_SUCCESS; } @@ -909,7 +909,7 @@ QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc) policy_mgr_decr_session_set_pcl(psoc, QDF_NAN_DISC_MODE, vdev_id); if (psoc_nan_obj->is_explicit_disable && call_back) - call_back(psoc_nan_obj->request_context); + call_back(psoc_nan_obj->nan_disc_request_ctx); policy_mgr_nan_sap_post_disable_conc_check(psoc); } else { diff --git a/components/nan/core/src/nan_main_i.h b/components/nan/core/src/nan_main_i.h index 6b56621cd1a7..4e0b76fc8bc4 100644 --- a/components/nan/core/src/nan_main_i.h +++ b/components/nan/core/src/nan_main_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -118,7 +118,8 @@ struct nan_cfg_params { * @nan_disc_mac_id: MAC id used for NAN Discovery * @is_explicit_disable: Flag to indicate that NAN is being explicitly * disabled by driver or user-space - * @request_context: NAN enable/disable request context + * @ndp_request_ctx: NDP request context + * @nan_disc_request_ctx: NAN discovery enable/disable request context */ struct nan_psoc_priv_obj { qdf_spinlock_t lock; @@ -132,7 +133,8 @@ struct nan_psoc_priv_obj { uint32_t nan_social_ch_5g_freq; uint8_t nan_disc_mac_id; bool is_explicit_disable; - void *request_context; + void *ndp_request_ctx; + void *nan_disc_request_ctx; }; /** diff --git a/components/nan/dispatcher/src/nan_ucfg_api.c b/components/nan/dispatcher/src/nan_ucfg_api.c index dd3b8e3ff5e3..c44700e32c7d 100644 --- a/components/nan/dispatcher/src/nan_ucfg_api.c +++ b/components/nan/dispatcher/src/nan_ucfg_api.c @@ -461,14 +461,14 @@ QDF_STATUS ucfg_nan_req_processor(struct wlan_objmgr_vdev *vdev, nan_err("Request allocation failure"); return QDF_STATUS_E_NOMEM; } - psoc_obj->request_context = osif_request_cookie(request); + psoc_obj->ndp_request_ctx = osif_request_cookie(request); nan_debug("Wait for NDP END indication"); err = osif_request_wait_for_response(request); if (err) nan_debug("NAN request timed out: %d", err); osif_request_put(request); - psoc_obj->request_context = NULL; + psoc_obj->ndp_request_ctx = NULL; } return QDF_STATUS_SUCCESS; @@ -760,7 +760,7 @@ QDF_STATUS ucfg_nan_discovery_req(void *in_req, uint32_t req_type) return QDF_STATUS_E_NOMEM; } - psoc_priv->request_context = osif_request_cookie(request); + psoc_priv->nan_disc_request_ctx = osif_request_cookie(request); if (req_type == NAN_DISABLE_REQ) psoc_priv->is_explicit_disable = true;