1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
3*5113495bSYour Name * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name *
5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name * above copyright notice and this permission notice appear in all
8*5113495bSYour Name * copies.
9*5113495bSYour Name *
10*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name */
19*5113495bSYour Name
20*5113495bSYour Name /**
21*5113495bSYour Name * DOC: cdp_txrx_tx_throttle.h
22*5113495bSYour Name * Define the host data path transmit throttle API
23*5113495bSYour Name * functions called by the host control SW and the OS interface
24*5113495bSYour Name * module
25*5113495bSYour Name */
26*5113495bSYour Name #ifndef _CDP_TXRX_TX_THROTTLE_H_
27*5113495bSYour Name #define _CDP_TXRX_TX_THROTTLE_H_
28*5113495bSYour Name #include <cdp_txrx_ops.h>
29*5113495bSYour Name #include "cdp_txrx_handle.h"
30*5113495bSYour Name /**
31*5113495bSYour Name * cdp_throttle_init_period() - init tx throttle period
32*5113495bSYour Name * @soc: data path soc handle
33*5113495bSYour Name * @pdev_id: id of data path pdev handle
34*5113495bSYour Name * @period: throttle period
35*5113495bSYour Name * @dutycycle_level: duty cycle level
36*5113495bSYour Name *
37*5113495bSYour Name * Return: NONE
38*5113495bSYour Name */
39*5113495bSYour Name static inline void
cdp_throttle_init_period(ol_txrx_soc_handle soc,uint8_t pdev_id,int period,uint8_t * dutycycle_level)40*5113495bSYour Name cdp_throttle_init_period(ol_txrx_soc_handle soc, uint8_t pdev_id,
41*5113495bSYour Name int period, uint8_t *dutycycle_level)
42*5113495bSYour Name {
43*5113495bSYour Name if (!soc || !soc->ops || !soc->ops->throttle_ops) {
44*5113495bSYour Name QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
45*5113495bSYour Name "%s invalid instance", __func__);
46*5113495bSYour Name return;
47*5113495bSYour Name }
48*5113495bSYour Name
49*5113495bSYour Name if (soc->ops->throttle_ops->throttle_init_period)
50*5113495bSYour Name return soc->ops->throttle_ops->throttle_init_period(
51*5113495bSYour Name soc, pdev_id, period, dutycycle_level);
52*5113495bSYour Name return;
53*5113495bSYour Name }
54*5113495bSYour Name
55*5113495bSYour Name /**
56*5113495bSYour Name * cdp_throttle_set_level() - init tx throttle level
57*5113495bSYour Name * @soc: data path soc handle
58*5113495bSYour Name * @pdev_id: id of data path pdev handle
59*5113495bSYour Name * @level: throttle level
60*5113495bSYour Name *
61*5113495bSYour Name * Return: NONE
62*5113495bSYour Name */
63*5113495bSYour Name static inline void
cdp_throttle_set_level(ol_txrx_soc_handle soc,uint8_t pdev_id,int level)64*5113495bSYour Name cdp_throttle_set_level(ol_txrx_soc_handle soc, uint8_t pdev_id, int level)
65*5113495bSYour Name {
66*5113495bSYour Name if (!soc || !soc->ops || !soc->ops->throttle_ops) {
67*5113495bSYour Name QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
68*5113495bSYour Name "%s invalid instance", __func__);
69*5113495bSYour Name return;
70*5113495bSYour Name }
71*5113495bSYour Name
72*5113495bSYour Name if (soc->ops->throttle_ops->throttle_set_level)
73*5113495bSYour Name return soc->ops->throttle_ops->throttle_set_level(soc, pdev_id,
74*5113495bSYour Name level);
75*5113495bSYour Name return;
76*5113495bSYour Name }
77*5113495bSYour Name
78*5113495bSYour Name #endif /* _CDP_TXRX_TX_THROTTLE_H_ */
79