From 5396b88e32730ee55ab2701054fe7bc600d7d2d9 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Sun, 7 Jul 2019 00:36:41 +0530 Subject: [PATCH] qcacmn: cdp: Convergence of cdp_ocb_ops Currently the cdp apis are given pdev/vdev/peer handle as its arguments, which is directly accessed in those APIs. This can cause a race-condition in access of the respective handles if it has been deleted in parallel. Hence as a part of cdp convergence, pass only the pdev/vdev id or peer mac address, which will be used to get the respective handles, and hence avoiding the unwanted access of the handles if it has been deleted. Converged ocb_ops - set_ocb_chan_info - get_ocb_chan_info CRs-Fixed: 2539820 Change-Id: I5be5270c9a3ea6e295a63681cf20cef4465b2101 --- dp/inc/cdp_txrx_ocb.h | 16 ++++++++-------- dp/inc/cdp_txrx_ops.h | 14 ++++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dp/inc/cdp_txrx_ocb.h b/dp/inc/cdp_txrx_ocb.h index 5fd6d682f0ca..abab53af194e 100644 --- a/dp/inc/cdp_txrx_ocb.h +++ b/dp/inc/cdp_txrx_ocb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 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 @@ -23,14 +23,14 @@ /** * cdp_set_ocb_chan_info() - set OCB channel info to vdev. * @soc - data path soc handle - * @vdev: vdev handle + * @vdev_id: vdev_id corresponding to vdev start * @ocb_set_chan: OCB channel information to be set in vdev. * * Return: NONE */ static inline void -cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, - struct ol_txrx_ocb_set_chan ocb_set_chan) +cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, uint8_t vdev_id, + struct ol_txrx_ocb_set_chan ocb_set_chan) { if (!soc || !soc->ops || !soc->ops->ocb_ops) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, @@ -39,19 +39,19 @@ cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, } if (soc->ops->ocb_ops->set_ocb_chan_info) - soc->ops->ocb_ops->set_ocb_chan_info(vdev, + soc->ops->ocb_ops->set_ocb_chan_info(soc, vdev_id, ocb_set_chan); } /** * cdp_get_ocb_chan_info() - return handle to vdev ocb_channel_info * @soc - data path soc handle - * @vdev: vdev handle + * @vdev_id: vdev_id corresponding to vdev start * * Return: handle to struct ol_txrx_ocb_chan_info */ static inline struct ol_txrx_ocb_chan_info * -cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) +cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, uint8_t vdev_id) { if (!soc || !soc->ops || !soc->ops->ocb_ops) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, @@ -60,7 +60,7 @@ cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) } if (soc->ops->ocb_ops->get_ocb_chan_info) - return soc->ops->ocb_ops->get_ocb_chan_info(vdev); + return soc->ops->ocb_ops->get_ocb_chan_info(soc, vdev_id); return NULL; } diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index e29893278672..25d99c88c33d 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1079,14 +1079,16 @@ struct cdp_misc_ops { /** * struct cdp_ocb_ops - mcl ocb ops - * @set_ocb_chan_info: - * @get_ocb_chan_info: + * @set_ocb_chan_info: set OCB channel info + * @get_ocb_chan_info: get OCB channel info + * + * Function pointers for operations related to OCB. */ struct cdp_ocb_ops { - void (*set_ocb_chan_info)(struct cdp_vdev *vdev, - struct ol_txrx_ocb_set_chan ocb_set_chan); - struct ol_txrx_ocb_chan_info * - (*get_ocb_chan_info)(struct cdp_vdev *vdev); + void (*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_ocb_chan_info *(*get_ocb_chan_info)( + struct cdp_soc_t *soc_hdl, uint8_t vdev_id); }; /**