Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 1 | /* |
Rakesh Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 2 | * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 3 | * |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 4 | * 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 Park | 139de79 | 2017-04-03 08:45:10 -0700 | [diff] [blame] | 19 | /** |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 20 | * @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 Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 27 | #include <cdp_txrx_ops.h> |
Venkata Sharath Chandra Manchala | f2a125a | 2016-11-28 18:10:11 -0800 | [diff] [blame] | 28 | #include "cdp_txrx_handle.h" |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 29 | /** |
| 30 | * cdp_throttle_init_period() - init tx throttle period |
| 31 | * @soc: data path soc handle |
Rakesh Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 32 | * @pdev_id: id of data path pdev handle |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 33 | * @period: throttle period |
| 34 | * @dutycycle_level: duty cycle level |
| 35 | * |
| 36 | * Return: NONE |
| 37 | */ |
| 38 | static inline void |
Rakesh Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 39 | cdp_throttle_init_period(ol_txrx_soc_handle soc, uint8_t pdev_id, |
| 40 | int period, uint8_t *dutycycle_level) |
Manjunathappa Prakash | a22c216 | 2016-03-01 03:21:55 -0800 | [diff] [blame] | 41 | { |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 42 | 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 Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 49 | return soc->ops->throttle_ops->throttle_init_period( |
| 50 | soc, pdev_id, period, dutycycle_level); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 51 | return; |
Manjunathappa Prakash | a22c216 | 2016-03-01 03:21:55 -0800 | [diff] [blame] | 52 | } |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 53 | |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 54 | /** |
| 55 | * cdp_throttle_init_period() - init tx throttle period |
| 56 | * @soc: data path soc handle |
Rakesh Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 57 | * @pdev_id: id of data path pdev handle |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 58 | * @level: throttle level |
| 59 | * |
| 60 | * Return: NONE |
| 61 | */ |
| 62 | static inline void |
Rakesh Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 63 | cdp_throttle_set_level(ol_txrx_soc_handle soc, uint8_t pdev_id, int level) |
Manjunathappa Prakash | a22c216 | 2016-03-01 03:21:55 -0800 | [diff] [blame] | 64 | { |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 65 | 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 Pillai | 20e302a | 2019-07-08 16:22:56 +0530 | [diff] [blame] | 72 | return soc->ops->throttle_ops->throttle_set_level(soc, pdev_id, |
| 73 | level); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 74 | return; |
Manjunathappa Prakash | a22c216 | 2016-03-01 03:21:55 -0800 | [diff] [blame] | 75 | } |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 76 | |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 77 | #endif /* _CDP_TXRX_TX_THROTTLE_H_ */ |