From ff6addf320d81c1ed892d9b206d4a723a0853791 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 13 Sep 2017 10:06:03 -0700 Subject: [PATCH] qcacld-3.0: Remove wma_open() cds_ctx parameter Currently wma_open() takes a cds_ctx parameter. All of the other WMA functions which previously took a cds_ctx no longer use that parameter, and those functions have been modified to remove the unused parameter. wma_open() still needs the cds_ctx, but it can get that context by calling cds_get_global_context(), so remove the cds_ctx parameter to be consistent with the other WMA functions. Note: the fact that wma_open() needs the cds_ctx, and then dereferences it, is a layering violation that needs to be addressed in the future. Change-Id: I176e2ac68cc2e8081645a4ce3c158b41d3018587 CRs-Fixed: 2109263 --- core/cds/src/cds_api.c | 3 +-- core/wma/inc/wma_types.h | 2 +- core/wma/src/wma_main.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 2410a8af8aa0..e9578f01a79c 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -531,8 +531,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) } /*Open the WMA module */ - qdf_status = wma_open(psoc, gp_cds_context, - hdd_update_tgt_cfg, cds_cfg); + qdf_status = wma_open(psoc, hdd_update_tgt_cfg, cds_cfg); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { /* Critical Error ... Cannot proceed further */ diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 0bfc7905d399..62949d44771d 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -713,7 +713,7 @@ QDF_STATUS wma_tx_packet(void *pWMA, uint8_t txFlag, uint8_t sessionId, bool tdlsflag, uint16_t channel_freq); -QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *p_cds_context, +QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, wma_tgt_cfg_cb pTgtUpdCB, struct cds_config_info *cds_cfg); /** diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index bbcdff337947..5f57fb6cd799 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2208,13 +2208,12 @@ void wma_vdev_deinit(struct wma_txrx_node *vdev) /** * wma_open() - Allocate wma context and initialize it. * @psoc: Psoc pointer - * @cds_context: cds context * @wma_tgt_cfg_cb: tgt config callback fun * @cds_cfg: mac parameters * * Return: 0 on success, errno on failure */ -QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context, +QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, wma_tgt_cfg_cb tgt_cfg_cb, struct cds_config_info *cds_cfg) { @@ -2228,9 +2227,16 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context, struct target_psoc_info *tgt_psoc_info; bool use_cookie = false; int i; + void *cds_context; WMA_LOGD("%s: Enter", __func__); + cds_context = cds_get_global_context(); + if (!cds_context) { + WMA_LOGE("%s: Invalid CDS context", __func__); + return QDF_STATUS_E_INVAL; + } + g_wmi_version_info.major = __WMI_VER_MAJOR_; g_wmi_version_info.minor = __WMI_VER_MINOR_; g_wmi_version_info.revision = __WMI_REVISION_;