wlan_cfg.h 48 KB

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