blob: a17d1237bc06b23043e4c004096959c40b7138e9 [file] [log] [blame]
Dhanashri Atre9c222b12016-03-22 13:26:13 -07001/*
Rakesh Pillai20e302a2019-07-08 16:22:56 +05302 * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
Dhanashri Atre9c222b12016-03-22 13:26:13 -07003 *
Dhanashri Atre9c222b12016-03-22 13:26:13 -07004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Yun Park139de792017-04-03 08:45:10 -070019/**
Dhanashri Atre9c222b12016-03-22 13:26:13 -070020 * @file cdp_txrx_tx_throttle.h
21 * @brief Define the host data path transmit throttle API
22 * functions called by the host control SW and the OS interface
23 * module
24 */
25#ifndef _CDP_TXRX_TX_THROTTLE_H_
26#define _CDP_TXRX_TX_THROTTLE_H_
Leo Changdb6358c2016-09-27 17:00:52 -070027#include <cdp_txrx_ops.h>
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -080028#include "cdp_txrx_handle.h"
Leo Changdb6358c2016-09-27 17:00:52 -070029/**
30 * cdp_throttle_init_period() - init tx throttle period
31 * @soc: data path soc handle
Rakesh Pillai20e302a2019-07-08 16:22:56 +053032 * @pdev_id: id of data path pdev handle
Leo Changdb6358c2016-09-27 17:00:52 -070033 * @period: throttle period
34 * @dutycycle_level: duty cycle level
35 *
36 * Return: NONE
37 */
38static inline void
Rakesh Pillai20e302a2019-07-08 16:22:56 +053039cdp_throttle_init_period(ol_txrx_soc_handle soc, uint8_t pdev_id,
40 int period, uint8_t *dutycycle_level)
Manjunathappa Prakasha22c2162016-03-01 03:21:55 -080041{
Leo Changdb6358c2016-09-27 17:00:52 -070042 if (!soc || !soc->ops || !soc->ops->throttle_ops) {
43 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
44 "%s invalid instance", __func__);
45 return;
46 }
47
48 if (soc->ops->throttle_ops->throttle_init_period)
Rakesh Pillai20e302a2019-07-08 16:22:56 +053049 return soc->ops->throttle_ops->throttle_init_period(
50 soc, pdev_id, period, dutycycle_level);
Leo Changdb6358c2016-09-27 17:00:52 -070051 return;
Manjunathappa Prakasha22c2162016-03-01 03:21:55 -080052}
Dhanashri Atre9c222b12016-03-22 13:26:13 -070053
Leo Changdb6358c2016-09-27 17:00:52 -070054/**
55 * cdp_throttle_init_period() - init tx throttle period
56 * @soc: data path soc handle
Rakesh Pillai20e302a2019-07-08 16:22:56 +053057 * @pdev_id: id of data path pdev handle
Leo Changdb6358c2016-09-27 17:00:52 -070058 * @level: throttle level
59 *
60 * Return: NONE
61 */
62static inline void
Rakesh Pillai20e302a2019-07-08 16:22:56 +053063cdp_throttle_set_level(ol_txrx_soc_handle soc, uint8_t pdev_id, int level)
Manjunathappa Prakasha22c2162016-03-01 03:21:55 -080064{
Leo Changdb6358c2016-09-27 17:00:52 -070065 if (!soc || !soc->ops || !soc->ops->throttle_ops) {
66 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
67 "%s invalid instance", __func__);
68 return;
69 }
70
71 if (soc->ops->throttle_ops->throttle_set_level)
Rakesh Pillai20e302a2019-07-08 16:22:56 +053072 return soc->ops->throttle_ops->throttle_set_level(soc, pdev_id,
73 level);
Leo Changdb6358c2016-09-27 17:00:52 -070074 return;
Manjunathappa Prakasha22c2162016-03-01 03:21:55 -080075}
Leo Changdb6358c2016-09-27 17:00:52 -070076
Dhanashri Atre9c222b12016-03-22 13:26:13 -070077#endif /* _CDP_TXRX_TX_THROTTLE_H_ */