cdp_txrx_me.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_me.h
  21. * Define the host data path mcast enhance API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_ME_H_
  25. #define _CDP_TXRX_ME_H_
  26. #include <cdp_txrx_ops.h>
  27. #include "cdp_txrx_handle.h"
  28. #include <cdp_txrx_cmn.h>
  29. static inline void
  30. cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, uint8_t pdev_id)
  31. {
  32. if (!soc || !soc->ops) {
  33. dp_cdp_debug("Invalid Instance");
  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. dp_cdp_debug("Invalid Instance");
  47. QDF_BUG(0);
  48. return;
  49. }
  50. if (!soc->ops->me_ops ||
  51. !soc->ops->me_ops->tx_me_free_descriptor)
  52. return;
  53. soc->ops->me_ops->tx_me_free_descriptor(soc, pdev_id);
  54. }
  55. static inline uint16_t
  56. cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, uint8_t vdev_id,
  57. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  58. uint8_t newmaccnt, uint8_t tid, bool is_igmp,
  59. bool is_dms_pkt)
  60. {
  61. if (!soc || !soc->ops) {
  62. dp_cdp_debug("Invalid Instance");
  63. QDF_BUG(0);
  64. return 0;
  65. }
  66. if (!soc->ops->me_ops ||
  67. !soc->ops->me_ops->tx_me_convert_ucast)
  68. return 0;
  69. return soc->ops->me_ops->tx_me_convert_ucast
  70. (soc, vdev_id, wbuf, newmac, newmaccnt, tid, is_igmp,
  71. is_dms_pkt);
  72. }
  73. #endif