1 /*
2 * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for
6 * any purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 #ifndef _CDP_TXRX_OCB_H_
21 #define _CDP_TXRX_OCB_H_
22 #include <cdp_txrx_mob_def.h>
23 #include "cdp_txrx_handle.h"
24 /**
25 * cdp_set_ocb_chan_info() - set OCB channel info to vdev.
26 * @soc: data path soc handle
27 * @vdev_id: vdev_id corresponding to vdev start
28 * @ocb_set_chan: OCB channel information to be set in vdev.
29 *
30 * Return: NONE
31 */
32 static inline void
cdp_set_ocb_chan_info(ol_txrx_soc_handle soc,uint8_t vdev_id,struct ol_txrx_ocb_set_chan ocb_set_chan)33 cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, uint8_t vdev_id,
34 struct ol_txrx_ocb_set_chan ocb_set_chan)
35 {
36 if (!soc || !soc->ops || !soc->ops->ocb_ops) {
37 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
38 "%s invalid instance", __func__);
39 return;
40 }
41
42 if (soc->ops->ocb_ops->set_ocb_chan_info)
43 soc->ops->ocb_ops->set_ocb_chan_info(soc, vdev_id,
44 ocb_set_chan);
45
46 }
47 /**
48 * cdp_get_ocb_chan_info() - return handle to vdev ocb_channel_info
49 * @soc: data path soc handle
50 * @vdev_id: vdev_id corresponding to vdev start
51 *
52 * Return: handle to struct ol_txrx_ocb_chan_info
53 */
54 static inline struct ol_txrx_ocb_chan_info *
cdp_get_ocb_chan_info(ol_txrx_soc_handle soc,uint8_t vdev_id)55 cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, uint8_t vdev_id)
56 {
57 if (!soc || !soc->ops || !soc->ops->ocb_ops) {
58 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
59 "%s invalid instance", __func__);
60 return NULL;
61 }
62
63 if (soc->ops->ocb_ops->get_ocb_chan_info)
64 return soc->ops->ocb_ops->get_ocb_chan_info(soc, vdev_id);
65
66 return NULL;
67 }
68 #endif /* _CDP_TXRX_OCB_H_ */
69