target_if_dp.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /*
  2. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 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: This target interface shall be used by DP
  21. * to communicate with target using WMI.
  22. */
  23. #ifndef _WLAN_TARGET_IF_DP_H_
  24. #define _WLAN_TARGET_IF_DP_H_
  25. #include <qdf_types.h>
  26. #include <qdf_status.h>
  27. #include <wmi_unified_priv.h>
  28. #include <wlan_objmgr_psoc_obj.h>
  29. #include <target_if.h>
  30. #include <cdp_txrx_ops.h>
  31. #define PEER_ROUTING_LMAC_ID_INDEX 6
  32. #define PEER_ROUTING_LMAC_ID_BITS 2
  33. /**
  34. * struct reorder_q_setup - reorder queue setup params
  35. * @psoc: psoc
  36. * @vdev_id: vdev id
  37. * @pdev_id: pdev id
  38. * @peer_macaddr: peer mac address
  39. * @hw_qdesc: hw queue descriptor
  40. * @tid: tid number
  41. * @queue_no: queue number
  42. * @ba_window_size_valid: BA window size validity flag
  43. * @ba_window_size: BA window size
  44. */
  45. struct reorder_q_setup {
  46. struct cdp_ctrl_objmgr_psoc *psoc;
  47. uint8_t vdev_id;
  48. uint8_t pdev_id;
  49. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  50. qdf_dma_addr_t hw_qdesc_paddr;
  51. uint8_t tid;
  52. uint16_t queue_no;
  53. uint8_t ba_window_size_valid;
  54. uint16_t ba_window_size;
  55. };
  56. /**
  57. * target_if_get_active_mac_phy_number() - Get max MAC-PHY number enabled by
  58. * target
  59. * @psoc: psoc
  60. *
  61. * Get max active MAC-PHY number in all type of hw modes.
  62. *
  63. * return: active number of MAC-PHY pairs
  64. */
  65. uint32_t target_if_get_active_mac_phy_number(struct wlan_objmgr_psoc *psoc);
  66. /**
  67. * target_if_peer_set_default_routing() - set peer default routing
  68. * @psoc: psoc pointer
  69. * @pdev_id: pdev id
  70. * @peer_macaddr: peer mac address
  71. * @vdev_id: vdev id
  72. * @hash_based: hash based routing
  73. * @ring_num: ring number
  74. * @lmac_peer_id_msb: lmac_peer_id_msb
  75. *
  76. * return: void
  77. */
  78. void
  79. target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_psoc *psoc,
  80. uint8_t pdev_id,
  81. uint8_t *peer_macaddr, uint8_t vdev_id,
  82. bool hash_based, uint8_t ring_num,
  83. uint8_t lmac_peer_id_msb);
  84. /**
  85. * target_if_peer_rx_reorder_queue_setup() - setup rx reorder queue
  86. * @pdev: pdev pointer
  87. * @pdev_id: pdev id
  88. * @vdev_id: vdev id
  89. * @peer_macaddr: peer mac address
  90. * @hw_qdesc: hw queue descriptor
  91. * @tid: tid number
  92. * @queue_no: queue number
  93. * @ba_window_size_valid: BA window size validity flag
  94. * @ba_window_size: BA window size
  95. *
  96. * return: QDF_STATUS_SUCCESS for success or error code
  97. */
  98. QDF_STATUS
  99. target_if_peer_rx_reorder_queue_setup(struct cdp_ctrl_objmgr_psoc *psoc,
  100. uint8_t pdev_id,
  101. uint8_t vdev_id, uint8_t *peer_macaddr,
  102. qdf_dma_addr_t hw_qdesc, int tid,
  103. uint16_t queue_no,
  104. uint8_t ba_window_size_valid,
  105. uint16_t ba_window_size);
  106. /**
  107. * target_if_peer_rx_reorder_queue_remove() - remove rx reorder queue
  108. * @psoc: psoc pointer
  109. * @pdev_id: pdev id
  110. * @vdev_id: vdev id
  111. * @peer_macaddr: peer mac address
  112. * @peer_tid_bitmap: peer tid bitmap
  113. *
  114. * return: QDF_STATUS_SUCCESS for success or error code
  115. */
  116. QDF_STATUS
  117. target_if_peer_rx_reorder_queue_remove(struct cdp_ctrl_objmgr_psoc *psoc,
  118. uint8_t pdev_id,
  119. uint8_t vdev_id, uint8_t *peer_macaddr,
  120. uint32_t peer_tid_bitmap);
  121. /**
  122. * target_if_lro_hash_config() - send LRO hash config to FW
  123. * @psoc_handle: psoc handle pointer
  124. * @lro_hash_cfg: LRO hash config parameters
  125. *
  126. * return: QDF_STATUS_SUCCESS for success or error code
  127. */
  128. QDF_STATUS
  129. target_if_lro_hash_config(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id,
  130. struct cdp_lro_hash_config *lro_hash_cfg);
  131. #ifdef WDS_CONV_TARGET_IF_OPS_ENABLE
  132. /**
  133. * target_if_add_wds_entry() - send wds peer add command to fw
  134. * @soc: SoC handle
  135. * @vdev_id: vdev_id
  136. * @peer_mac: peer mac address
  137. * @dest_mac: MAC address of ast node
  138. * @flags: WDS entry type WMI_HOST_WDS_FLAG_STATIC for static entry
  139. * @type: type from enum cdp_txrx_ast_entry_type
  140. *
  141. * This API is used by WDS source port learning function to
  142. * add a new AST entry in the fw.
  143. *
  144. * return: QDF_STATUS_SUCCESS for success or error code
  145. */
  146. QDF_STATUS
  147. target_if_add_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  148. uint8_t *peer_mac, const uint8_t *dest_mac,
  149. uint32_t flags, uint8_t type);
  150. /**
  151. * target_if_del_wds_entry() - send wds peer del command to fw
  152. * @soc: SoC handle
  153. * @vdev_id: vdev_id
  154. * @dest_mac: MAC address of ast node
  155. * @type: type from enum cdp_txrx_ast_entry_type
  156. * @delete_in_fw: flag to indicate if entry needs to be deleted in fw
  157. *
  158. * This API is used to delete an AST entry from fw
  159. *
  160. * Return: None
  161. */
  162. void
  163. target_if_del_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  164. uint8_t *dest_mac, uint8_t type, uint8_t delete_in_fw);
  165. /**
  166. * target_if_update_wds_entry() - send wds peer update command to fw
  167. * @soc: SoC handle
  168. * @vdev_id: vdev_id
  169. * @dest_mac: MAC address of ast node
  170. * @peer_mac: peer mac address
  171. * @flags: WDS entry type WMI_HOST_WDS_FLAG_STATIC for static entry
  172. *
  173. * This API is used by update the peer mac address for the ast
  174. * in the fw.
  175. *
  176. * return: QDF_STATUS_SUCCESS for success or error code
  177. */
  178. QDF_STATUS
  179. target_if_update_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  180. uint8_t *dest_mac, uint8_t *peer_mac,
  181. uint32_t flags);
  182. #else
  183. static inline QDF_STATUS
  184. target_if_add_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  185. uint8_t *peer_mac, const uint8_t *dest_mac,
  186. uint32_t flags, uint8_t type)
  187. {
  188. return QDF_STATUS_SUCCESS;
  189. }
  190. static inline void
  191. target_if_del_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  192. uint8_t *dest_mac, uint8_t type, uint8_t delete_in_fw)
  193. {
  194. }
  195. static inline QDF_STATUS
  196. target_if_update_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  197. uint8_t *dest_mac, uint8_t *peer_mac,
  198. uint32_t flags)
  199. {
  200. return QDF_STATUS_SUCCESS;
  201. }
  202. #endif /* FEATURE_MCL_REPEATER */
  203. #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF
  204. /**
  205. * target_if_peer_txq_flush_config() - Send flush command for pending frames
  206. * @psoc: psoc handle pointer
  207. * @vdev_id: VDEV id
  208. * @mac: MAC addr of peer for which the tx queue flush is intended
  209. * @ac: AC mask for identifying the tx queues to be flushed
  210. * @tid: TID mask for identifying the tx queues to be flushed
  211. * @policy: Defines the flush policy
  212. *
  213. * Return: 0 for success or error code
  214. */
  215. int target_if_peer_txq_flush_config(struct cdp_ctrl_objmgr_psoc *psoc,
  216. uint8_t vdev_id, uint8_t *mac,
  217. uint8_t ac, uint32_t tid, uint32_t policy);
  218. #else
  219. static inline int
  220. target_if_peer_txq_flush_config(struct cdp_ctrl_objmgr_psoc *psoc,
  221. uint8_t vdev_id, uint8_t *mac,
  222. uint8_t ac, uint32_t tid,
  223. enum cdp_peer_txq_flush_policy policy)
  224. {
  225. return 0;
  226. }
  227. #endif /* WLAN_FEATURE_PEER_TXQ_FLUSH_CONF */
  228. #endif /* _WLAN_TARGET_IF_DP_H_ */