i_qdf_nbuf_api_w.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. /*
  2. * Copyright (c) 2014-2017,2019-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-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: 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_rx_flow_idx_valid() - set given value in flow idx valid
  101. * of buf(skb->cb)
  102. * @buf: Network buffer
  103. * @val: Value of Rx flow tag to be set in the nbuf
  104. * Return: None
  105. */
  106. static inline void qdf_nbuf_set_rx_flow_idx_valid(qdf_nbuf_t buf, uint8_t val)
  107. {
  108. __qdf_nbuf_set_rx_flow_idx_valid(buf, val);
  109. }
  110. /**
  111. * qdf_nbuf_get_rx_flow_idx_valid() - Get the value of flow_idx_valid
  112. * field of buf(skb->cb)
  113. * @buf: Network buffer
  114. * Return: Value of the Rx flow tag in the nbuf
  115. */
  116. static inline uint8_t qdf_nbuf_get_rx_flow_idx_valid(qdf_nbuf_t buf)
  117. {
  118. return __qdf_nbuf_get_rx_flow_idx_valid(buf);
  119. }
  120. /**
  121. * qdf_nbuf_set_rx_flow_idx_timeout() - set given value in flow idx timeout
  122. * of buf(skb->cb)
  123. * @buf: Network buffer
  124. * @val: Value of Rx flow tag to be set in the nbuf
  125. * Return: None
  126. */
  127. static inline void qdf_nbuf_set_rx_flow_idx_timeout(qdf_nbuf_t buf, uint8_t val)
  128. {
  129. __qdf_nbuf_set_rx_flow_idx_timeout(buf, val);
  130. }
  131. /**
  132. * qdf_nbuf_get_rx_flow_idx_timeout() - Get the value of flow_idx_timeout
  133. * field of buf(skb->cb)
  134. * @buf: Network buffer
  135. * Return: Value of the Rx flow idx timeout in the nbuf
  136. */
  137. static inline uint8_t qdf_nbuf_get_rx_flow_idx_timeout(qdf_nbuf_t buf)
  138. {
  139. return __qdf_nbuf_get_rx_flow_idx_timeout(buf);
  140. }
  141. /**
  142. * qdf_nbuf_set_exc_frame() - set exception frame flag
  143. * @buf: Network buffer whose cb is to set exception frame flag
  144. * @value: exception frame flag, value 0 or 1.
  145. *
  146. * Return: none
  147. */
  148. static inline void qdf_nbuf_set_exc_frame(qdf_nbuf_t buf, uint8_t value)
  149. {
  150. }
  151. /**
  152. * qdf_nbuf_set_rx_ipa_smmu_map() - set ipa smmu mapped flag
  153. * @buf: Network buffer
  154. * @value: 1 - ipa smmu mapped, 0 - ipa smmu unmapped
  155. *
  156. * Return: none
  157. */
  158. static inline void qdf_nbuf_set_rx_ipa_smmu_map(qdf_nbuf_t buf,
  159. uint8_t value)
  160. {
  161. QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf) = value;
  162. }
  163. /**
  164. * qdf_nbuf_is_intra_bss() - get intra bss bit
  165. * @buf: Network buffer
  166. *
  167. * Return: integer value - 0/1
  168. */
  169. static inline int qdf_nbuf_is_intra_bss(qdf_nbuf_t buf)
  170. {
  171. return __qdf_nbuf_is_intra_bss(buf);
  172. }
  173. /**
  174. * qdf_nbuf_set_intra_bss() - set intra bss bit
  175. * @buf: Network buffer
  176. * @val: 0/1
  177. *
  178. * Return: void
  179. */
  180. static inline void qdf_nbuf_set_intra_bss(qdf_nbuf_t buf, uint8_t val)
  181. {
  182. __qdf_nbuf_set_intra_bss(buf, val);
  183. }
  184. /**
  185. * qdf_nbuf_is_rx_ipa_smmu_map() - check ipa smmu map flag
  186. * @buf: Network buffer
  187. *
  188. * Return 0 or 1
  189. */
  190. static inline uint8_t qdf_nbuf_is_rx_ipa_smmu_map(qdf_nbuf_t buf)
  191. {
  192. return QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf);
  193. }
  194. static inline int qdf_nbuf_ipa_owned_get(qdf_nbuf_t buf)
  195. {
  196. return 0;
  197. }
  198. static inline void qdf_nbuf_ipa_owned_set(qdf_nbuf_t buf)
  199. { }
  200. static inline void qdf_nbuf_ipa_owned_clear(qdf_nbuf_t buf)
  201. { }
  202. static inline int qdf_nbuf_ipa_priv_get(qdf_nbuf_t buf)
  203. {
  204. return 0;
  205. }
  206. static inline void qdf_nbuf_ipa_priv_set(qdf_nbuf_t buf, uint32_t priv)
  207. { }
  208. /**
  209. * qdf_nbuf_set_rx_reo_dest_ind_or_sw_excpt() - set reo destination indication
  210. * or sw exception flag
  211. * @buf: Network buffer
  212. * @value: value to set
  213. *
  214. * Return: none
  215. */
  216. static inline void qdf_nbuf_set_rx_reo_dest_ind_or_sw_excpt(qdf_nbuf_t buf,
  217. uint8_t value)
  218. {
  219. }
  220. static inline void qdf_nbuf_tx_notify_comp_set(qdf_nbuf_t buf, uint8_t val)
  221. {
  222. }
  223. static inline uint8_t qdf_nbuf_tx_notify_comp_get(qdf_nbuf_t buf)
  224. {
  225. return 0;
  226. }
  227. static inline void qdf_nbuf_set_lmac_id(qdf_nbuf_t buf, uint8_t value)
  228. {
  229. }
  230. static inline uint8_t qdf_nbuf_get_lmac_id(qdf_nbuf_t buf)
  231. {
  232. return 0;
  233. }
  234. static inline uint16_t qdf_nbuf_get_mpdu_seq_num(qdf_nbuf_t buf)
  235. {
  236. return 0;
  237. }
  238. /**
  239. * qdf_nbuf_tx_set_band() - Set band in nbuf cb
  240. * @nbuf: nbuf pointer
  241. * @band: peer band
  242. *
  243. * Return: None
  244. */
  245. static inline void
  246. qdf_nbuf_tx_set_band(qdf_nbuf_t nbuf, uint8_t band)
  247. {
  248. }
  249. /**
  250. * qdf_nbuf_tx_get_band() - Get band from nbuf cb
  251. * @nbuf: nbuf pointer
  252. *
  253. * Return: Band
  254. */
  255. static inline uint8_t
  256. qdf_nbuf_tx_get_band(qdf_nbuf_t nbuf)
  257. {
  258. return 0;
  259. }
  260. /**
  261. * qdf_nbuf_rx_set_band() - Set band in nbuf cb
  262. * @nbuf: nbuf pointer
  263. * @band: peer band
  264. *
  265. * Return: None
  266. */
  267. static inline void
  268. qdf_nbuf_rx_set_band(qdf_nbuf_t nbuf, uint8_t band)
  269. {
  270. }
  271. /**
  272. * qdf_nbuf_rx_get_band() - Get band from nbuf cb
  273. * @nbuf: nbuf pointer
  274. *
  275. * Return: Band
  276. */
  277. static inline uint8_t
  278. qdf_nbuf_rx_get_band(qdf_nbuf_t nbuf)
  279. {
  280. return 0;
  281. }
  282. #endif /* _QDF_NBUF_W_H */