cdp_txrx_mon.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  3. *
  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. /**
  19. * @file cdp_txrx_mon.h
  20. * @brief Define the monitor mode API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_MON_H_
  24. #define _CDP_TXRX_MON_H_
  25. #include "cdp_txrx_handle.h"
  26. static inline QDF_STATUS cdp_reset_monitor_mode(ol_txrx_soc_handle soc,
  27. uint8_t pdev_id,
  28. u_int8_t smart_monitor)
  29. {
  30. if (!soc || !soc->ops) {
  31. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  32. "%s: Invalid Instance", __func__);
  33. QDF_BUG(0);
  34. return 0;
  35. }
  36. if (!soc->ops->mon_ops ||
  37. !soc->ops->mon_ops->txrx_reset_monitor_mode)
  38. return 0;
  39. return soc->ops->mon_ops->txrx_reset_monitor_mode(soc, pdev_id,
  40. smart_monitor);
  41. }
  42. /**
  43. * cdp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture
  44. * @soc: Datapath SOC handle
  45. * @pdev_id: id of datapath PDEV handle
  46. * @nbuf: Management frame buffer
  47. */
  48. static inline QDF_STATUS
  49. cdp_deliver_tx_mgmt(ol_txrx_soc_handle soc, uint8_t pdev_id,
  50. qdf_nbuf_t nbuf)
  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 QDF_STATUS_E_FAILURE;
  57. }
  58. if (!soc->ops->mon_ops ||
  59. !soc->ops->mon_ops->txrx_deliver_tx_mgmt)
  60. return QDF_STATUS_E_FAILURE;
  61. return soc->ops->mon_ops->txrx_deliver_tx_mgmt(soc, pdev_id, nbuf);
  62. }
  63. #endif