dp_htt.h 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  1. /*
  2. * Copyright (c) 2016-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. #ifndef _DP_HTT_H_
  20. #define _DP_HTT_H_
  21. #include <qdf_types.h>
  22. #include <qdf_lock.h>
  23. #include <qdf_nbuf.h>
  24. #include <htc_api.h>
  25. #include "cdp_txrx_cmn_struct.h"
  26. #include "dp_types.h"
  27. #ifdef HTT_LOGGER
  28. #include "dp_htt_logger.h"
  29. #else
  30. struct htt_logger;
  31. static inline
  32. void htt_interface_logging_init(struct htt_logger **htt_logger_handle,
  33. struct cdp_ctrl_objmgr_psoc *ctrl_psoc)
  34. {
  35. }
  36. static inline
  37. void htt_interface_logging_deinit(struct htt_logger *htt_logger_handle)
  38. {
  39. }
  40. static inline
  41. int htt_command_record(struct htt_logger *h, uint8_t msg_type,
  42. uint8_t *msg_data)
  43. {
  44. return 0;
  45. }
  46. static inline
  47. int htt_event_record(struct htt_logger *h, uint8_t msg_type,
  48. uint8_t *msg_data)
  49. {
  50. return 0;
  51. }
  52. static inline
  53. int htt_wbm_event_record(struct htt_logger *h, uint8_t tx_status,
  54. uint8_t *msg_data)
  55. {
  56. return 0;
  57. }
  58. #endif
  59. #define HTT_MGMT_CTRL_TLV_HDR_RESERVERD_LEN 16
  60. #define HTT_TLV_HDR_LEN HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE
  61. #define HTT_SHIFT_UPPER_TIMESTAMP 32
  62. #define HTT_MASK_UPPER_TIMESTAMP 0xFFFFFFFF00000000
  63. /**
  64. * htt_htc_pkt_pool_free() - Free HTC packet pool
  65. * @soc: HTT SOC handle
  66. */
  67. void htt_htc_pkt_pool_free(struct htt_soc *soc);
  68. #define HTT_TX_MUTEX_TYPE qdf_spinlock_t
  69. #define HTT_TX_MUTEX_INIT(_mutex) \
  70. qdf_spinlock_create(_mutex)
  71. #define HTT_TX_MUTEX_ACQUIRE(_mutex) \
  72. qdf_spin_lock_bh(_mutex)
  73. #define HTT_TX_MUTEX_RELEASE(_mutex) \
  74. qdf_spin_unlock_bh(_mutex)
  75. #define HTT_TX_MUTEX_DESTROY(_mutex) \
  76. qdf_spinlock_destroy(_mutex)
  77. #define DP_HTT_MAX_SEND_QUEUE_DEPTH 64
  78. #ifndef HTT_MAC_ADDR_LEN
  79. #define HTT_MAC_ADDR_LEN 6
  80. #endif
  81. #define HTT_FRAMECTRL_TYPE_MASK 0x0C
  82. #define HTT_GET_FRAME_CTRL_TYPE(_val) \
  83. (((_val) & HTT_FRAMECTRL_TYPE_MASK) >> 2)
  84. #define FRAME_CTRL_TYPE_MGMT 0x0
  85. #define FRAME_CTRL_TYPE_CTRL 0x1
  86. #define FRAME_CTRL_TYPE_DATA 0x2
  87. #define FRAME_CTRL_TYPE_RESV 0x3
  88. #define HTT_FRAMECTRL_DATATYPE 0x08
  89. #define HTT_PPDU_DESC_MAX_DEPTH 16
  90. #define DP_SCAN_PEER_ID 0xFFFF
  91. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  92. #define HTT_RX_DELBA_WIN_SIZE_S 10
  93. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  94. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  95. /*
  96. * Set the base misclist size to HTT copy engine source ring size
  97. * to guarantee that a packet on the misclist won't be freed while it
  98. * is sitting in the copy engine.
  99. */
  100. #define DP_HTT_HTC_PKT_MISCLIST_SIZE 2048
  101. #define HTT_T2H_MAX_MSG_SIZE 2048
  102. #define HTT_T2H_EXT_STATS_TLV_START_OFFSET 3
  103. /*
  104. * Below offset are based on htt_ppdu_stats_common_tlv
  105. * defined in htt_ppdu_stats.h
  106. */
  107. #define HTT_PPDU_STATS_COMMON_TLV_TLV_HDR_OFFSET 0
  108. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_ID_OFFSET 1
  109. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_SCH_CMD_ID_OFFSET 2
  110. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_FRM_TYPE_OFFSET 3
  111. #define HTT_PPDU_STATS_COMMON_TLV_CHAIN_MASK_OFFSET 4
  112. #define HTT_PPDU_STATS_COMMON_TLV_FES_DUR_US_OFFSET 5
  113. #define HTT_PPDU_STATS_COMMON_TLV_SCH_EVAL_START_TSTMP_L32_US_OFFSET 6
  114. #define HTT_PPDU_STATS_COMMON_TLV_SCH_END_TSTMP_US_OFFSET 7
  115. #define HTT_PPDU_STATS_COMMON_TLV_START_TSTMP_L32_US_OFFSET 8
  116. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_PHY_MODE_OFFSET 9
  117. #define HTT_PPDU_STATS_COMMON_TLV_CCA_DELTA_TIME_US_OFFSET 10
  118. #define HTT_PPDU_STATS_COMMON_TLV_RXFRM_DELTA_TIME_US_OFFSET 11
  119. #define HTT_PPDU_STATS_COMMON_TLV_TXFRM_DELTA_TIME_US_OFFSET 12
  120. #define HTT_PPDU_STATS_COMMON_TLV_RESV_NUM_UL_BEAM_OFFSET 13
  121. #define HTT_PPDU_STATS_COMMON_TLV_START_TSTMP_U32_US_OFFSET 14
  122. #define HTT_PPDU_STATS_COMMON_TLV_BSSCOLOR_OBSS_PSR_OFFSET 15
  123. /* get index for field in htt_ppdu_stats_common_tlv */
  124. #define HTT_GET_STATS_CMN_INDEX(index) \
  125. HTT_PPDU_STATS_COMMON_TLV_##index##_OFFSET
  126. #define HTT_VDEV_STATS_TLV_SOC_DROP_CNT_OFFSET 1
  127. #define HTT_VDEV_STATS_TLV_HDR_OFFSET 0
  128. #define HTT_VDEV_STATS_TLV_VDEV_ID_OFFSET 1
  129. #define HTT_VDEV_STATS_TLV_RX_BYTE_CNT_OFFSET 2
  130. #define HTT_VDEV_STATS_TLV_RX_PKT_CNT_OFFSET 4
  131. #define HTT_VDEV_STATS_TLV_TX_SUCCESS_BYTE_CNT_OFFSET 6
  132. #define HTT_VDEV_STATS_TLV_TX_SUCCESS_PKT_CNT_OFFSET 8
  133. #define HTT_VDEV_STATS_TLV_TX_RETRY_PKT_CNT_OFFSET 10
  134. #define HTT_VDEV_STATS_TLV_TX_DROP_PKT_CNT_OFFSET 12
  135. #define HTT_VDEV_STATS_TLV_TX_AGE_OUT_PKT_CNT_OFFSET 14
  136. #define HTT_VDEV_STATS_TLV_TX_RETRY_BYTE_CNT_OFFSET 16
  137. #define HTT_VDEV_STATS_TLV_TX_DROP_BYTE_CNT_OFFSET 18
  138. #define HTT_VDEV_STATS_TLV_TX_AGE_OUT_BYTE_CNT_OFFSET 20
  139. #define HTT_VDEV_STATS_TLV_TX_TQM_BYPASS_PKT_CNT_OFFSET 22
  140. #define HTT_VDEV_STATS_TLV_TX_TQM_BYPASS_BYTE_CNT_OFFSET 24
  141. #define HTT_VDEV_STATS_GET_INDEX(index) \
  142. HTT_VDEV_STATS_TLV_##index##_OFFSET
  143. #define HTT_VDEV_STATS_U32_SHIFT 0x20
  144. #define HTT_VDEV_STATS_U32_MASK 0xFFFFFFFF00000000
  145. #define HTT_VDEV_STATS_L32_MASK 0x00000000FFFFFFFF
  146. #define HTT_VDEV_GET_STATS_U64(msg_word) \
  147. (((((uint64_t)(*(((uint32_t *)msg_word) + 1))) & HTT_VDEV_STATS_L32_MASK) << \
  148. HTT_VDEV_STATS_U32_SHIFT) | ((*(uint32_t *)msg_word) & HTT_VDEV_STATS_L32_MASK))
  149. #define HTT_VDEV_GET_STATS_U32(msg_word) \
  150. ((*(uint32_t *)msg_word) & HTT_VDEV_STATS_L32_MASK)
  151. #define MAX_SCHED_STARVE 100000
  152. #define WRAP_DROP_TSF_DELTA 10000
  153. #define MAX_TSF_32 0xFFFFFFFF
  154. #define dp_htt_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_HTT, params)
  155. #define dp_htt_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_HTT, params)
  156. #define dp_htt_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_HTT, params)
  157. #define dp_htt_info(params...) \
  158. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_HTT, ## params)
  159. #define dp_htt_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_HTT, params)
  160. #define dp_htt_tx_stats_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_HTT_TX_STATS, params)
  161. #define dp_htt_tx_stats_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_HTT_TX_STATS, params)
  162. #define dp_htt_tx_stats_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_HTT_TX_STATS, params)
  163. #define dp_htt_tx_stats_info(params...) \
  164. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_HTT_TX_STATS, ## params)
  165. #define dp_htt_tx_stats_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_HTT_TX_STATS, params)
  166. #define RXMON_GLOBAL_EN_SHIFT 28
  167. /**
  168. * enum dp_full_mon_config - enum to enable/disable full monitor mode
  169. *
  170. * @DP_FULL_MON_DISABLE: Disable full monitor mode
  171. * @DP_FULL_MON_ENABLE: Enable full monitor mode
  172. */
  173. enum dp_full_mon_config {
  174. DP_FULL_MON_DISABLE,
  175. DP_FULL_MON_ENABLE,
  176. };
  177. struct dp_htt_htc_pkt {
  178. void *soc_ctxt;
  179. qdf_dma_addr_t nbuf_paddr;
  180. HTC_PACKET htc_pkt;
  181. };
  182. struct dp_htt_htc_pkt_union {
  183. union {
  184. struct dp_htt_htc_pkt pkt;
  185. struct dp_htt_htc_pkt_union *next;
  186. } u;
  187. };
  188. struct bp_handler {
  189. unsigned long bp_start_tt;
  190. unsigned long bp_last_tt;
  191. unsigned long bp_duration;
  192. unsigned long bp_counter;
  193. };
  194. struct dp_htt_timestamp {
  195. struct bp_handler *umac_path;
  196. struct bp_handler *lmac_path;
  197. };
  198. struct htt_soc {
  199. struct cdp_ctrl_objmgr_psoc *ctrl_psoc;
  200. struct dp_soc *dp_soc;
  201. hal_soc_handle_t hal_soc;
  202. struct dp_htt_timestamp pdevid_tt[MAX_PDEV_CNT];
  203. /* htt_logger handle */
  204. struct htt_logger *htt_logger_handle;
  205. HTC_HANDLE htc_soc;
  206. qdf_device_t osdev;
  207. HTC_ENDPOINT_ID htc_endpoint;
  208. struct dp_htt_htc_pkt_union *htt_htc_pkt_freelist;
  209. struct dp_htt_htc_pkt_union *htt_htc_pkt_misclist;
  210. struct {
  211. u_int8_t major;
  212. u_int8_t minor;
  213. } tgt_ver;
  214. struct {
  215. u_int8_t major;
  216. u_int8_t minor;
  217. } wifi_ip_ver;
  218. struct {
  219. int htc_err_cnt;
  220. int htc_pkt_free;
  221. int skip_count;
  222. int fail_count;
  223. /* rtpm put skip count for ver req msg */
  224. int htt_ver_req_put_skip;
  225. } stats;
  226. HTT_TX_MUTEX_TYPE htt_tx_mutex;
  227. };
  228. #ifdef QCA_MONITOR_2_0_SUPPORT
  229. /**
  230. * struct dp_tx_mon_downstream_tlv_config - Enable/Disable TxMon
  231. * downstream TLVs
  232. * @tx_fes_setup: TX_FES_SETUP TLV
  233. * @tx_peer_entry: TX_PEER_ENTRY TLV
  234. * @tx_queue_extension: TX_QUEUE_EXTENSION TLV
  235. * @tx_last_mpdu_end: TX_LAST_MPDU_END TLV
  236. * @tx_last_mpdu_fetched: TX_LAST_MPDU_FETCHED TLV
  237. * @tx_data_sync: TX_DATA_SYNC TLV
  238. * @pcu_ppdu_setup_init: PCU_PPDU_SETUP_INIT TLV
  239. * @fw2s_mon: FW2S_MON TLV
  240. * @tx_loopback_setup: TX_LOOPBACK_SETUP TLV
  241. * @sch_critical_tlv_ref: SCH_CRITICAL_TLV_REF TLV
  242. * @ndp_preamble_done: NDP_PREAMBLE_DONE TLV
  243. * @tx_raw_frame_setup: TX_RAW_OR_NATIVE_FRAME_SETUP TLV
  244. * @txpcu_user_setup: TXPCU_USER_SETUP TLV
  245. * @rxpcu_setup: RXPCU_SETUP TLV
  246. * @rxpcu_setup_complete: RXPCU_SETUP_COMPLETE TLV
  247. * @coex_tx_req: COEX_TX_REQ TLV
  248. * @rxpcu_user_setup: RXPCU_USER_SETUP TLV
  249. * @rxpcu_user_setup_ext: RXPCU_USER_SETUP_EXT TLV
  250. * @wur_data: WUR_DATA TLV
  251. * @tqm_mpdu_global_start: TQM_MPDU_GLOBAL_START
  252. * @tx_fes_setup_complete: TX_FES_SETUP_COMPLETE TLV
  253. * @scheduler_end: SCHEDULER_END TLV
  254. * @sch_wait_instr_tx_path: SCH_WAIT_INSTR_TX_PATH TLV
  255. *
  256. */
  257. struct dp_tx_mon_downstream_tlv_config {
  258. uint32_t tx_fes_setup:1,
  259. tx_peer_entry:1,
  260. tx_queue_extension:1,
  261. tx_last_mpdu_end:1,
  262. tx_last_mpdu_fetched:1,
  263. tx_data_sync:1,
  264. pcu_ppdu_setup_init:1,
  265. fw2s_mon:1,
  266. tx_loopback_setup:1,
  267. sch_critical_tlv_ref:1,
  268. ndp_preamble_done:1,
  269. tx_raw_frame_setup:1,
  270. txpcu_user_setup:1,
  271. rxpcu_setup:1,
  272. rxpcu_setup_complete:1,
  273. coex_tx_req:1,
  274. rxpcu_user_setup:1,
  275. rxpcu_user_setup_ext:1,
  276. wur_data:1,
  277. tqm_mpdu_global_start:1,
  278. tx_fes_setup_complete:1,
  279. scheduler_end:1,
  280. sch_wait_instr_tx_path:1;
  281. };
  282. /**
  283. * struct dp_tx_mon_upstream_tlv_config - Enable/Disable TxMon
  284. * upstream TLVs
  285. * @rx_response_required_info: RX_RESPONSE_REQUIRED_INFO
  286. * TLV
  287. * @response_start_status: RESPONSE_START_STATUS TLV
  288. * @response_end_status: RESPONSE_END_STATUS TLV
  289. * @tx_fes_status_start: TX_FES_STATUS_START TLV
  290. * @tx_fes_status_end: TX_FES_STATUS_END TLV
  291. * @tx_fes_status_start_ppdu: TX_FES_STATUS_START_PPDU TLV
  292. * @tx_fes_status_user_ppdu: TX_FES_STATUS_USER_PPDU TLV
  293. * @tx_fes_status_ack_or_ba: TX_FES_STATUS_ACK_OR_BA TLV
  294. * @tx_fes_status_1k_ba: TX_FES_STATUS_1K_BA TLV
  295. * @tx_fes_status_start_prot: TX_FES_STATUS_START_PROTO TLV
  296. * @tx_fes_status_prot: TX_FES_STATUS_PROTO TLV
  297. * @tx_fes_status_user_response: TX_FES_STATUS_USER_RESPONSE TLV
  298. * @rx_frame_bitmap_ack: RX_FRAME_BITMAP_ACK TLV
  299. * @rx_frame_1k_bitmap_ack: RX_FRAME_1K_BITMAP_ACK TLV
  300. * @coex_tx_status: COEX_TX_STATUS TLV
  301. * @received_response_info: RECEIVED_RESPONSE_INFO TLV
  302. * @received_response_info_p2: RECEIVED_RESPONSE_INFO_PART2 TLV
  303. * @ofdma_trigger_details: OFDMA_TRIGGER_DETAILS
  304. * @received_trigger_info: RECEIVED_TRIGGER_INFO
  305. * @pdg_tx_request: PDG_TX_REQUEST
  306. * @pdg_response: PDG_RESPONSE
  307. * @pdg_trig_response: PDG_TRIG_RESPONSE
  308. * @trigger_response_tx_done: TRIGGER_RESPONSE_TX_DONE
  309. * @prot_tx_end: PROT_TX_END
  310. * @ppdu_tx_end: PPDU_TX_END
  311. * @r2r_status_end: R2R_STATUS_END
  312. * @flush_req: FLUSH_REQ
  313. * @mactx_phy_desc: MACTX_PHY_DESC
  314. * @mactx_user_desc_cmn: MACTX_USER_DESC_COMMON
  315. * @mactx_user_desc_per_usr: MACTX_USER_DESC_PER_USER
  316. * @tqm_acked_1k_mpdu: TQM_ACKED_1K_MPDU
  317. * @tqm_acked_mpdu: TQM_ACKED_MPDU
  318. * @tqm_update_tx_mpdu_count: TQM_UPDATE_TX_MPDU_COUNT
  319. * @phytx_ppdu_header_info_request: PHYTX_PPDU_HEADER_INFO_REQUEST
  320. * @u_sig_eht_su_mu: U_SIG_EHT_SU_MU
  321. * @u_sig_eht_su: U_SIG_EHT_SU
  322. * @u_sig_eht_tb: U_SIG_EHT_TB
  323. * @eht_sig_usr_su: EHT_SIG_USR_SU
  324. * @eht_sig_usr_mu_mimo: EHT_SIG_USR_MU_MIMO
  325. * @eht_sig_usr_ofdma: EHT_SIG_USR_MU_MIMO
  326. * @he_sig_a_su: HE_SIG_A_SU
  327. * @he_sig_a_mu_dl: HE_SIG_A_MU_DL
  328. * @he_sig_a_mu_ul: HE_SIG_A_MU_UL
  329. * @he_sig_b1_mu: HE_SIG_B1_MU
  330. * @he_sig_b2_mu: HE_SIG_B2_MU
  331. * @he_sig_b2_ofdma: HE_SIG_B2_OFDMA
  332. * @vht_sig_b_mu160: VHT_SIG_B_MU160
  333. * @vht_sig_b_mu80: VHT_SIG_B_MU80
  334. * @vht_sig_b_mu40: VHT_SIG_B_MU40
  335. * @vht_sig_b_mu20: VHT_SIG_B_MU20
  336. * @vht_sig_b_su160: VHT_SIG_B_SU160
  337. * @vht_sig_b_su80: VHT_SIG_B_SU80
  338. * @vht_sig_b_su40: VHT_SIG_B_SU40
  339. * @vht_sig_b_su20: VHT_SIG_B_SU20
  340. * @vht_sig_a: VHT_SIG_A
  341. * @ht_sig: HT_SIG
  342. * @l_sig_b: L_SIG_B
  343. * @l_sig_a: L_SIG_A
  344. * @tx_service: TX_SERVICE
  345. * @txpcu_buf_status: TXPCU_BUFFER_STATUS
  346. * @txpcu_user_buf_status: TXPCU_USER_BUFFER_STATUS
  347. * @txdma_stop_request: TXDMA_STOP_REQUEST
  348. * @expected_response: EXPECTED_RESPONSE
  349. * @tx_mpdu_count_transfer_end: TX_MPDU_COUNT_TRANSFER_END
  350. * @rx_trig_info: RX_TRIG_INFO
  351. * @rxpcu_tx_setup_clear: RXPCU_TX_SETUP_CLEAR
  352. * @rx_frame_bitmap_req: RX_FRAME_BITMAP_REQ
  353. * @rx_phy_sleep: RX_PHY_SLEEP
  354. * @txpcu_preamble_done: TXPCU_PREAMBLE_DONE
  355. * @txpcu_phytx_debug32: TXPCU_PHYTX_DEBUG32
  356. * @txpcu_phytx_other_transmit_info32: TXPCU_PHYTX_OTHER_TRANSMIT_INFO32
  357. * @rx_ppdu_noack_report: RX_PPDU_NO_ACK_REPORT
  358. * @rx_ppdu_ack_report: RX_PPDU_ACK_REPORT
  359. * @coex_rx_status: COEX_RX_STATUS
  360. * @rx_start_param: RX_START_PARAM
  361. * @tx_cbf_info: TX_CBF_INFO
  362. * @rxpcu_early_rx_indication: RXPCU_EARLY_RX_INDICATION
  363. * @received_response_user_7_0: RECEIVED_RESPONSE_USER_7_0
  364. * @received_response_user_15_8: RECEIVED_RESPONSE_USER_15_8
  365. * @received_response_user_23_16: RECEIVED_RESPONSE_USER_23_16
  366. * @received_response_user_31_24: RECEIVED_RESPONSE_USER_31_24
  367. * @received_response_user_36_32: RECEIVED_RESPONSE_USER_36_32
  368. * @rx_pm_info: RX_PM_INFO
  369. * @rx_preamble: RX_PREAMBLE
  370. * @others: OTHERS
  371. * @mactx_pre_phy_desc: MACTX_PRE_PHY_DESC
  372. *
  373. */
  374. struct dp_tx_mon_upstream_tlv_config {
  375. uint32_t rx_response_required_info:1,
  376. response_start_status:1,
  377. response_end_status:1,
  378. tx_fes_status_start:1,
  379. tx_fes_status_end:1,
  380. tx_fes_status_start_ppdu:1,
  381. tx_fes_status_user_ppdu:1,
  382. tx_fes_status_ack_or_ba:1,
  383. tx_fes_status_1k_ba:1,
  384. tx_fes_status_start_prot:1,
  385. tx_fes_status_prot:1,
  386. tx_fes_status_user_response:1,
  387. rx_frame_bitmap_ack:1,
  388. rx_frame_1k_bitmap_ack:1,
  389. coex_tx_status:1,
  390. received_response_info:1,
  391. received_response_info_p2:1,
  392. ofdma_trigger_details:1,
  393. received_trigger_info:1,
  394. pdg_tx_request:1,
  395. pdg_response:1,
  396. pdg_trig_response:1,
  397. trigger_response_tx_done:1,
  398. prot_tx_end:1,
  399. ppdu_tx_end:1,
  400. r2r_status_end:1,
  401. flush_req:1,
  402. mactx_phy_desc:1,
  403. mactx_user_desc_cmn:1,
  404. mactx_user_desc_per_usr:1;
  405. uint32_t tqm_acked_1k_mpdu:1,
  406. tqm_acked_mpdu:1,
  407. tqm_update_tx_mpdu_count:1,
  408. phytx_ppdu_header_info_request:1,
  409. u_sig_eht_su_mu:1,
  410. u_sig_eht_su:1,
  411. u_sig_eht_tb:1,
  412. eht_sig_usr_su:1,
  413. eht_sig_usr_mu_mimo:1,
  414. eht_sig_usr_ofdma:1,
  415. he_sig_a_su:1,
  416. he_sig_a_mu_dl:1,
  417. he_sig_a_mu_ul:1,
  418. he_sig_b1_mu:1,
  419. he_sig_b2_mu:1,
  420. he_sig_b2_ofdma:1,
  421. vht_sig_b_mu160:1,
  422. vht_sig_b_mu80:1,
  423. vht_sig_b_mu40:1,
  424. vht_sig_b_mu20:1,
  425. vht_sig_b_su160:1,
  426. vht_sig_b_su80:1,
  427. vht_sig_b_su40:1,
  428. vht_sig_b_su20:1,
  429. vht_sig_a:1,
  430. ht_sig:1,
  431. l_sig_b:1,
  432. l_sig_a:1,
  433. tx_service:1;
  434. uint32_t txpcu_buf_status:1,
  435. txpcu_user_buf_status:1,
  436. txdma_stop_request:1,
  437. expected_response:1,
  438. tx_mpdu_count_transfer_end:1,
  439. rx_trig_info:1,
  440. rxpcu_tx_setup_clear:1,
  441. rx_frame_bitmap_req:1,
  442. rx_phy_sleep:1,
  443. txpcu_preamble_done:1,
  444. txpcu_phytx_debug32:1,
  445. txpcu_phytx_other_transmit_info32:1,
  446. rx_ppdu_noack_report:1,
  447. rx_ppdu_ack_report:1,
  448. coex_rx_status:1,
  449. rx_start_param:1,
  450. tx_cbf_info:1,
  451. rxpcu_early_rx_indication:1,
  452. received_response_user_7_0:1,
  453. received_response_user_15_8:1,
  454. received_response_user_23_16:1,
  455. received_response_user_31_24:1,
  456. received_response_user_36_32:1,
  457. rx_pm_info:1,
  458. rx_preamble:1,
  459. others:1,
  460. mactx_pre_phy_desc:1;
  461. };
  462. /**
  463. * struct dp_tx_mon_wordmask_config - Tx monitor word mask
  464. * @tx_fes_setup: TX_FES_SETUP TLV word mask
  465. * @tx_peer_entry: TX_PEER_ENTRY TLV word mask
  466. * @tx_queue_ext: TX_QUEUE_EXTENSION TLV word mask
  467. * @tx_msdu_start: TX_MSDU_START TLV word mask
  468. * @tx_mpdu_start: TX_MPDU_START TLV word mask
  469. * @pcu_ppdu_setup_init: PCU_PPDU_SETUP TLV word mask
  470. * @rxpcu_user_setup: RXPCU_USER_SETUP TLV word mask
  471. */
  472. struct dp_tx_mon_wordmask_config {
  473. uint16_t tx_fes_setup;
  474. uint16_t tx_peer_entry;
  475. uint16_t tx_queue_ext;
  476. uint16_t tx_msdu_start;
  477. uint16_t tx_mpdu_start;
  478. uint32_t pcu_ppdu_setup_init;
  479. uint16_t rxpcu_user_setup;
  480. };
  481. /**
  482. * struct htt_tx_ring_tlv_filter - Tx ring TLV filter
  483. * enable/disable.
  484. * @dtlvs: enable/disable downstream TLVs
  485. * @utlvs: enable/disable upstream TLVs
  486. * @wmask: enable/disable word mask subscription
  487. * @mgmt_filter: enable/disable mgmt packets
  488. * @data_filter: enable/disable data packets
  489. * @ctrl_filter: enable/disable ctrl packets
  490. * @mgmt_dma_length: configure length for mgmt packet
  491. * @ctrl_dma_length: configure length for ctrl packet
  492. * @data_dma_length: configure length for data packet
  493. * @mgmt_mpdu_end: enable mpdu end tlv for mgmt
  494. * @mgmt_msdu_end: enable msdu end tlv for mgmt
  495. * @mgmt_msdu_start: enable msdu start tlv for mgmt
  496. * @mgmt_mpdu_start: enable mpdu start tlv for mgmt
  497. * @ctrl_mpdu_end: enable mpdu end tlv for ctrl
  498. * @ctrl_msdu_end: enable msdu end tlv for ctrl
  499. * @ctrl_msdu_start: enable msdu start tlv for ctrl
  500. * @ctrl_mpdu_start: enable mpdu start tlv for ctrl
  501. * @data_mpdu_end: enable mpdu end tlv for data
  502. * @data_msdu_end: enable msdu end tlv for data
  503. * @data_msdu_start: enable msdu start tlv for data
  504. * @data_mpdu_start: enable mpdu start tlv for data
  505. * @mgmt_mpdu_log: enable mgmt mpdu level logging
  506. * @ctrl_mpdu_log: enable ctrl mpdu level logging
  507. * @data_mpdu_log: enable data mpdu level logging
  508. * @enable: enable tx monitor
  509. *
  510. * NOTE: Do not change the layout of this structure
  511. */
  512. struct htt_tx_ring_tlv_filter {
  513. struct dp_tx_mon_downstream_tlv_config dtlvs;
  514. struct dp_tx_mon_upstream_tlv_config utlvs;
  515. struct dp_tx_mon_wordmask_config wmask;
  516. uint16_t mgmt_filter;
  517. uint16_t data_filter;
  518. uint16_t ctrl_filter;
  519. uint16_t mgmt_dma_length:3,
  520. ctrl_dma_length:3,
  521. data_dma_length:3;
  522. uint16_t mgmt_mpdu_end:1,
  523. mgmt_msdu_end:1,
  524. mgmt_msdu_start:1,
  525. mgmt_mpdu_start:1,
  526. ctrl_mpdu_end:1,
  527. ctrl_msdu_end:1,
  528. ctrl_msdu_start:1,
  529. ctrl_mpdu_start:1,
  530. data_mpdu_end:1,
  531. data_msdu_end:1,
  532. data_msdu_start:1,
  533. data_mpdu_start:1;
  534. uint8_t mgmt_mpdu_log:1,
  535. ctrl_mpdu_log:1,
  536. data_mpdu_log:1;
  537. uint8_t enable:1;
  538. };
  539. #endif /* QCA_MONITOR_2_0_SUPPORT */
  540. /**
  541. * struct htt_rx_ring_tlv_filter - Rx ring TLV filter
  542. * enable/disable.
  543. * @mpdu_start: enable/disable MPDU start TLV
  544. * @msdu_start: enable/disable MSDU start TLV
  545. * @packet: enable/disable PACKET TLV
  546. * @msdu_end: enable/disable MSDU end TLV
  547. * @mpdu_end: enable/disable MPDU end TLV
  548. * @packet_header: enable/disable PACKET header TLV
  549. * @attention: enable/disable ATTENTION TLV
  550. * @ppdu_start: enable/disable PPDU start TLV
  551. * @ppdu_end: enable/disable PPDU end TLV
  552. * @ppdu_end_user_stats: enable/disable PPDU user stats TLV
  553. * @ppdu_end_user_stats_ext: enable/disable PPDU user stats ext TLV
  554. * @ppdu_end_status_done: enable/disable PPDU end status done TLV
  555. * @ppdu_start_user_info:
  556. * @header_per_msdu:
  557. * @enable_fp: enable/disable FP packet
  558. * @enable_md: enable/disable MD packet
  559. * @enable_mo: enable/disable MO packet
  560. * @fp_mgmt_filter:
  561. * @mo_mgmt_filter:
  562. * @fp_ctrl_filter:
  563. * @mo_ctrl_filter:
  564. * @fp_data_filter:
  565. * @mo_data_filter:
  566. * @md_data_filter:
  567. * @md_mgmt_filter:
  568. * @md_ctrl_filter:
  569. * @offset_valid: Flag to indicate if below offsets are valid
  570. * @rx_packet_offset: Offset of packet payload
  571. * @rx_header_offset: Offset of rx_header tlv
  572. * @rx_mpdu_end_offset: Offset of rx_mpdu_end tlv
  573. * @rx_mpdu_start_offset: Offset of rx_mpdu_start tlv
  574. * @rx_msdu_end_offset: Offset of rx_msdu_end tlv
  575. * @rx_msdu_start_offset: Offset of rx_msdu_start tlv
  576. * @rx_attn_offset: Offset of rx_attention tlv
  577. * @fp_phy_err: Flag to indicate FP PHY status tlv
  578. * @fp_phy_err_buf_src: source ring selection for the FP PHY ERR status tlv
  579. * @fp_phy_err_buf_dest: dest ring selection for the FP PHY ERR status tlv
  580. * @phy_err_filter_valid:
  581. * @phy_err_mask: select the phy errors defined in phyrx_abort_request_reason
  582. * enums 0 to 31.
  583. * @phy_err_mask_cont: select the fp phy errors defined in
  584. * phyrx_abort_request_reason enums 32 to 63
  585. * @rx_mpdu_start_wmask: word mask for mpdu start tlv
  586. * @rx_mpdu_end_wmask: word mask for mpdu end tlv
  587. * @rx_msdu_end_wmask: word mask for msdu end tlv
  588. * @rx_pkt_tlv_offset: rx pkt tlv offset
  589. * @mgmt_dma_length: configure length for mgmt packet
  590. * @ctrl_dma_length: configure length for ctrl packet
  591. * @data_dma_length: configure length for data packet
  592. * @rx_hdr_length: configure length for rx header tlv
  593. * @mgmt_mpdu_log: enable mgmt mpdu level logging
  594. * @ctrl_mpdu_log: enable ctrl mpdu level logging
  595. * @data_mpdu_log: enable data mpdu level logging
  596. * @enable: enable rx monitor
  597. * @enable_fpmo: enable/disable FPMO packet
  598. * @fpmo_data_filter: FPMO mode data filter
  599. * @fpmo_mgmt_filter: FPMO mode mgmt filter
  600. * @fpmo_ctrl_filter: FPMO mode ctrl filter
  601. * @enable_mon_mac_filter: enable/disable mac based filter on scan radio
  602. *
  603. * NOTE: Do not change the layout of this structure
  604. */
  605. struct htt_rx_ring_tlv_filter {
  606. u_int32_t mpdu_start:1,
  607. msdu_start:1,
  608. packet:1,
  609. msdu_end:1,
  610. mpdu_end:1,
  611. packet_header:1,
  612. attention:1,
  613. ppdu_start:1,
  614. ppdu_end:1,
  615. ppdu_end_user_stats:1,
  616. ppdu_end_user_stats_ext:1,
  617. ppdu_end_status_done:1,
  618. ppdu_start_user_info:1,
  619. header_per_msdu:1,
  620. enable_fp:1,
  621. enable_md:1,
  622. enable_mo:1;
  623. u_int32_t fp_mgmt_filter:16,
  624. mo_mgmt_filter:16;
  625. u_int32_t fp_ctrl_filter:16,
  626. mo_ctrl_filter:16;
  627. u_int32_t fp_data_filter:16,
  628. mo_data_filter:16;
  629. u_int16_t md_data_filter;
  630. u_int16_t md_mgmt_filter;
  631. u_int16_t md_ctrl_filter;
  632. bool offset_valid;
  633. uint16_t rx_packet_offset;
  634. uint16_t rx_header_offset;
  635. uint16_t rx_mpdu_end_offset;
  636. uint16_t rx_mpdu_start_offset;
  637. uint16_t rx_msdu_end_offset;
  638. uint16_t rx_msdu_start_offset;
  639. uint16_t rx_attn_offset;
  640. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  641. u_int32_t fp_phy_err:1,
  642. fp_phy_err_buf_src:2,
  643. fp_phy_err_buf_dest:2,
  644. phy_err_filter_valid:1;
  645. u_int32_t phy_err_mask;
  646. u_int32_t phy_err_mask_cont;
  647. #endif
  648. #if defined(QCA_MONITOR_2_0_SUPPORT) || defined(CONFIG_WORD_BASED_TLV) || \
  649. defined(CONFIG_MON_WORD_BASED_TLV)
  650. uint32_t rx_mpdu_start_wmask;
  651. uint16_t rx_mpdu_end_wmask;
  652. uint32_t rx_msdu_end_wmask;
  653. uint16_t rx_pkt_tlv_offset;
  654. uint16_t mgmt_dma_length:3,
  655. ctrl_dma_length:3,
  656. data_dma_length:3,
  657. rx_hdr_length:3,
  658. mgmt_mpdu_log:1,
  659. ctrl_mpdu_log:1,
  660. data_mpdu_log:1,
  661. enable:1;
  662. u_int16_t enable_fpmo:1;
  663. u_int16_t fpmo_data_filter;
  664. u_int16_t fpmo_mgmt_filter;
  665. u_int16_t fpmo_ctrl_filter;
  666. #endif
  667. bool enable_mon_mac_filter;
  668. };
  669. /**
  670. * struct dp_htt_rx_flow_fst_setup - Rx FST setup message
  671. * @pdev_id: DP Pdev identifier
  672. * @max_entries: Size of Rx FST in number of entries
  673. * @max_search: Number of collisions allowed
  674. * @base_addr_lo: lower 32-bit physical address
  675. * @base_addr_hi: upper 32-bit physical address
  676. * @ip_da_sa_prefix: IPv4 prefix to map to IPv6 address scheme
  677. * @hash_key_len: Rx FST hash key size
  678. * @hash_key: Rx FST Toeplitz hash key
  679. */
  680. struct dp_htt_rx_flow_fst_setup {
  681. uint8_t pdev_id;
  682. uint32_t max_entries;
  683. uint32_t max_search;
  684. uint32_t base_addr_lo;
  685. uint32_t base_addr_hi;
  686. uint32_t ip_da_sa_prefix;
  687. uint32_t hash_key_len;
  688. uint8_t *hash_key;
  689. };
  690. /**
  691. * enum dp_htt_flow_fst_operation - FST related operations allowed
  692. * @DP_HTT_FST_CACHE_OP_NONE: Cache no-op
  693. * @DP_HTT_FST_CACHE_INVALIDATE_ENTRY: Invalidate single cache entry
  694. * @DP_HTT_FST_CACHE_INVALIDATE_FULL: Invalidate entire cache
  695. * @DP_HTT_FST_ENABLE: Bypass FST is enabled
  696. * @DP_HTT_FST_DISABLE: Disable bypass FST
  697. */
  698. enum dp_htt_flow_fst_operation {
  699. DP_HTT_FST_CACHE_OP_NONE,
  700. DP_HTT_FST_CACHE_INVALIDATE_ENTRY,
  701. DP_HTT_FST_CACHE_INVALIDATE_FULL,
  702. DP_HTT_FST_ENABLE,
  703. DP_HTT_FST_DISABLE
  704. };
  705. /**
  706. * struct dp_htt_rx_flow_fst_operation - Rx FST operation message
  707. * @pdev_id: DP Pdev identifier
  708. * @op_code: FST operation to be performed by FW/HW
  709. * @rx_flow: Rx Flow information on which operation is to be performed
  710. */
  711. struct dp_htt_rx_flow_fst_operation {
  712. uint8_t pdev_id;
  713. enum dp_htt_flow_fst_operation op_code;
  714. struct cdp_rx_flow_info *rx_flow;
  715. };
  716. /**
  717. * struct dp_htt_rx_fisa_cfg - Rx fisa config
  718. * @pdev_id: DP Pdev identifier
  719. * @fisa_timeout: fisa aggregation timeout
  720. */
  721. struct dp_htt_rx_fisa_cfg {
  722. uint8_t pdev_id;
  723. uint32_t fisa_timeout;
  724. };
  725. /**
  726. * htt_htc_pkt_alloc() - Allocate HTC packet buffer
  727. * @soc: HTT SOC handle
  728. *
  729. * Return: Pointer to htc packet buffer
  730. */
  731. struct dp_htt_htc_pkt *htt_htc_pkt_alloc(struct htt_soc *soc);
  732. /**
  733. * htt_htc_pkt_free() - Free HTC packet buffer
  734. * @soc: HTT SOC handle
  735. * @pkt: packet to free
  736. */
  737. void
  738. htt_htc_pkt_free(struct htt_soc *soc, struct dp_htt_htc_pkt *pkt);
  739. #define HTT_HTC_PKT_STATUS_SUCCESS \
  740. ((pkt->htc_pkt.Status != QDF_STATUS_E_CANCELED) && \
  741. (pkt->htc_pkt.Status != QDF_STATUS_E_RESOURCES))
  742. #ifdef ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST
  743. static void
  744. htt_htc_misc_pkt_list_add(struct htt_soc *soc, struct dp_htt_htc_pkt *pkt)
  745. {
  746. }
  747. #else /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
  748. /**
  749. * htt_htc_misc_pkt_list_add() - Add pkt to misc list
  750. * @soc: HTT SOC handle
  751. * @pkt: pkt to be added to list
  752. */
  753. void
  754. htt_htc_misc_pkt_list_add(struct htt_soc *soc, struct dp_htt_htc_pkt *pkt);
  755. #endif /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
  756. /**
  757. * DP_HTT_SEND_HTC_PKT() - Send htt packet from host
  758. * @soc : HTT SOC handle
  759. * @pkt: pkt to be send
  760. * @cmd : command to be recorded in dp htt logger
  761. * @buf : Pointer to buffer needs to be recorded for above cmd
  762. *
  763. * Return: None
  764. */
  765. static inline QDF_STATUS DP_HTT_SEND_HTC_PKT(struct htt_soc *soc,
  766. struct dp_htt_htc_pkt *pkt,
  767. uint8_t cmd, uint8_t *buf)
  768. {
  769. QDF_STATUS status;
  770. htt_command_record(soc->htt_logger_handle, cmd, buf);
  771. status = htc_send_pkt(soc->htc_soc, &pkt->htc_pkt);
  772. if (status == QDF_STATUS_SUCCESS && HTT_HTC_PKT_STATUS_SUCCESS)
  773. htt_htc_misc_pkt_list_add(soc, pkt);
  774. else
  775. soc->stats.fail_count++;
  776. return status;
  777. }
  778. /**
  779. * dp_htt_rx_fisa_config(): Send HTT msg to configure FISA
  780. * @pdev: DP pdev handle
  781. * @fisa_config: Flow entry parameters
  782. *
  783. * Return: Success when HTT message is sent, error on failure
  784. */
  785. QDF_STATUS dp_htt_rx_fisa_config(struct dp_pdev *pdev,
  786. struct dp_htt_rx_fisa_cfg *fisa_config);
  787. #ifdef WLAN_SUPPORT_PPEDS
  788. /**
  789. * struct dp_htt_rxdma_rxole_ppe_config - Rx DMA and RxOLE PPE config
  790. * @override: RxDMA override to override the reo_destinatoin_indication
  791. * @reo_destination_indication: REO destination indication value
  792. * @multi_buffer_msdu_override_en: Override the indicatio for SG
  793. * @intra_bss_override: Rx OLE IntraBSS override
  794. * @decap_raw_override: Rx Decap Raw override
  795. * @decap_nwifi_override: Rx Native override
  796. * @ip_frag_override: IP fragments override
  797. * @reserved: Reserved
  798. */
  799. struct dp_htt_rxdma_rxole_ppe_config {
  800. uint32_t override:1,
  801. reo_destination_indication:5,
  802. multi_buffer_msdu_override_en:1,
  803. intra_bss_override:1,
  804. decap_raw_override:1,
  805. decap_nwifi_override:1,
  806. ip_frag_override:1,
  807. reserved:21;
  808. };
  809. /**
  810. * dp_htt_rxdma_rxole_ppe_cfg_set() - Send RxOLE and RxDMA PPE config
  811. * @soc: Data path SoC handle
  812. * @cfg: RxDMA and RxOLE PPE config
  813. *
  814. * Return: Success when HTT message is sent, error on failure
  815. */
  816. QDF_STATUS
  817. dp_htt_rxdma_rxole_ppe_cfg_set(struct dp_soc *soc,
  818. struct dp_htt_rxdma_rxole_ppe_config *cfg);
  819. #endif /* WLAN_SUPPORT_PPEDS */
  820. /**
  821. * htt_soc_initialize() - SOC level HTT initialization
  822. * @htt_soc: Opaque htt SOC handle
  823. * @ctrl_psoc: Opaque ctrl SOC handle
  824. * @htc_soc: SOC level HTC handle
  825. * @hal_soc_hdl: Opaque HAL SOC handle
  826. * @osdev: QDF device
  827. *
  828. * Return: HTT handle on success; NULL on failure
  829. */
  830. void *
  831. htt_soc_initialize(struct htt_soc *htt_soc,
  832. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  833. HTC_HANDLE htc_soc,
  834. hal_soc_handle_t hal_soc_hdl, qdf_device_t osdev);
  835. /**
  836. * htt_soc_attach() - attach DP and HTT SOC
  837. * @soc: DP SOC handle
  838. * @htc_hdl: HTC handle
  839. *
  840. * Return: htt_soc handle on Success, NULL on Failure
  841. */
  842. struct htt_soc *htt_soc_attach(struct dp_soc *soc, HTC_HANDLE htc_hdl);
  843. /**
  844. * htt_set_htc_handle() - set HTC handle
  845. * @htt_hdl: HTT handle/SOC
  846. * @htc_soc: HTC handle
  847. *
  848. * Return: None
  849. */
  850. void htt_set_htc_handle(struct htt_soc *htt_hdl, HTC_HANDLE htc_soc);
  851. /**
  852. * htt_get_htc_handle() - set HTC handle
  853. * @htt_hdl: HTT handle/SOC
  854. *
  855. * Return: HTC_HANDLE
  856. */
  857. HTC_HANDLE htt_get_htc_handle(struct htt_soc *htt_hdl);
  858. /**
  859. * htt_soc_htc_dealloc() - HTC memory de-alloc
  860. * @htt_handle: SOC level HTT handle
  861. *
  862. * Return: None
  863. */
  864. void htt_soc_htc_dealloc(struct htt_soc *htt_handle);
  865. /**
  866. * htt_soc_htc_prealloc() - HTC memory prealloc
  867. * @htt_soc: SOC level HTT handle
  868. *
  869. * Return: QDF_STATUS_SUCCESS on success or
  870. * QDF_STATUS_E_NO_MEM on allocation failure
  871. */
  872. QDF_STATUS htt_soc_htc_prealloc(struct htt_soc *htt_soc);
  873. /**
  874. * htt_soc_detach() - Free SOC level HTT handle
  875. * @htt_hdl: HTT SOC handle
  876. */
  877. void htt_soc_detach(struct htt_soc *htt_hdl);
  878. /**
  879. * htt_srng_setup() - Send SRNG setup message to target
  880. * @htt_soc: HTT SOC handle
  881. * @pdev_id: pdev Id
  882. * @hal_ring_hdl: Opaque HAL SRNG pointer
  883. * @hal_ring_type: SRNG ring type
  884. *
  885. * Return: 0 on success; error code on failure
  886. */
  887. int htt_srng_setup(struct htt_soc *htt_soc, int pdev_id,
  888. hal_ring_handle_t hal_ring_hdl,
  889. int hal_ring_type);
  890. /**
  891. * htt_soc_attach_target() - SOC level HTT setup
  892. * @htt_soc: HTT SOC handle
  893. *
  894. * Return: 0 on success; error code on failure
  895. */
  896. int htt_soc_attach_target(struct htt_soc *htt_soc);
  897. /**
  898. * htt_h2t_rx_ring_cfg() - Send SRNG packet and TLV filter
  899. * config message to target
  900. * @htt_soc: HTT SOC handle
  901. * @pdev_id: PDEV Id
  902. * @hal_ring_hdl: Opaque HAL SRNG pointer
  903. * @hal_ring_type: SRNG ring type
  904. * @ring_buf_size: SRNG buffer size
  905. * @htt_tlv_filter: Rx SRNG TLV and filter setting
  906. *
  907. * Return: 0 on success; error code on failure
  908. */
  909. int htt_h2t_rx_ring_cfg(struct htt_soc *htt_soc, int pdev_id,
  910. hal_ring_handle_t hal_ring_hdl,
  911. int hal_ring_type, int ring_buf_size,
  912. struct htt_rx_ring_tlv_filter *htt_tlv_filter);
  913. /**
  914. * htt_t2h_stats_handler() - target to host stats work handler
  915. * @context: context (dp soc context)
  916. *
  917. * Return: void
  918. */
  919. void htt_t2h_stats_handler(void *context);
  920. /**
  921. * struct htt_stats_context - htt stats information
  922. * @soc: Size of each descriptor in the pool
  923. * @msg: T2H Ext stats message queue
  924. * @msg_len: T2H Ext stats message length
  925. */
  926. struct htt_stats_context {
  927. struct dp_soc *soc;
  928. qdf_nbuf_queue_t msg;
  929. uint32_t msg_len;
  930. };
  931. #ifdef DP_UMAC_HW_RESET_SUPPORT
  932. /**
  933. * struct dp_htt_umac_reset_setup_cmd_params - Params for UMAC reset setup cmd
  934. * @msi_data: MSI data to be used for raising the UMAC reset interrupt
  935. * @shmem_addr_low: Lower 32-bits of shared memory
  936. * @shmem_addr_high: Higher 32-bits of shared memory
  937. */
  938. struct dp_htt_umac_reset_setup_cmd_params {
  939. uint32_t msi_data;
  940. uint32_t shmem_addr_low;
  941. uint32_t shmem_addr_high;
  942. };
  943. /**
  944. * dp_htt_umac_reset_send_setup_cmd(): Send the HTT UMAC reset setup command
  945. * @soc: dp soc object
  946. * @setup_params: parameters required by this command
  947. *
  948. * Return: Success when HTT message is sent, error on failure
  949. */
  950. QDF_STATUS dp_htt_umac_reset_send_setup_cmd(
  951. struct dp_soc *soc,
  952. const struct dp_htt_umac_reset_setup_cmd_params *setup_params);
  953. #endif
  954. /**
  955. * dp_htt_rx_flow_fst_setup() - Send HTT Rx FST setup message to FW
  956. * @pdev: DP pdev handle
  957. * @fse_setup_info: FST setup parameters
  958. *
  959. * Return: Success when HTT message is sent, error on failure
  960. */
  961. QDF_STATUS
  962. dp_htt_rx_flow_fst_setup(struct dp_pdev *pdev,
  963. struct dp_htt_rx_flow_fst_setup *fse_setup_info);
  964. /**
  965. * dp_htt_rx_flow_fse_operation(): Send HTT Flow Search Entry msg to
  966. * add/del a flow in HW
  967. * @pdev: DP pdev handle
  968. * @fse_op_info: Flow entry parameters
  969. *
  970. * Return: Success when HTT message is sent, error on failure
  971. */
  972. QDF_STATUS
  973. dp_htt_rx_flow_fse_operation(struct dp_pdev *pdev,
  974. struct dp_htt_rx_flow_fst_operation *fse_op_info);
  975. /**
  976. * htt_h2t_full_mon_cfg() - Send full monitor configuration msg to FW
  977. *
  978. * @htt_soc: HTT Soc handle
  979. * @pdev_id: Radio id
  980. * @dp_full_mon_config: enabled/disable configuration
  981. *
  982. * Return: Success when HTT message is sent, error on failure
  983. */
  984. int htt_h2t_full_mon_cfg(struct htt_soc *htt_soc,
  985. uint8_t pdev_id,
  986. enum dp_full_mon_config);
  987. /**
  988. * dp_h2t_hw_vdev_stats_config_send: Send HTT command to FW for config
  989. * of HW vdev stats
  990. * @dpsoc: Datapath soc handle
  991. * @pdev_id: INVALID_PDEV_ID for all pdevs or 0,1,2 for individual pdev
  992. * @enable: flag to specify enable/disable of stats
  993. * @reset: flag to specify if command is for reset of stats
  994. * @reset_bitmask: bitmask of vdev_id(s) for reset of HW stats
  995. *
  996. * Return: QDF_STATUS
  997. */
  998. QDF_STATUS dp_h2t_hw_vdev_stats_config_send(struct dp_soc *dpsoc,
  999. uint8_t pdev_id, bool enable,
  1000. bool reset, uint64_t reset_bitmask);
  1001. static inline enum htt_srng_ring_id
  1002. dp_htt_get_mon_htt_ring_id(struct dp_soc *soc,
  1003. enum hal_ring_type hal_ring_type)
  1004. {
  1005. enum htt_srng_ring_id htt_srng_id = 0;
  1006. if (wlan_cfg_get_txmon_hw_support(soc->wlan_cfg_ctx)) {
  1007. switch (hal_ring_type) {
  1008. case RXDMA_MONITOR_BUF:
  1009. htt_srng_id = HTT_RX_MON_HOST2MON_BUF_RING;
  1010. break;
  1011. case RXDMA_MONITOR_DST:
  1012. htt_srng_id = HTT_RX_MON_MON2HOST_DEST_RING;
  1013. break;
  1014. default:
  1015. dp_err("Invalid ring type %d ", hal_ring_type);
  1016. break;
  1017. }
  1018. } else {
  1019. switch (hal_ring_type) {
  1020. case RXDMA_MONITOR_BUF:
  1021. htt_srng_id = HTT_RXDMA_MONITOR_BUF_RING;
  1022. break;
  1023. case RXDMA_MONITOR_DST:
  1024. htt_srng_id = HTT_RXDMA_MONITOR_DEST_RING;
  1025. break;
  1026. default:
  1027. dp_err("Invalid ring type %d ", hal_ring_type);
  1028. break;
  1029. }
  1030. }
  1031. return htt_srng_id;
  1032. }
  1033. #endif /* _DP_HTT_H_ */