wlan_cfg.h 51 KB

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