target_if_dp.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. /*
  2. * Copyright (c) 2018-2019 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: 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_mac: peer mac address
  39. * @hw_qdesc_paddr: 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. * @psoc: psoc 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: psoc pointer
  124. * @pdev_id: pdev id
  125. * @lro_hash_cfg: LRO hash config parameters
  126. *
  127. * return: QDF_STATUS_SUCCESS for success or error code
  128. */
  129. QDF_STATUS
  130. target_if_lro_hash_config(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id,
  131. struct cdp_lro_hash_config *lro_hash_cfg);
  132. #ifdef WLAN_SUPPORT_PPEDS
  133. /**
  134. * target_if_peer_set_ppeds_default_routing() - Set PPE DS routing API
  135. * @soc: psoc handle pointer
  136. * @peer_macaddr: Peer MAC address
  137. * @service_code: Service code
  138. * @priority_valid: Priority valid field
  139. * @src_info: Source information
  140. * @vdev_id: VDEV ID
  141. * @use_ppe: use ppe field value
  142. * @ppe_routing_enabled: PPE routing enabled
  143. *
  144. * This API is used for setting PPE default routing configuration
  145. *
  146. * return: QDF_STATUS_SUCCESS for success or error code
  147. */
  148. QDF_STATUS
  149. target_if_peer_set_ppeds_default_routing(struct cdp_ctrl_objmgr_psoc *soc,
  150. uint8_t *peer_macaddr,
  151. uint16_t service_code,
  152. uint8_t priority_valid,
  153. uint16_t src_info,
  154. uint8_t vdev_id, uint8_t use_ppe,
  155. uint8_t ppe_routing_enabled);
  156. #endif
  157. #ifdef WDS_CONV_TARGET_IF_OPS_ENABLE
  158. /**
  159. * target_if_add_wds_entry() - send wds peer add command to fw
  160. * @soc: SoC handle
  161. * @vdev_id: vdev_id
  162. * @peer_mac: peer mac address
  163. * @dest_mac: MAC address of ast node
  164. * @flags: WDS entry type WMI_HOST_WDS_FLAG_STATIC for static entry
  165. * @type: type from enum cdp_txrx_ast_entry_type
  166. *
  167. * This API is used by WDS source port learning function to
  168. * add a new AST entry in the fw.
  169. *
  170. * return: QDF_STATUS_SUCCESS for success or error code
  171. */
  172. QDF_STATUS
  173. target_if_add_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  174. uint8_t *peer_mac, const uint8_t *dest_mac,
  175. uint32_t flags, uint8_t type);
  176. /**
  177. * target_if_del_wds_entry() - send wds peer del command to fw
  178. * @soc: SoC handle
  179. * @vdev_id: vdev_id
  180. * @dest_mac: MAC address of ast node
  181. * @type: type from enum cdp_txrx_ast_entry_type
  182. * @delete_in_fw: flag to indicate if entry needs to be deleted in fw
  183. *
  184. * This API is used to delete an AST entry from fw
  185. *
  186. * Return: None
  187. */
  188. void
  189. target_if_del_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  190. uint8_t *dest_mac, uint8_t type, uint8_t delete_in_fw);
  191. /**
  192. * target_if_update_wds_entry() - send wds peer update command to fw
  193. * @soc: SoC handle
  194. * @vdev_id: vdev_id
  195. * @dest_mac: MAC address of ast node
  196. * @peer_mac: peer mac address
  197. * @flags: WDS entry type WMI_HOST_WDS_FLAG_STATIC for static entry
  198. *
  199. * This API is used by update the peer mac address for the ast
  200. * in the fw.
  201. *
  202. * return: QDF_STATUS_SUCCESS for success or error code
  203. */
  204. QDF_STATUS
  205. target_if_update_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  206. uint8_t *dest_mac, uint8_t *peer_mac,
  207. uint32_t flags);
  208. #else
  209. static inline QDF_STATUS
  210. target_if_add_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  211. uint8_t *peer_mac, const uint8_t *dest_mac,
  212. uint32_t flags, uint8_t type)
  213. {
  214. return QDF_STATUS_SUCCESS;
  215. }
  216. static inline void
  217. target_if_del_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  218. uint8_t *dest_mac, uint8_t type, uint8_t delete_in_fw)
  219. {
  220. }
  221. static inline QDF_STATUS
  222. target_if_update_wds_entry(struct cdp_ctrl_objmgr_psoc *soc, uint8_t vdev_id,
  223. uint8_t *dest_mac, uint8_t *peer_mac,
  224. uint32_t flags)
  225. {
  226. return QDF_STATUS_SUCCESS;
  227. }
  228. #endif /* FEATURE_MCL_REPEATER */
  229. #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF
  230. /**
  231. * target_if_peer_txq_flush_config() - Send flush command for pending frames
  232. * @psoc: psoc handle pointer
  233. * @vdev_id: VDEV id
  234. * @mac: MAC addr of peer for which the tx queue flush is intended
  235. * @ac: AC mask for identifying the tx queues to be flushed
  236. * @tid: TID mask for identifying the tx queues to be flushed
  237. * @policy: Defines the flush policy
  238. *
  239. * Return: 0 for success or error code
  240. */
  241. int target_if_peer_txq_flush_config(struct cdp_ctrl_objmgr_psoc *psoc,
  242. uint8_t vdev_id, uint8_t *mac,
  243. uint8_t ac, uint32_t tid, uint32_t policy);
  244. #else
  245. static inline int
  246. target_if_peer_txq_flush_config(struct cdp_ctrl_objmgr_psoc *psoc,
  247. uint8_t vdev_id, uint8_t *mac,
  248. uint8_t ac, uint32_t tid,
  249. enum cdp_peer_txq_flush_policy policy)
  250. {
  251. return 0;
  252. }
  253. #endif /* WLAN_FEATURE_PEER_TXQ_FLUSH_CONF */
  254. #endif /* _WLAN_TARGET_IF_DP_H_ */