i_qdf_nbuf_api_m.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * Copyright (c) 2014-2017,2019-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. * DOC: i_qdf_nbuf_api_m.h
  20. *
  21. * Platform specific qdf_nbuf_public network buffer API
  22. * This file defines the network buffer abstraction.
  23. * Included by qdf_nbuf.h and should not be included
  24. * directly from other files.
  25. */
  26. #ifndef _QDF_NBUF_M_H
  27. #define _QDF_NBUF_M_H
  28. static inline int qdf_nbuf_ipa_owned_get(qdf_nbuf_t buf)
  29. {
  30. return __qdf_nbuf_ipa_owned_get(buf);
  31. }
  32. static inline void qdf_nbuf_ipa_owned_set(qdf_nbuf_t buf)
  33. {
  34. __qdf_nbuf_ipa_owned_set(buf);
  35. }
  36. static inline void qdf_nbuf_ipa_owned_clear(qdf_nbuf_t buf)
  37. {
  38. __qdf_nbuf_ipa_owned_clear(buf);
  39. }
  40. static inline int qdf_nbuf_ipa_priv_get(qdf_nbuf_t buf)
  41. {
  42. return __qdf_nbuf_ipa_priv_get(buf);
  43. }
  44. static inline void qdf_nbuf_ipa_priv_set(qdf_nbuf_t buf, uint32_t priv)
  45. {
  46. QDF_BUG(!(priv & QDF_NBUF_IPA_CHECK_MASK));
  47. __qdf_nbuf_ipa_priv_set(buf, priv);
  48. }
  49. static inline void qdf_nbuf_tx_notify_comp_set(qdf_nbuf_t buf, uint8_t val)
  50. {
  51. QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_NOTIFY_COMP(buf) = val;
  52. }
  53. static inline uint8_t qdf_nbuf_tx_notify_comp_get(qdf_nbuf_t buf)
  54. {
  55. return QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_NOTIFY_COMP(buf);
  56. }
  57. /**
  58. * qdf_nbuf_set_rx_protocol_tag()
  59. * @buf: Network buffer
  60. * @val: Value to be set in the nbuf
  61. * Return: None
  62. */
  63. static inline void qdf_nbuf_set_rx_protocol_tag(qdf_nbuf_t buf, uint16_t val)
  64. {
  65. }
  66. /**
  67. * qdf_nbuf_get_rx_protocol_tag()
  68. * @buf: Network buffer
  69. * Return: Value of rx protocol tag, here 0
  70. */
  71. static inline uint16_t qdf_nbuf_get_rx_protocol_tag(qdf_nbuf_t buf)
  72. {
  73. return 0;
  74. }
  75. /**
  76. * qdf_nbuf_set_rx_flow_tag() - set given value in flow tag field
  77. * of buf(skb->cb)
  78. * @buf: Network buffer
  79. * @val: Rx Flow Tag to be set in the nbuf
  80. * Return: None
  81. */
  82. static inline void qdf_nbuf_set_rx_flow_tag(qdf_nbuf_t buf, uint16_t val)
  83. {
  84. }
  85. /**
  86. * qdf_nbuf_get_rx_flow_tag() - Get the value of flow_tag
  87. * field of buf(skb->cb)
  88. * @buf: Network buffer
  89. * Return: Value of rx flow tag, here 0
  90. */
  91. static inline uint16_t qdf_nbuf_get_rx_flow_tag(qdf_nbuf_t buf)
  92. {
  93. return 0;
  94. }
  95. /**
  96. * qdf_nbuf_set_exc_frame() - set exception frame flag
  97. * @buf: Network buffer whose cb is to set exception frame flag
  98. * @value: exception frame flag, value 0 or 1.
  99. *
  100. * Return: none
  101. */
  102. static inline void qdf_nbuf_set_exc_frame(qdf_nbuf_t buf, uint8_t value)
  103. {
  104. QDF_NBUF_CB_RX_PACKET_EXC_FRAME(buf) = value;
  105. }
  106. /**
  107. * qdf_nbuf_is_exc_frame() - check exception frame flag bit
  108. * @buf: Network buffer to get exception flag
  109. *
  110. * Return: 0 or 1
  111. */
  112. static inline uint8_t qdf_nbuf_is_exc_frame(qdf_nbuf_t buf)
  113. {
  114. return QDF_NBUF_CB_RX_PACKET_EXC_FRAME(buf);
  115. }
  116. /**
  117. * qdf_nbuf_set_rx_ipa_smmu_map() - set ipa smmu mapped flag
  118. * @buf: Network buffer
  119. * @value: 1 - ipa smmu mapped, 0 - ipa smmu unmapped
  120. *
  121. * Return: none
  122. */
  123. static inline void qdf_nbuf_set_rx_ipa_smmu_map(qdf_nbuf_t buf,
  124. uint8_t value)
  125. {
  126. QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf) = value;
  127. }
  128. /**
  129. * qdf_nbuf_is_rx_ipa_smmu_map() - check ipa smmu map flag
  130. * @buf: Network buffer
  131. *
  132. * Return 0 or 1
  133. */
  134. static inline uint8_t qdf_nbuf_is_rx_ipa_smmu_map(qdf_nbuf_t buf)
  135. {
  136. return QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf);
  137. }
  138. /**
  139. * qdf_nbuf_set_rx_reo_dest_ind() - set reo destination indication
  140. * @buf: Network buffer
  141. * @value: reo destination indication value to set
  142. *
  143. * Return: none
  144. */
  145. static inline void qdf_nbuf_set_rx_reo_dest_ind(qdf_nbuf_t buf,
  146. uint8_t value)
  147. {
  148. QDF_NBUF_CB_RX_PACKET_REO_DEST_IND(buf) = value;
  149. }
  150. /**
  151. * qdf_nbuf_get_rx_reo_dest_ind() - get reo destination indication
  152. * @buf: Network buffer
  153. *
  154. * Return reo destination indication value (0 ~ 31)
  155. */
  156. static inline uint8_t qdf_nbuf_get_rx_reo_dest_ind(qdf_nbuf_t buf)
  157. {
  158. return QDF_NBUF_CB_RX_PACKET_REO_DEST_IND(buf);
  159. }
  160. #endif /* _QDF_NBUF_M_H */