dp_htt.h 32 KB

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