wlan_cfg.h 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477
  1. /*
  2. * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef __WLAN_CFG_H
  19. #define __WLAN_CFG_H
  20. /*
  21. * Temporary place holders. These should come either from target config
  22. * or platform configuration
  23. */
  24. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  25. #define WLAN_CFG_DST_RING_CACHED_DESC 0
  26. #define MAX_PDEV_CNT 1
  27. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  28. #define WLAN_CFG_RXDMA1_ENABLE 1
  29. /*
  30. * This mask defines how many transmit frames account for 1 NAPI work unit
  31. * 0 means each tx completion is 1 unit
  32. */
  33. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  34. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  35. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
  36. #define NUM_RXDMA_RINGS_PER_PDEV 2
  37. /*Maximum Number of LMAC instances*/
  38. #define MAX_NUM_LMAC_HW 2
  39. #else
  40. #define WLAN_CFG_DST_RING_CACHED_DESC 1
  41. #define MAX_PDEV_CNT 3
  42. #define WLAN_CFG_INT_NUM_CONTEXTS 11
  43. #define NUM_RXDMA_RINGS_PER_PDEV 1
  44. #define MAX_NUM_LMAC_HW 3
  45. #endif
  46. #define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
  47. /* Tx configuration */
  48. #define MAX_LINK_DESC_BANKS 8
  49. #define MAX_TXDESC_POOLS 4
  50. #define MAX_TCL_DATA_RINGS 4
  51. /* Rx configuration */
  52. #define MAX_RXDESC_POOLS 4
  53. #define MAX_REO_DEST_RINGS 4
  54. #define MAX_RX_MAC_RINGS 2
  55. /* DP process status */
  56. #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
  57. #define CONFIG_PROCESS_RX_STATUS 1
  58. #define CONFIG_PROCESS_TX_STATUS 1
  59. #else
  60. #define CONFIG_PROCESS_RX_STATUS 0
  61. #define CONFIG_PROCESS_TX_STATUS 0
  62. #endif
  63. /* Miscellaneous configuration */
  64. #define MAX_IDLE_SCATTER_BUFS 16
  65. #define DP_MAX_IRQ_PER_CONTEXT 12
  66. #define MAX_HTT_METADATA_LEN 32
  67. #define DP_MAX_TIDS 17
  68. #define DP_NON_QOS_TID 16
  69. #define DP_NULL_DATA_TID 17
  70. #define WLAN_CFG_RX_FST_MAX_SEARCH 2
  71. #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
  72. #define INVALID_PDEV_ID 0xFF
  73. struct wlan_cfg_dp_pdev_ctxt;
  74. /**
  75. * struct wlan_srng_cfg - Per ring configuration parameters
  76. * @timer_threshold: Config to control interrupts based on timer duration
  77. * @batch_count_threshold: Config to control interrupts based on
  78. * number of packets in the ring
  79. * @low_threshold: Config to control low threshold interrupts for SRC rings
  80. */
  81. struct wlan_srng_cfg {
  82. uint32_t timer_threshold;
  83. uint32_t batch_count_threshold;
  84. uint32_t low_threshold;
  85. };
  86. /**
  87. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  88. * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
  89. * @max_clients: Maximum number of peers/stations supported by device
  90. * @max_alloc_size: Maximum allocation size for any dynamic memory
  91. * allocation request for this device
  92. * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
  93. * 1: Each TCL ring is mapped to one radio/pdev
  94. * @num_tcl_data_rings: Number of TCL Data rings supported by device
  95. * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
  96. * 1: Each REO ring is mapped to one radio/pdev
  97. * @num_tx_desc_pool: Number of Tx Descriptor pools
  98. * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
  99. * @num_tx_desc: Number of Tx Descriptors per pool
  100. * @min_tx_desc: Minimum number of Tx Descriptors per pool
  101. * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
  102. * @max_peer_id: Maximum value of peer id that FW can assign for a client
  103. * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
  104. * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
  105. * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  106. * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  107. * NAPI/Intr context
  108. * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  109. * NAPI/Intr context
  110. * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
  111. * NAPI/Intr context
  112. * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
  113. * each NAPI/Intr context
  114. * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
  115. * @lro_enabled: enable/disable lro feature
  116. * @rx_hash: Enable hash based steering of rx packets
  117. * @tso_enabled: enable/disable tso feature
  118. * @lro_enabled: enable/disable LRO feature
  119. * @sg_enabled: enable disable scatter gather feature
  120. * @gro_enabled: enable disable GRO feature
  121. * @ipa_enabled: Flag indicating if IPA is enabled
  122. * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
  123. * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
  124. * @rawmode_enabled: Flag indicating if RAW mode is enabled
  125. * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
  126. * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
  127. * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
  128. * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
  129. * @tcp_udp_checksumoffload: enable/disable checksum offload
  130. * @nss_cfg: nss configuration
  131. * @rx_defrag_min_timeout: rx defrag minimum timeout
  132. * @wbm_release_ring: wbm release ring size
  133. * @tcl_cmd_credit_ring: tcl command/credit ring size
  134. * @tcl_status_ring: tcl status ring size
  135. * @reo_reinject_ring: reo reinject ring
  136. * @rx_release_ring: rx release ring size
  137. * @reo_exception_ring: reo exception ring size
  138. * @reo_cmd_ring: reo cmd ring size
  139. * @reo_status_ring: reo status ting size
  140. * @rxdma_refill_ring: rxdma refill ring size
  141. * @rxdma_err_dst_ring: rxdma error detination ring size
  142. * @raw_mode_war: enable/disable raw mode war
  143. * @enable_data_stall_detection: flag to enable data stall detection
  144. * @disable_intra_bss_fwd: flag to disable intra bss forwarding
  145. * @rxdma1_enable: flag to indicate if rxdma1 is enabled
  146. * @tx_desc_limit_0: tx_desc limit for 5G H
  147. * @tx_desc_limit_1: tx_desc limit for 2G
  148. * @tx_desc_limit_2: tx_desc limit for 5G L
  149. * @tx_device_limit: tx device limit
  150. * @tx_sw_internode_queue: tx sw internode queue
  151. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  152. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  153. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  154. * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
  155. * dp_rx_process loop
  156. * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
  157. * at end of tx_comp_handler loop.
  158. * @rx_sw_desc_weight: rx sw descriptor weight configuration
  159. * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
  160. * flow tagging in monitor/mon-lite mode
  161. * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
  162. * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
  163. * table should be used
  164. * @rx_flow_search_table_size: indicates the number of flows in the flow search
  165. * table
  166. * @rx_flow_max_search: max skid length for each hash entry
  167. * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
  168. * 5 tuple flow entry
  169. * @pktlog_buffer_size: packet log buffer size
  170. * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
  171. * @pext_stats_enabled: Flag to enable and disabled peer extended stats
  172. * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
  173. * pool support
  174. * @rx_pending_high_threshold: threshold of starting pkt drop
  175. * @rx_pending_low_threshold: threshold of stopping pkt drop
  176. * @is_swlm_enabled: flag to enable/disable SWLM
  177. * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check
  178. */
  179. struct wlan_cfg_dp_soc_ctxt {
  180. int num_int_ctxts;
  181. int max_clients;
  182. int max_alloc_size;
  183. int per_pdev_tx_ring;
  184. int num_tcl_data_rings;
  185. int per_pdev_rx_ring;
  186. int per_pdev_lmac_ring;
  187. int num_reo_dest_rings;
  188. int num_tx_desc_pool;
  189. int num_tx_ext_desc_pool;
  190. int num_tx_desc;
  191. int min_tx_desc;
  192. int num_tx_ext_desc;
  193. int max_peer_id;
  194. int htt_packet_type;
  195. int int_batch_threshold_tx;
  196. int int_timer_threshold_tx;
  197. int int_batch_threshold_rx;
  198. int int_timer_threshold_rx;
  199. int int_batch_threshold_other;
  200. int int_timer_threshold_other;
  201. int int_timer_threshold_mon;
  202. int tx_ring_size;
  203. int tx_comp_ring_size;
  204. int tx_comp_ring_size_nss;
  205. int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  206. int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  207. int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  208. int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  209. int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  210. int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  211. int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  212. int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  213. int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  214. int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  215. int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  216. int hw_macid[MAX_PDEV_CNT];
  217. int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
  218. int base_hw_macid;
  219. bool rx_hash;
  220. bool tso_enabled;
  221. bool lro_enabled;
  222. bool sg_enabled;
  223. bool gro_enabled;
  224. bool ipa_enabled;
  225. bool ol_tx_csum_enabled;
  226. bool ol_rx_csum_enabled;
  227. bool rawmode_enabled;
  228. bool peer_flow_ctrl_enabled;
  229. bool napi_enabled;
  230. bool p2p_tcp_udp_checksumoffload;
  231. bool nan_tcp_udp_checksumoffload;
  232. bool tcp_udp_checksumoffload;
  233. bool legacy_mode_checksumoffload_disable;
  234. bool defrag_timeout_check;
  235. int nss_cfg;
  236. uint32_t tx_flow_stop_queue_threshold;
  237. uint32_t tx_flow_start_queue_offset;
  238. int rx_defrag_min_timeout;
  239. int reo_dst_ring_size;
  240. int wbm_release_ring;
  241. int tcl_cmd_credit_ring;
  242. int tcl_status_ring;
  243. int reo_reinject_ring;
  244. int rx_release_ring;
  245. int reo_exception_ring;
  246. int reo_cmd_ring;
  247. int reo_status_ring;
  248. int rxdma_refill_ring;
  249. int rxdma_err_dst_ring;
  250. uint32_t per_pkt_trace;
  251. bool raw_mode_war;
  252. bool enable_data_stall_detection;
  253. bool disable_intra_bss_fwd;
  254. bool rxdma1_enable;
  255. int max_ast_idx;
  256. int tx_desc_limit_0;
  257. int tx_desc_limit_1;
  258. int tx_desc_limit_2;
  259. int tx_device_limit;
  260. int tx_sw_internode_queue;
  261. int mon_drop_thresh;
  262. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  263. uint32_t tx_comp_loop_pkt_limit;
  264. uint32_t rx_reap_loop_pkt_limit;
  265. uint32_t rx_hp_oos_update_limit;
  266. bool rx_enable_eol_data_check;
  267. bool tx_comp_enable_eol_data_check;
  268. #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
  269. int rx_sw_desc_weight;
  270. int rx_sw_desc_num;
  271. bool is_rx_mon_protocol_flow_tag_enabled;
  272. bool is_rx_flow_tag_enabled;
  273. bool is_rx_flow_search_table_per_pdev;
  274. uint16_t rx_flow_search_table_size;
  275. uint16_t rx_flow_max_search;
  276. uint8_t *rx_toeplitz_hash_key;
  277. uint8_t pktlog_buffer_size;
  278. uint8_t is_rx_fisa_enabled;
  279. bool is_tso_desc_attach_defer;
  280. uint32_t delayed_replenish_entries;
  281. uint32_t reo_rings_mapping;
  282. bool pext_stats_enabled;
  283. bool is_rx_buff_pool_enabled;
  284. uint32_t rx_pending_high_threshold;
  285. uint32_t rx_pending_low_threshold;
  286. bool is_poll_mode_enabled;
  287. uint8_t is_swlm_enabled;
  288. bool fst_in_cmem;
  289. bool tx_per_pkt_vdev_id_check;
  290. };
  291. /**
  292. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  293. * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
  294. * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
  295. * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
  296. * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
  297. * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
  298. */
  299. struct wlan_cfg_dp_pdev_ctxt {
  300. int rx_dma_buf_ring_size;
  301. int dma_mon_buf_ring_size;
  302. int dma_mon_dest_ring_size;
  303. int dma_mon_status_ring_size;
  304. int rxdma_monitor_desc_ring;
  305. int num_mac_rings;
  306. int nss_enabled;
  307. };
  308. /**
  309. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  310. * @ctrl_obj - PSOC object
  311. *
  312. * Allocates context for Soc configuration parameters,
  313. * Read configuration information from device tree/ini file and
  314. * returns back handle
  315. *
  316. * Return: Handle to configuration context
  317. */
  318. struct wlan_cfg_dp_soc_ctxt *
  319. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  320. /**
  321. * wlan_cfg_soc_detach() - Detach soc configuration handle
  322. * @wlan_cfg_ctx: soc configuration handle
  323. *
  324. * De-allocates memory allocated for SoC configuration
  325. *
  326. * Return:none
  327. */
  328. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  329. /**
  330. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  331. * @ctrl_obj - PSOC object
  332. *
  333. * Allocates context for pdev configuration parameters,
  334. * Read configuration information from device tree/ini file and
  335. * returns back handle
  336. *
  337. * Return: Handle to configuration context
  338. */
  339. struct wlan_cfg_dp_pdev_ctxt *
  340. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  341. /**
  342. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  343. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  344. *
  345. * Return: void
  346. */
  347. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  348. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  349. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  350. int context, int mask);
  351. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  352. int context, int mask);
  353. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  354. int context, int mask);
  355. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  356. int context, int mask);
  357. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  358. int mask);
  359. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  360. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  361. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
  362. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
  363. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  364. int context, int mask);
  365. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  366. int context, int mask);
  367. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  368. int context, int mask);
  369. /**
  370. * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
  371. * for monitor buffer ring at initialization
  372. * @wlan_cfg_ctx - Configuration Handle
  373. * @replenish_entries - number of entries to replenish at initialization
  374. *
  375. */
  376. void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  377. *wlan_cfg_ctx,
  378. uint32_t replenish_entries);
  379. /**
  380. * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
  381. * for monitor buffer ring at initialization
  382. * @wlan_cfg_ctx - Configuration Handle
  383. * @replenish_entries - number of entries to replenish at initialization
  384. *
  385. * Return: delayed_replenish_entries;
  386. */
  387. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  388. *wlan_cfg_ctx);
  389. /**
  390. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  391. * @wlan_cfg_ctx - Configuration Handle
  392. *
  393. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  394. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  395. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  396. * that are processed by the handler.
  397. *
  398. * Return: num_contexts
  399. */
  400. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  401. /**
  402. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  403. * interrupt context
  404. * @wlan_cfg_ctx - Configuration Handle
  405. * @context - Numerical ID identifying the Interrupt/NAPI context
  406. *
  407. * Return: int_tx_ring_mask[context]
  408. */
  409. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  410. int context);
  411. /**
  412. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  413. * interrupt context
  414. * @wlan_cfg_ctx - Configuration Handle
  415. * @context - Numerical ID identifying the Interrupt/NAPI context
  416. *
  417. * Return: int_rx_ring_mask[context]
  418. */
  419. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  420. int context);
  421. /**
  422. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  423. * mapped to an interrupt context
  424. * @wlan_cfg_ctx - Configuration Handle
  425. * @context - Numerical ID identifying the Interrupt/NAPI context
  426. *
  427. * Return: int_rx_mon_ring_mask[context]
  428. */
  429. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  430. int context);
  431. /**
  432. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  433. * for the given interrupt context
  434. * @wlan_cfg_ctx - Configuration Handle
  435. * @context - Numerical ID identifying the Interrupt/NAPI context
  436. *
  437. */
  438. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  439. int context, int mask);
  440. /**
  441. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  442. * mapped to an interrupt context
  443. * @wlan_cfg_ctx - Configuration Handle
  444. * @context - Numerical ID identifying the Interrupt/NAPI context
  445. *
  446. * Return: int_rxdma2host_ring_mask[context]
  447. */
  448. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  449. int context);
  450. /**
  451. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  452. * for the given interrupt context
  453. * @wlan_cfg_ctx - Configuration Handle
  454. * @context - Numerical ID identifying the Interrupt/NAPI context
  455. *
  456. */
  457. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  458. int context, int mask);
  459. /**
  460. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  461. * mapped to an interrupt context
  462. * @wlan_cfg_ctx - Configuration Handle
  463. * @context - Numerical ID identifying the Interrupt/NAPI context
  464. *
  465. * Return: int_host2rxdma_ring_mask[context]
  466. */
  467. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  468. int context);
  469. /**
  470. * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
  471. * interrupt mask for the given interrupt context
  472. * @wlan_cfg_ctx - Configuration Handle
  473. * @context - Numerical ID identifying the Interrupt/NAPI context
  474. *
  475. */
  476. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  477. int context, int mask);
  478. /**
  479. * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
  480. * interrupt mask mapped to an interrupt context
  481. * @wlan_cfg_ctx - Configuration Handle
  482. * @context - Numerical ID identifying the Interrupt/NAPI context
  483. *
  484. * Return: int_host2rxdma_mon_ring_mask[context]
  485. */
  486. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  487. int context);
  488. /**
  489. * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
  490. * destination ring interrupt mask
  491. * for the given interrupt context
  492. * @wlan_cfg_ctx - Configuration Handle
  493. * @context - Numerical ID identifying the Interrupt/NAPI context
  494. *
  495. */
  496. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  497. int context, int mask);
  498. /**
  499. * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
  500. * destination ring interrupt mask
  501. * mapped to an interrupt context
  502. * @wlan_cfg_ctx - Configuration Handle
  503. * @context - Numerical ID identifying the Interrupt/NAPI context
  504. *
  505. * Return: int_rxdma2host_mon_ring_mask[context]
  506. */
  507. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  508. int context);
  509. /**
  510. * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index
  511. *
  512. * @wlan_cfg_ctx - Configuration Handle
  513. * @pdev_idx - Index of SW PDEV
  514. * @hw_macid - HW MAC Id
  515. *
  516. */
  517. void wlan_cfg_set_hw_mac_idx
  518. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  519. /**
  520. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  521. * PDEV index
  522. *
  523. * @wlan_cfg_ctx - Configuration Handle
  524. * @pdev_idx - Index of SW PDEV
  525. *
  526. * Return: HW MAC index
  527. */
  528. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  529. /**
  530. * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
  531. *
  532. * @wlan_cfg_ctx - Configuration Handle
  533. * @hw_macid - Index of hw mac
  534. *
  535. * Return: PDEV ID
  536. */
  537. int
  538. wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  539. /**
  540. * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
  541. * hw mac index
  542. *
  543. * @wlan_cfg_ctx - Configuration Handle
  544. * @pdev_idx - Index of SW PDEV
  545. * @hw_macid - Index of hw mac
  546. *
  547. * Return: PDEV index
  548. */
  549. void wlan_cfg_set_pdev_idx
  550. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  551. /**
  552. * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
  553. * hw mac index
  554. *
  555. * @wlan_cfg_ctx - Configuration Handle
  556. * @hw_macid - Index of hw mac
  557. *
  558. * Return: PDEV index
  559. */
  560. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  561. /**
  562. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  563. * mapped to an interrupt context
  564. * @wlan_cfg_ctx - Configuration Handle
  565. * @context - Numerical ID identifying the Interrupt/NAPI context
  566. *
  567. * Return: int_rx_err_ring_mask[context]
  568. */
  569. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  570. context);
  571. /**
  572. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  573. * mapped to an interrupt context
  574. * @wlan_cfg_ctx - Configuration Handle
  575. * @context - Numerical ID identifying the Interrupt/NAPI context
  576. *
  577. * Return: int_wbm_rel_ring_mask[context]
  578. */
  579. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  580. context);
  581. /**
  582. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  583. * mapped to an interrupt context
  584. * @wlan_cfg_ctx - Configuration Handle
  585. * @context - Numerical ID identifying the Interrupt/NAPI context
  586. *
  587. * Return: int_reo_status_ring_mask[context]
  588. */
  589. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  590. context);
  591. /**
  592. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  593. * mapped to an interrupt context
  594. * @wlan_cfg_ctx - Configuration Handle
  595. * @context - Numerical ID identifying the Interrupt/NAPI context
  596. *
  597. * Return: int_ce_ring_mask[context]
  598. */
  599. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  600. int context);
  601. /**
  602. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  603. * supported by device
  604. * @wlan_cfg_ctx - Configuration Handle
  605. *
  606. * Return: max_clients
  607. */
  608. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  609. /**
  610. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  611. * memory allocation request for this device
  612. * @wlan_cfg_ctx - Configuration Handle
  613. *
  614. * Return: max_alloc_size
  615. */
  616. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  617. /*
  618. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  619. * one per radio
  620. * @wlan_cfg_ctx - Configuration Handle
  621. *
  622. * Return: per_pdev_tx_ring
  623. */
  624. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  625. /*
  626. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  627. * @wlan_cfg_ctx
  628. *
  629. * Return: num_tcl_data_rings
  630. */
  631. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  632. /*
  633. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  634. * one per radio
  635. * @wlan_cfg_ctx
  636. *
  637. * Return: per_pdev_rx_ring
  638. */
  639. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  640. /*
  641. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  642. * one per radio
  643. * @wlan_cfg_ctx
  644. *
  645. * Return: return 1 if per pdev error ring else 0
  646. */
  647. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  648. /*
  649. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  650. * @wlan_cfg_ctx - Configuration Handle
  651. *
  652. * Return: num_reo_dest_rings
  653. */
  654. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  655. /*
  656. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  657. * @wlan_cfg_ctx - Configuration Handle
  658. *
  659. * Return: htt_pkt_type_ethernet
  660. */
  661. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  662. /*
  663. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  664. * device
  665. * @wlan_cfg_ctx - Configuration Handle
  666. *
  667. * Return: num_tx_desc_pool
  668. */
  669. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  670. /*
  671. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  672. * device
  673. * @wlan_cfg_ctx - Configuration Handle
  674. * @num_pool - Number of pool
  675. */
  676. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  677. /*
  678. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  679. * pools
  680. * @wlan_cfg_ctx - Configuration Handle
  681. *
  682. * Return: num_tx_ext_desc_pool
  683. */
  684. int wlan_cfg_get_num_tx_ext_desc_pool(
  685. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  686. /*
  687. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  688. *
  689. * @wlan_cfg_ctx - Configuration Handle
  690. *
  691. * Return: reo_dst_ring_size
  692. */
  693. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  694. /*
  695. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  696. *
  697. * @wlan_cfg_ctx - Configuration Handle
  698. * @reo_dst_ring_size - REO Destination ring size
  699. */
  700. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  701. int reo_dst_ring_size);
  702. /*
  703. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  704. *
  705. * @wlan_cfg_ctx - Configuration Handle
  706. * @raw_mode_war - raw mode war configuration
  707. */
  708. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  709. bool raw_mode_war);
  710. /*
  711. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  712. *
  713. * @wlan_cfg_ctx - Configuration Handle
  714. *
  715. * Return: reo_dst_ring_size
  716. */
  717. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  718. /*
  719. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  720. * pools
  721. * @wlan_cfg_ctx - Configuration Handle
  722. * @num_pool - Number of pool
  723. */
  724. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  725. /*
  726. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  727. * @wlan_cfg_ctx - Configuration Handle
  728. *
  729. * Return: num_tx_desc
  730. */
  731. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  732. /*
  733. * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
  734. * @wlan_cfg_ctx - Configuration Handle
  735. *
  736. * Return: num_tx_desc
  737. */
  738. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  739. /*
  740. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  741. *
  742. * @wlan_cfg_ctx - Configuration Handle
  743. * @num_desc: Number of descriptor
  744. */
  745. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  746. /*
  747. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  748. * per pool
  749. * @wlan_cfg_ctx - Configuration Handle
  750. *
  751. * Return: num_tx_ext_desc
  752. */
  753. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  754. /*
  755. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  756. * per pool
  757. * @wlan_cfg_ctx - Configuration Handle
  758. * @num_desc: Number of descriptor
  759. */
  760. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  761. /*
  762. * wlan_cfg_max_peer_id() - Get maximum peer ID
  763. * @cfg: Configuration Handle
  764. *
  765. * Return: maximum peer ID
  766. */
  767. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  768. /*
  769. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  770. * @wlan_cfg_pdev_ctx
  771. *
  772. * Return: dma_mon_buf_ring_size
  773. */
  774. int wlan_cfg_get_dma_mon_buf_ring_size(
  775. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  776. /*
  777. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  778. * Destination ring
  779. * @wlan_cfg_pdev_ctx
  780. *
  781. * Return: dma_mon_dest_size
  782. */
  783. int wlan_cfg_get_dma_mon_dest_ring_size(
  784. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  785. /*
  786. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  787. * @wlan_cfg_pdev_ctx
  788. *
  789. * Return: dma_mon_stat_ring_size
  790. */
  791. int wlan_cfg_get_dma_mon_stat_ring_size(
  792. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  793. /*
  794. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  795. * @wlan_cfg_soc_ctx
  796. *
  797. * Return: rxdma monitor desc ring size
  798. */
  799. int
  800. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  801. /*
  802. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  803. * @wlan_cfg_pdev_ctx
  804. *
  805. * Return: rx_dma_buf_ring_size
  806. */
  807. int wlan_cfg_get_rx_dma_buf_ring_size(
  808. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  809. /*
  810. * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
  811. * @wlan_cfg_pdev_ctx
  812. *
  813. * Return: rx_pending_high_threshold
  814. */
  815. uint32_t
  816. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  817. /*
  818. * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
  819. * @wlan_cfg_pdev_ctx
  820. *
  821. * Return: rx_pending_low_threshold
  822. */
  823. uint32_t
  824. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  825. /*
  826. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  827. * per pdev
  828. * @wlan_cfg_pdev_ctx
  829. *
  830. * Return: number of mac DMA rings per pdev
  831. */
  832. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  833. /*
  834. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  835. * @wlan_cfg_dp_soc_ctxt
  836. *
  837. * Return: true - LRO enabled false - LRO disabled
  838. */
  839. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  840. /*
  841. * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
  842. * @wlan_cfg_dp_soc_ctxt
  843. *
  844. * Return: true - GRO enabled false - GRO disabled
  845. */
  846. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  847. /*
  848. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  849. * @wlan_cfg_dp_soc_ctxt
  850. *
  851. * Return: true - enabled false - disabled
  852. */
  853. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  854. /*
  855. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  856. * @wlan_cfg_dp_soc_ctxt
  857. *
  858. * Return: true - enabled false - disabled
  859. */
  860. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  861. /*
  862. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  863. * @wlan_cfg_soc_ctx
  864. * @rx_hash
  865. */
  866. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  867. /*
  868. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  869. * @wlan_cfg_pdev_ctx
  870. *
  871. * Return: 1 - enabled 0 - disabled
  872. */
  873. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  874. /*
  875. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  876. * @wlan_cfg_pdev_ctx
  877. */
  878. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  879. /*
  880. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  881. * @wlan_cfg_pdev_ctx
  882. *
  883. * Return: nss_cfg
  884. */
  885. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  886. /*
  887. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  888. * @wlan_cfg_pdev_ctx
  889. *
  890. */
  891. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  892. /*
  893. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  894. * @wlan_cfg_soc_ctx
  895. *
  896. * Return: Batch threshold
  897. */
  898. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  899. /*
  900. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  901. * @wlan_cfg_soc_ctx
  902. *
  903. * Return: Timer threshold
  904. */
  905. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  906. /*
  907. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  908. * @wlan_cfg_soc_ctx
  909. *
  910. * Return: Batch threshold
  911. */
  912. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  913. /*
  914. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  915. * @wlan_cfg_soc_ctx
  916. *
  917. * Return: Timer threshold
  918. */
  919. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  920. /*
  921. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  922. * @wlan_cfg_soc_ctx
  923. *
  924. * Return: Batch threshold
  925. */
  926. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  927. /*
  928. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  929. * @wlan_cfg_soc_ctx
  930. *
  931. * Return: Timer threshold
  932. */
  933. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  934. /*
  935. * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
  936. * @wlan_cfg_soc_ctx
  937. *
  938. * Return: Timer threshold
  939. */
  940. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
  941. /*
  942. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  943. * @wlan_cfg_soc_ctx
  944. *
  945. * Return: Checksum offload enable or disable
  946. */
  947. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  948. /*
  949. * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
  950. * @wlan_cfg_soc_ctx
  951. *
  952. * Return: Checksum offload enable or disable value for NAN mode
  953. */
  954. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  955. /*
  956. * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
  957. * @wlan_cfg_soc_ctx
  958. *
  959. * Return: Checksum offload enable or disable value for P2P mode
  960. */
  961. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  962. /*
  963. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  964. * @wlan_cfg_soc_ctx
  965. *
  966. * Return: Tx Ring Size
  967. */
  968. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  969. /*
  970. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  971. * @wlan_cfg_soc_ctx
  972. *
  973. * Return: Tx Completion ring size
  974. */
  975. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  976. /*
  977. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  978. * @wlan_cfg_soc_ctx
  979. *
  980. * Return: wbm_release_ring size
  981. */
  982. int
  983. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  984. /*
  985. * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
  986. * @wlan_cfg_soc_ctx
  987. *
  988. * Return: tcl_cmd_credit_ring size
  989. */
  990. int
  991. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  992. /*
  993. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  994. * @wlan_cfg_soc_ctx
  995. *
  996. * Return: tcl_status_ring size
  997. */
  998. int
  999. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1000. /*
  1001. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  1002. * @wlan_cfg_soc_ctx
  1003. *
  1004. * Return: reo_reinject_ring size
  1005. */
  1006. int
  1007. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1008. /*
  1009. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  1010. * @wlan_cfg_soc_ctx
  1011. *
  1012. * Return: rx_release_ring size
  1013. */
  1014. int
  1015. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1016. /*
  1017. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  1018. * @wlan_cfg_soc_ctx
  1019. *
  1020. * Return: reo_exception_ring size
  1021. */
  1022. int
  1023. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1024. /*
  1025. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  1026. * @wlan_cfg_soc_ctx
  1027. *
  1028. * Return: reo_cmd_ring size
  1029. */
  1030. int
  1031. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1032. /*
  1033. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  1034. * @wlan_cfg_soc_ctx
  1035. *
  1036. * Return: reo_status_ring size
  1037. */
  1038. int
  1039. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1040. /*
  1041. * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
  1042. * @wlan_cfg_soc_ctx
  1043. *
  1044. * Return: tx desc limit for 5G H
  1045. */
  1046. int
  1047. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
  1048. /*
  1049. * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
  1050. * @wlan_cfg_soc_ctx
  1051. *
  1052. * Return: tx desc limit for 2G
  1053. */
  1054. int
  1055. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
  1056. /*
  1057. * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
  1058. * @wlan_cfg_soc_ctx
  1059. *
  1060. * Return: tx desc limit for 5G L
  1061. */
  1062. int
  1063. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
  1064. /*
  1065. * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
  1066. * @wlan_cfg_soc_ctx
  1067. *
  1068. * Return: tx device limit
  1069. */
  1070. int
  1071. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  1072. /*
  1073. * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
  1074. * @wlan_cfg_soc_ctx
  1075. *
  1076. * Return: tx sw internode queue
  1077. */
  1078. int
  1079. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
  1080. /*
  1081. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  1082. * @wlan_cfg_soc_ctx
  1083. *
  1084. * Return: rxdma refill ring size
  1085. */
  1086. int
  1087. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1088. /*
  1089. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  1090. * @wlan_cfg_soc_ctx
  1091. *
  1092. * Return: rxdma error dst ring size
  1093. */
  1094. int
  1095. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1096. /*
  1097. * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
  1098. * @wlan_cfg_soc_ctx
  1099. *
  1100. * Return: rx_sw_desc_weight
  1101. */
  1102. int
  1103. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
  1104. /*
  1105. * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num
  1106. * @wlan_cfg_soc_ctx
  1107. *
  1108. * Return: rx_sw_desc_num
  1109. */
  1110. int
  1111. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg);
  1112. /*
  1113. * wlan_cfg_get_dp_caps - Get dp capablities
  1114. * @wlan_cfg_soc_ctx
  1115. * @dp_caps: enum for dp capablities
  1116. *
  1117. * Return: bool if a dp capabilities is enabled
  1118. */
  1119. bool
  1120. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1121. enum cdp_capabilities dp_caps);
  1122. /**
  1123. * wlan_set_srng_cfg() - Fill per ring specific
  1124. * configuration parameters
  1125. * @wlan_cfg: global srng configuration table
  1126. *
  1127. * Return: None
  1128. */
  1129. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
  1130. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1131. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  1132. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  1133. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1134. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  1135. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  1136. /**
  1137. * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
  1138. * in number of entries
  1139. *
  1140. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1141. *
  1142. * Return: rx_fst_size
  1143. */
  1144. uint16_t
  1145. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1146. /**
  1147. * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
  1148. *
  1149. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1150. *
  1151. * Return: max_search
  1152. */
  1153. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
  1154. /**
  1155. * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
  1156. * search
  1157. *
  1158. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1159. *
  1160. * Return: 320-bit Hash Key
  1161. */
  1162. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
  1163. /**
  1164. * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
  1165. * DP soc context
  1166. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1167. * @val: Rx flow tag feature flag value
  1168. *
  1169. * Return: None
  1170. */
  1171. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1172. bool val);
  1173. /**
  1174. * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
  1175. * DP soc context
  1176. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1177. *
  1178. * Return: true if feature is enabled, else false
  1179. */
  1180. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1181. /**
  1182. * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
  1183. * Rx FST is per pdev
  1184. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1185. * @val: boolean flag indicating Rx FST per pdev or per SOC
  1186. *
  1187. * Return: None
  1188. */
  1189. void
  1190. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1191. bool val);
  1192. /**
  1193. * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
  1194. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1195. *
  1196. * Return: true if Rx FST is per pdev, else false
  1197. */
  1198. bool
  1199. wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
  1200. /**
  1201. * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
  1202. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1203. * @val: Rx FST size in number of entries
  1204. *
  1205. * Return: None
  1206. */
  1207. void
  1208. wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1209. uint16_t val);
  1210. /**
  1211. * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
  1212. * in DP soc context
  1213. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1214. * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
  1215. *
  1216. * Return: None
  1217. */
  1218. void
  1219. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1220. bool val);
  1221. /**
  1222. * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
  1223. * from DP soc context
  1224. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1225. *
  1226. * Return: true if feature is enabled in monitor mode for protocol or flow
  1227. * tagging in INI, false otherwise
  1228. */
  1229. bool
  1230. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1231. /**
  1232. * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt
  1233. * vdev id check in tx.
  1234. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1235. * @val: feature flag value
  1236. *
  1237. * Return: None
  1238. */
  1239. void
  1240. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  1241. bool val);
  1242. /**
  1243. * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if
  1244. * perpkt vdev id check is enabled in tx.
  1245. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1246. *
  1247. * Return: true if feature is enabled, false otherwise
  1248. */
  1249. bool
  1250. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1251. /**
  1252. * wlan_cfg_fill_interrupt_mask() - set interrupt mask
  1253. *
  1254. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1255. * @interrupt_mode: interrupt_mode: MSI/LEGACY
  1256. * @is_monitor_mode: is monitor mode enabled
  1257. *
  1258. * Return: void
  1259. */
  1260. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1261. int interrupt_mode, bool is_monitor_mode);
  1262. /**
  1263. * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
  1264. *
  1265. *
  1266. * @cfg: soc configuration context
  1267. *
  1268. * Return: true if enabled, false otherwise.
  1269. */
  1270. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1271. /**
  1272. * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag
  1273. *
  1274. *
  1275. * @cfg: soc configuration context
  1276. *
  1277. * Return: true if enabled, false otherwise.
  1278. */
  1279. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1280. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1281. bool val);
  1282. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);
  1283. /**
  1284. * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap
  1285. *
  1286. *
  1287. * @cfg: soc configuration context
  1288. *
  1289. * Return: reo ring bitmap.
  1290. */
  1291. uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg);
  1292. /**
  1293. * wlan_cfg_set_peer_ext_stats() - set peer extended stats
  1294. *
  1295. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1296. * @val: Flag value read from INI
  1297. *
  1298. * Return: void
  1299. */
  1300. void
  1301. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1302. bool val);
  1303. /**
  1304. * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended
  1305. * stats are enabled
  1306. *
  1307. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1308. *
  1309. * Return: bool
  1310. */
  1311. bool
  1312. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1313. /**
  1314. * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled
  1315. *
  1316. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1317. *
  1318. * Return: bool
  1319. */
  1320. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1321. /**
  1322. * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled
  1323. * @cfg: soc configuration context
  1324. *
  1325. * Return: true if enabled, false otherwise.
  1326. */
  1327. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1328. /**
  1329. * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag
  1330. * @cfg: soc configuration context
  1331. *
  1332. * Return: true if enabled, false otherwise.
  1333. */
  1334. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1335. #endif