diff --git a/components/ocb/core/inc/wlan_ocb_main.h b/components/ocb/core/inc/wlan_ocb_main.h index ad0618024a48..e392a9e0d114 100644 --- a/components/ocb/core/inc/wlan_ocb_main.h +++ b/components/ocb/core/inc/wlan_ocb_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 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 @@ -82,7 +82,7 @@ enum ocb_southbound_event { * @ocb_channel_count: channel count * @channel_config: current channel configurations * @dp_soc: psoc data path handle - * @dp_pdev: pdev data path handle + * @dp_pdev_id: pdev data path ID * @ocb_cbs: legacy callback functions * @ocb_txops: tx opertions for target interface * @ocb_rxops: rx opertions for target interface @@ -93,7 +93,7 @@ struct ocb_pdev_obj { uint32_t ocb_channel_count; struct ocb_config *channel_config; void *dp_soc; - void *dp_pdev; + uint8_t dp_pdev_id; struct ocb_callbacks ocb_cbs; struct wlan_ocb_tx_ops ocb_txops; struct wlan_ocb_rx_ops ocb_rxops; diff --git a/components/ocb/core/src/wlan_ocb_main.c b/components/ocb/core/src/wlan_ocb_main.c index cc1e31309aa0..c5fc09c428aa 100644 --- a/components/ocb/core/src/wlan_ocb_main.c +++ b/components/ocb/core/src/wlan_ocb_main.c @@ -92,7 +92,7 @@ static QDF_STATUS ocb_set_chan_info(void *dp_soc, ocb_set_chan.ocb_channel_count = config->channel_count; /* release old settings */ - ocb_channel_info = cdp_get_ocb_chan_info(dp_soc, dp_vdev); + ocb_channel_info = cdp_get_ocb_chan_info(dp_soc, vdev_id); if (ocb_channel_info) qdf_mem_free(ocb_channel_info); @@ -118,7 +118,7 @@ static QDF_STATUS ocb_set_chan_info(void *dp_soc, ocb_set_chan.ocb_channel_info = NULL; } ocb_debug("Sync channel config to dp"); - cdp_set_ocb_chan_info(dp_soc, dp_vdev, ocb_set_chan); + cdp_set_ocb_chan_info(dp_soc, vdev_id, ocb_set_chan); return QDF_STATUS_SUCCESS; } diff --git a/components/ocb/dispatcher/inc/wlan_ocb_ucfg_api.h b/components/ocb/dispatcher/inc/wlan_ocb_ucfg_api.h index de90f5b2a29d..121c2a25948b 100644 --- a/components/ocb/dispatcher/inc/wlan_ocb_ucfg_api.h +++ b/components/ocb/dispatcher/inc/wlan_ocb_ucfg_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 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 @@ -194,14 +194,14 @@ QDF_STATUS ucfg_ocb_update_dp_handle(struct wlan_objmgr_psoc *soc, void *dp_soc); /** - * ucfg_ocb_set_txrx_handle() - register pdev txrx handler + * ucfg_ocb_set_txrx_pdev_id() - register txrx pdev id * @soc: soc handle - * @txrx_handle: data path pdev txrx handle + * @pdev_id: data path pdev ID * * Return: QDF_STATUS_SUCCESS on success */ -QDF_STATUS ucfg_ocb_set_txrx_handle(struct wlan_objmgr_psoc *psoc, - void *txrx_handle); +QDF_STATUS ucfg_ocb_set_txrx_pdev_id(struct wlan_objmgr_psoc *psoc, + uint8_t pdev_id); #else /** * ucfg_ocb_init() - OCB module initialization @@ -274,15 +274,15 @@ QDF_STATUS ucfg_ocb_update_dp_handle(struct wlan_objmgr_psoc *soc, } /** - * ucfg_ocb_set_txrx_handle() - register pdev txrx handler + * ucfg_ocb_set_txrx_pdev_id() - register txrx pdev id * @soc: soc handle - * @txrx_handle: data path pdev txrx handle + * @pdev_id: data path pdev ID * * Return: QDF_STATUS_SUCCESS on success */ static inline -QDF_STATUS ucfg_ocb_set_txrx_handle(struct wlan_objmgr_psoc *psoc, - void *txrx_handle) +QDF_STATUS ucfg_ocb_set_txrx_pdev_id(struct wlan_objmgr_psoc *psoc, + uint8_t pdev_id) { return QDF_STATUS_SUCCESS; } diff --git a/components/ocb/dispatcher/src/wlan_ocb_ucfg_api.c b/components/ocb/dispatcher/src/wlan_ocb_ucfg_api.c index de87d31e6b3f..d16af6c855ae 100644 --- a/components/ocb/dispatcher/src/wlan_ocb_ucfg_api.c +++ b/components/ocb/dispatcher/src/wlan_ocb_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 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 @@ -133,8 +133,8 @@ QDF_STATUS ocb_psoc_disable(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } -QDF_STATUS ucfg_ocb_set_txrx_handle(struct wlan_objmgr_psoc *psoc, - void *txrx_handle) +QDF_STATUS ucfg_ocb_set_txrx_pdev_id(struct wlan_objmgr_psoc *psoc, + uint8_t pdev_id) { struct wlan_objmgr_pdev *pdev; struct ocb_pdev_obj *ocb_obj; @@ -151,7 +151,7 @@ QDF_STATUS ucfg_ocb_set_txrx_handle(struct wlan_objmgr_psoc *psoc, ocb_err("OCB object is NULL"); return QDF_STATUS_E_FAILURE; } - ocb_obj->dp_pdev = txrx_handle; + ocb_obj->dp_pdev_id = pdev_id; return QDF_STATUS_SUCCESS; } diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index e4f6231d175e..6300c14a1720 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -817,7 +817,7 @@ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc) goto intr_close; ucfg_pmo_psoc_set_txrx_handle(psoc, gp_cds_context->pdev_txrx_ctx); - ucfg_ocb_set_txrx_handle(psoc, gp_cds_context->pdev_txrx_ctx); + ucfg_ocb_set_txrx_pdev_id(psoc, WMI_PDEV_ID_SOC); cds_debug("CDS successfully Opened"); diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index b2b30f4c00c5..c3c95c06606c 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -2687,15 +2687,23 @@ ol_txrx_remove_peers_for_vdev_no_lock(struct cdp_vdev *pvdev, #ifdef WLAN_FEATURE_DSRC /** * ol_txrx_set_ocb_chan_info() - set OCB channel info to vdev. - * @vdev: vdev handle + * @soc_hdl: Datapath soc handle + * @vdev_id: id of vdev * @ocb_set_chan: OCB channel information to be set in vdev. * * Return: NONE */ -static void ol_txrx_set_ocb_chan_info(struct cdp_vdev *pvdev, +static void +ol_txrx_set_ocb_chan_info(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, struct ol_txrx_ocb_set_chan ocb_set_chan) { - struct ol_txrx_vdev_t *vdev = (struct ol_txrx_vdev_t *)pvdev; + struct ol_txrx_vdev_t *vdev = + (struct ol_txrx_vdev_t *)ol_txrx_get_vdev_from_vdev_id(vdev_id); + + if (qdf_unlikely(!vdev)) { + ol_txrx_err("pdev is NULL"); + return; + } vdev->ocb_channel_info = ocb_set_chan.ocb_channel_info; vdev->ocb_channel_count = ocb_set_chan.ocb_channel_count; @@ -2703,14 +2711,21 @@ static void ol_txrx_set_ocb_chan_info(struct cdp_vdev *pvdev, /** * ol_txrx_get_ocb_chan_info() - return handle to vdev ocb_channel_info - * @vdev: vdev handle + * @soc_hdl: Datapath soc handle + * @vdev_id: id of vdev * * Return: handle to struct ol_txrx_ocb_chan_info */ static struct ol_txrx_ocb_chan_info * -ol_txrx_get_ocb_chan_info(struct cdp_vdev *pvdev) +ol_txrx_get_ocb_chan_info(struct cdp_soc_t *soc_hdl, uint8_t vdev_id) { - struct ol_txrx_vdev_t *vdev = (struct ol_txrx_vdev_t *)pvdev; + struct ol_txrx_vdev_t *vdev = + (struct ol_txrx_vdev_t *)ol_txrx_get_vdev_from_vdev_id(vdev_id); + + if (qdf_unlikely(!vdev)) { + ol_txrx_err("pdev is NULL"); + return NULL; + } return vdev->ocb_channel_info; }