cdp_txrx_me.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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_me.h
  28. * @brief Define the host data path mcast enhance API functions
  29. * called by the host control SW and the OS interface module
  30. */
  31. #ifndef _CDP_TXRX_ME_H_
  32. #define _CDP_TXRX_ME_H_
  33. #include <cdp_txrx_ops.h>
  34. /* TODO: adf need to be replaced with qdf */
  35. #include "cdp_txrx_handle.h"
  36. static inline u_int16_t
  37. cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc,
  38. struct cdp_pdev *pdev, u_int16_t buf_count)
  39. {
  40. if (soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone)
  41. return soc->ops->me_ops->
  42. tx_desc_alloc_and_mark_for_mcast_clone
  43. (pdev, buf_count);
  44. return 0;
  45. }
  46. static inline u_int16_t
  47. cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc,
  48. struct cdp_pdev *pdev, u_int16_t buf_count)
  49. {
  50. if (soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone)
  51. return soc->ops->me_ops->
  52. tx_desc_free_and_unmark_for_mcast_clone
  53. (pdev, buf_count);
  54. return 0;
  55. }
  56. static inline u_int16_t
  57. cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc,
  58. struct cdp_pdev *pdev)
  59. {
  60. if (soc->ops->me_ops->tx_get_mcast_buf_allocated_marked)
  61. return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked
  62. (pdev);
  63. return 0;
  64. }
  65. static inline void
  66. cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
  67. {
  68. if (soc->ops->me_ops->tx_me_alloc_descriptor)
  69. return soc->ops->me_ops->tx_me_alloc_descriptor(pdev);
  70. return;
  71. }
  72. static inline void
  73. cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
  74. {
  75. if (soc->ops->me_ops->tx_me_free_descriptor)
  76. return soc->ops->me_ops->tx_me_free_descriptor(pdev);
  77. return;
  78. }
  79. static inline uint16_t
  80. cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
  81. qdf_nbuf_t wbuf, u_int8_t newmac[][6], uint8_t newmaccnt)
  82. {
  83. if (soc->ops->me_ops->tx_me_convert_ucast)
  84. return soc->ops->me_ops->tx_me_convert_ucast
  85. (vdev, wbuf, newmac, newmaccnt);
  86. return 0;
  87. }
  88. /* Should be a function pointer in ol_txrx_osif_ops{} */
  89. /**
  90. * @brief notify mcast frame indication from FW.
  91. * @details
  92. * This notification will be used to convert
  93. * multicast frame to unicast.
  94. *
  95. * @param pdev - handle to the ctrl SW's physical device object
  96. * @param vdev_id - ID of the virtual device received the special data
  97. * @param msdu - the multicast msdu returned by FW for host inspect
  98. */
  99. static inline int cdp_mcast_notify(ol_txrx_soc_handle soc,
  100. struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu)
  101. {
  102. if (soc->ops->me_ops->mcast_notify)
  103. return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu);
  104. return 0;
  105. }
  106. #endif