i_qdf_nbuf_api_w.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /*
  2. * Copyright (c) 2014-2017,2019-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021 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: i_qdf_nbuf_api_w.h
  21. *
  22. * Platform specific qdf_nbuf_public network buffer API
  23. * This file defines the network buffer abstraction.
  24. * Included by qdf_nbuf.h and should not be included
  25. * directly from other files.
  26. */
  27. #ifndef _QDF_NBUF_W_H
  28. #define _QDF_NBUF_W_H
  29. static inline void *qdf_nbuf_get_tx_fctx(qdf_nbuf_t buf)
  30. {
  31. return __qdf_nbuf_get_tx_fctx(buf);
  32. }
  33. static inline void *qdf_nbuf_get_rx_fctx(qdf_nbuf_t buf)
  34. {
  35. return __qdf_nbuf_get_rx_fctx(buf);
  36. }
  37. static inline void
  38. qdf_nbuf_set_tx_fctx_type(qdf_nbuf_t buf, void *ctx, uint8_t type)
  39. {
  40. __qdf_nbuf_set_tx_fctx_type(buf, ctx, type);
  41. }
  42. static inline void
  43. qdf_nbuf_set_rx_fctx_type(qdf_nbuf_t buf, void *ctx, uint8_t type)
  44. {
  45. __qdf_nbuf_set_rx_fctx_type(buf, ctx, type);
  46. }
  47. static inline void *
  48. qdf_nbuf_get_ext_cb(qdf_nbuf_t buf)
  49. {
  50. return __qdf_nbuf_get_ext_cb(buf);
  51. }
  52. static inline void
  53. qdf_nbuf_set_ext_cb(qdf_nbuf_t buf, void *ref)
  54. {
  55. __qdf_nbuf_set_ext_cb(buf, ref);
  56. }
  57. /**
  58. * qdf_nbuf_set_rx_protocol_tag() - set given value in protocol_tag
  59. * field of buf(skb->cb)
  60. * @buf: Network buffer
  61. * @val: Value to be set in the nbuf
  62. * Return: None
  63. */
  64. static inline void qdf_nbuf_set_rx_protocol_tag(qdf_nbuf_t buf, uint16_t val)
  65. {
  66. __qdf_nbuf_set_rx_protocol_tag(buf, val);
  67. }
  68. /**
  69. * qdf_nbuf_get_rx_protocol_tag() - Get the value of protocol_tag
  70. * field of buf(skb->cb)
  71. * @buf: Network buffer
  72. * Return: Value of Rx protocol tag in the nbuf
  73. */
  74. static inline uint16_t qdf_nbuf_get_rx_protocol_tag(qdf_nbuf_t buf)
  75. {
  76. return __qdf_nbuf_get_rx_protocol_tag(buf);
  77. }
  78. /**
  79. * qdf_nbuf_set_rx_flow_tag() - set given value in flow tag field
  80. * of buf(skb->cb)
  81. * @buf: Network buffer
  82. * @val: Value of Rx flow tag to be set in the nbuf
  83. * Return: None
  84. */
  85. static inline void qdf_nbuf_set_rx_flow_tag(qdf_nbuf_t buf, uint16_t val)
  86. {
  87. __qdf_nbuf_set_rx_flow_tag(buf, val);
  88. }
  89. /**
  90. * qdf_nbuf_get_rx_flow_tag() - Get the value of flow_tag
  91. * field of buf(skb->cb)
  92. * @buf: Network buffer
  93. * Return: Value of the Rx flow tag in the nbuf
  94. */
  95. static inline uint16_t qdf_nbuf_get_rx_flow_tag(qdf_nbuf_t buf)
  96. {
  97. return __qdf_nbuf_get_rx_flow_tag(buf);
  98. }
  99. /**
  100. * qdf_nbuf_set_exc_frame() - set exception frame flag
  101. * @buf: Network buffer whose cb is to set exception frame flag
  102. * @value: exception frame flag, value 0 or 1.
  103. *
  104. * Return: none
  105. */
  106. static inline void qdf_nbuf_set_exc_frame(qdf_nbuf_t buf, uint8_t value)
  107. {
  108. }
  109. /**
  110. * qdf_nbuf_set_rx_ipa_smmu_map() - set ipa smmu mapped flag
  111. * @buf: Network buffer
  112. * @value: 1 - ipa smmu mapped, 0 - ipa smmu unmapped
  113. *
  114. * Return: none
  115. */
  116. static inline void qdf_nbuf_set_rx_ipa_smmu_map(qdf_nbuf_t buf,
  117. uint8_t value)
  118. {
  119. QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf) = value;
  120. }
  121. /**
  122. * qdf_nbuf_is_intra_bss() - get intra bss bit
  123. * @buf: Network buffer
  124. *
  125. * Return: integer value - 0/1
  126. */
  127. static inline int qdf_nbuf_is_intra_bss(qdf_nbuf_t buf)
  128. {
  129. return __qdf_nbuf_is_intra_bss(buf);
  130. }
  131. /**
  132. * qdf_nbuf_set_intra_bss() - set intra bss bit
  133. * @buf: Network buffer
  134. * @val: 0/1
  135. *
  136. * Return: void
  137. */
  138. static inline void qdf_nbuf_set_intra_bss(qdf_nbuf_t buf, uint8_t val)
  139. {
  140. __qdf_nbuf_set_intra_bss(buf, val);
  141. }
  142. /**
  143. * qdf_nbuf_is_rx_ipa_smmu_map() - check ipa smmu map flag
  144. * @buf: Network buffer
  145. *
  146. * Return 0 or 1
  147. */
  148. static inline uint8_t qdf_nbuf_is_rx_ipa_smmu_map(qdf_nbuf_t buf)
  149. {
  150. return QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf);
  151. }
  152. static inline int qdf_nbuf_ipa_owned_get(qdf_nbuf_t buf)
  153. {
  154. return 0;
  155. }
  156. static inline void qdf_nbuf_ipa_owned_set(qdf_nbuf_t buf)
  157. { }
  158. static inline void qdf_nbuf_ipa_owned_clear(qdf_nbuf_t buf)
  159. { }
  160. static inline int qdf_nbuf_ipa_priv_get(qdf_nbuf_t buf)
  161. {
  162. return 0;
  163. }
  164. static inline void qdf_nbuf_ipa_priv_set(qdf_nbuf_t buf, uint32_t priv)
  165. { }
  166. /**
  167. * qdf_nbuf_set_rx_reo_dest_ind_or_sw_excpt() - set reo destination indication
  168. or sw exception flag
  169. * @buf: Network buffer
  170. * @value: value to set
  171. *
  172. * Return: none
  173. */
  174. static inline void qdf_nbuf_set_rx_reo_dest_ind_or_sw_excpt(qdf_nbuf_t buf,
  175. uint8_t value)
  176. {
  177. }
  178. static inline void qdf_nbuf_tx_notify_comp_set(qdf_nbuf_t buf, uint8_t val)
  179. {
  180. }
  181. static inline uint8_t qdf_nbuf_tx_notify_comp_get(qdf_nbuf_t buf)
  182. {
  183. return 0;
  184. }
  185. #endif /* _QDF_NBUF_W_H */