cdp_txrx_me.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_me.h
  20. * @brief Define the host data path mcast enhance API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_ME_H_
  24. #define _CDP_TXRX_ME_H_
  25. #include <cdp_txrx_ops.h>
  26. /* TODO: adf need to be replaced with qdf */
  27. #include "cdp_txrx_handle.h"
  28. static inline void
  29. cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, uint8_t pdev_id)
  30. {
  31. if (!soc || !soc->ops) {
  32. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  33. "%s: Invalid Instance", __func__);
  34. QDF_BUG(0);
  35. return;
  36. }
  37. if (!soc->ops->me_ops ||
  38. !soc->ops->me_ops->tx_me_alloc_descriptor)
  39. return;
  40. soc->ops->me_ops->tx_me_alloc_descriptor(soc, pdev_id);
  41. }
  42. static inline void
  43. cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, uint8_t pdev_id)
  44. {
  45. if (!soc || !soc->ops) {
  46. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  47. "%s: Invalid Instance", __func__);
  48. QDF_BUG(0);
  49. return;
  50. }
  51. if (!soc->ops->me_ops ||
  52. !soc->ops->me_ops->tx_me_free_descriptor)
  53. return;
  54. soc->ops->me_ops->tx_me_free_descriptor(soc, pdev_id);
  55. }
  56. static inline uint16_t
  57. cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, uint8_t vdev_id,
  58. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  59. uint8_t newmaccnt, uint8_t tid, bool is_igmp)
  60. {
  61. if (!soc || !soc->ops) {
  62. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  63. "%s: Invalid Instance", __func__);
  64. QDF_BUG(0);
  65. return 0;
  66. }
  67. if (!soc->ops->me_ops ||
  68. !soc->ops->me_ops->tx_me_convert_ucast)
  69. return 0;
  70. return soc->ops->me_ops->tx_me_convert_ucast
  71. (soc, vdev_id, wbuf, newmac, newmaccnt, tid, is_igmp);
  72. }
  73. #endif