cdp_txrx_mon.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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_mon.h
  28. * @brief Define the monitor mode API functions
  29. * called by the host control SW and the OS interface module
  30. */
  31. #ifndef _CDP_TXRX_MON_H_
  32. #define _CDP_TXRX_MON_H_
  33. #include "cdp_txrx_handle.h"
  34. static inline void cdp_monitor_set_filter_ucast_data
  35. (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
  36. {
  37. if (!soc || !soc->ops) {
  38. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  39. "%s: Invalid Instance", __func__);
  40. QDF_BUG(0);
  41. return;
  42. }
  43. if (!soc->ops->mon_ops ||
  44. !soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data)
  45. return;
  46. soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data
  47. (pdev, val);
  48. }
  49. static inline void cdp_monitor_set_filter_mcast_data
  50. (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
  51. {
  52. if (!soc || !soc->ops) {
  53. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  54. "%s: Invalid Instance", __func__);
  55. QDF_BUG(0);
  56. return;
  57. }
  58. if (!soc->ops->mon_ops ||
  59. !soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data)
  60. return;
  61. soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data
  62. (pdev, val);
  63. }
  64. static inline void cdp_monitor_set_filter_non_data
  65. (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
  66. {
  67. if (!soc || !soc->ops) {
  68. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  69. "%s: Invalid Instance", __func__);
  70. QDF_BUG(0);
  71. return;
  72. }
  73. if (!soc->ops->mon_ops ||
  74. !soc->ops->mon_ops->txrx_monitor_set_filter_non_data)
  75. return;
  76. soc->ops->mon_ops->txrx_monitor_set_filter_non_data
  77. (pdev, val);
  78. }
  79. static inline u_int8_t cdp_monitor_get_filter_ucast_data(ol_txrx_soc_handle soc,
  80. struct cdp_vdev *vdev_txrx_handle)
  81. {
  82. if (!soc || !soc->ops) {
  83. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  84. "%s: Invalid Instance", __func__);
  85. QDF_BUG(0);
  86. return 0;
  87. }
  88. if (!soc->ops->mon_ops ||
  89. !soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data)
  90. return 0;
  91. return soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data
  92. (vdev_txrx_handle);
  93. }
  94. static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc,
  95. struct cdp_vdev *vdev_txrx_handle)
  96. {
  97. if (!soc || !soc->ops) {
  98. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  99. "%s: Invalid Instance", __func__);
  100. QDF_BUG(0);
  101. return 0;
  102. }
  103. if (!soc->ops->mon_ops ||
  104. !soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data)
  105. return 0;
  106. return soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data
  107. (vdev_txrx_handle);
  108. }
  109. static inline u_int8_t cdp_monitor_get_filter_non_data(ol_txrx_soc_handle soc,
  110. struct cdp_vdev *vdev_txrx_handle)
  111. {
  112. if (!soc || !soc->ops) {
  113. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  114. "%s: Invalid Instance", __func__);
  115. QDF_BUG(0);
  116. return 0;
  117. }
  118. if (!soc->ops->mon_ops ||
  119. !soc->ops->mon_ops->txrx_monitor_get_filter_non_data)
  120. return 0;
  121. return soc->ops->mon_ops->txrx_monitor_get_filter_non_data
  122. (vdev_txrx_handle);
  123. }
  124. static inline int cdp_reset_monitor_mode
  125. (ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
  126. {
  127. if (!soc || !soc->ops) {
  128. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  129. "%s: Invalid Instance", __func__);
  130. QDF_BUG(0);
  131. return 0;
  132. }
  133. if (!soc->ops->mon_ops ||
  134. !soc->ops->mon_ops->txrx_reset_monitor_mode)
  135. return 0;
  136. return soc->ops->mon_ops->txrx_reset_monitor_mode(pdev);
  137. }
  138. #endif