cdp_txrx_tx_throttle.h 2.5 KB

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