wlan_cfg.h 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454
  1. /*
  2. * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef __WLAN_CFG_H
  20. #define __WLAN_CFG_H
  21. #include <wlan_init_cfg.h>
  22. /* DP process status */
  23. #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
  24. #define CONFIG_PROCESS_RX_STATUS 1
  25. #define CONFIG_PROCESS_TX_STATUS 1
  26. #else
  27. #define CONFIG_PROCESS_RX_STATUS 0
  28. #define CONFIG_PROCESS_TX_STATUS 0
  29. #endif
  30. /* Miscellaneous configuration */
  31. #define MAX_IDLE_SCATTER_BUFS 16
  32. #define DP_MAX_IRQ_PER_CONTEXT 12
  33. #define MAX_HTT_METADATA_LEN 32
  34. #define DP_MAX_TIDS 17
  35. #define DP_NON_QOS_TID 16
  36. #define DP_NULL_DATA_TID 17
  37. #ifdef CONFIG_BERYLLIUM
  38. #define WLAN_CFG_RX_FST_MAX_SEARCH 16
  39. #else
  40. #define WLAN_CFG_RX_FST_MAX_SEARCH 2
  41. #endif
  42. #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
  43. #define INVALID_PDEV_ID 0xFF
  44. #define WLAN_CFG_RX_RING_MASK_0 0x1
  45. #define WLAN_CFG_RX_RING_MASK_1 0x2
  46. #define WLAN_CFG_RX_RING_MASK_2 0x4
  47. #define WLAN_CFG_RX_RING_MASK_3 0x8
  48. #define WLAN_CFG_RX_RING_MASK_4 0x10
  49. #define WLAN_CFG_RX_RING_MASK_5 0x20
  50. #define WLAN_CFG_RX_RING_MASK_6 0x40
  51. #define WLAN_CFG_RX_RING_MASK_7 0x80
  52. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  53. #ifdef IPA_OFFLOAD
  54. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \
  55. WLAN_CFG_RX_RING_MASK_1 | \
  56. WLAN_CFG_RX_RING_MASK_2)
  57. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \
  58. WLAN_CFG_RX_RING_MASK_5 | \
  59. WLAN_CFG_RX_RING_MASK_6)
  60. #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
  61. WLAN_CFG_TX_RING_MASK_4 | \
  62. WLAN_CFG_TX_RING_MASK_2)
  63. #else
  64. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \
  65. WLAN_CFG_RX_RING_MASK_1 | \
  66. WLAN_CFG_RX_RING_MASK_2 | \
  67. WLAN_CFG_RX_RING_MASK_3)
  68. #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \
  69. WLAN_CFG_RX_RING_MASK_5 | \
  70. WLAN_CFG_RX_RING_MASK_6 | \
  71. WLAN_CFG_RX_RING_MASK_7)
  72. #ifdef QCA_WIFI_KIWI_V2
  73. #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
  74. WLAN_CFG_TX_RING_MASK_4 | \
  75. WLAN_CFG_TX_RING_MASK_2 | \
  76. WLAN_CFG_TX_RING_MASK_5 | \
  77. WLAN_CFG_TX_RING_MASK_6)
  78. #else /* !QCA_WIFI_KIWI_V2 */
  79. #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
  80. WLAN_CFG_TX_RING_MASK_4 | \
  81. WLAN_CFG_TX_RING_MASK_2 | \
  82. WLAN_CFG_TX_RING_MASK_6 | \
  83. WLAN_CFG_TX_RING_MASK_7)
  84. #endif /* QCA_WIFI_KIWI_V2 */
  85. #endif
  86. #endif
  87. /* Max number of chips that can participate in MLO */
  88. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  89. #define WLAN_MAX_MLO_CHIPS 4
  90. #define WLAN_MAX_MLO_LINKS_PER_SOC 2
  91. #else
  92. #define WLAN_MAX_MLO_CHIPS 1
  93. #endif
  94. #define UMAC_RESET_IPC 451
  95. struct wlan_cfg_dp_pdev_ctxt;
  96. /**
  97. * struct wlan_cfg_tcl_wbm_ring_num_map - TCL WBM Ring number mapping
  98. * @tcl_ring_num: TCL Ring number
  99. * @wbm_ring_num: WBM Ring number
  100. * @wbm_rbm_id: WBM RBM ID to be used when enqueuing to TCL
  101. * @for_ipa: whether this TCL/WBM for IPA use or not
  102. */
  103. struct wlan_cfg_tcl_wbm_ring_num_map {
  104. uint8_t tcl_ring_num;
  105. uint8_t wbm_ring_num;
  106. uint8_t wbm_rbm_id;
  107. uint8_t for_ipa;
  108. };
  109. /**
  110. * struct wlan_srng_cfg - Per ring configuration parameters
  111. * @timer_threshold: Config to control interrupts based on timer duration
  112. * @batch_count_threshold: Config to control interrupts based on
  113. * number of packets in the ring
  114. * @low_threshold: Config to control low threshold interrupts for SRC rings
  115. */
  116. struct wlan_srng_cfg {
  117. uint32_t timer_threshold;
  118. uint32_t batch_count_threshold;
  119. uint32_t low_threshold;
  120. };
  121. /**
  122. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  123. * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
  124. * @max_clients: Maximum number of peers/stations supported by device
  125. * @max_alloc_size: Maximum allocation size for any dynamic memory
  126. * allocation request for this device
  127. * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
  128. * 1: Each TCL ring is mapped to one radio/pdev
  129. * @num_tx_comp_rings: Number of Tx comp rings supported by device
  130. * @num_tcl_data_rings: Number of TCL Data rings supported by device
  131. * @num_nss_tcl_data_rings:
  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. * @per_pdev_lmac_ring:
  135. * @num_reo_dest_rings:
  136. * @num_nss_reo_dest_rings:
  137. * @num_tx_desc_pool: Number of Tx Descriptor pools
  138. * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
  139. * @num_global_tx_desc: Number of Global Tx Descriptors allowed
  140. * @num_global_spcl_tx_desc: Number of Global special Tx Descriptors allowed
  141. * @num_tx_desc: Number of Tx Descriptors per pool
  142. * @num_tx_spl_desc: Number of Tx Descriptors per pool to handle special frames
  143. * @min_tx_desc: Minimum number of Tx Descriptors per pool
  144. * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
  145. * @max_peer_id: Maximum value of peer id that FW can assign for a client
  146. * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
  147. * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
  148. * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  149. * @int_batch_threshold_ppe2tcl:
  150. * @int_timer_threshold_ppe2tcl:
  151. * @int_batch_threshold_tx:
  152. * @int_timer_threshold_tx:
  153. * @int_batch_threshold_rx:
  154. * @int_timer_threshold_rx:
  155. * @int_batch_threshold_other:
  156. * @int_timer_threshold_other:
  157. * @int_timer_threshold_mon:
  158. * @tx_ring_size:
  159. * @time_control_bp:
  160. * @tx_comp_ring_size:
  161. * @tx_comp_ring_size_nss:
  162. * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  163. * NAPI/Intr context
  164. * @int_tx_mon_ring_mask: Bitmap of Tx monitor ring interrupts mapped to each
  165. * NAPI/Intr context
  166. * @int_host2rxdma_mon_ring_mask:
  167. * @int_rxdma2host_mon_ring_mask:
  168. * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
  169. * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  170. * NAPI/Intr context
  171. * @int_rx_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
  172. * NAPI/Intr context
  173. * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
  174. * each NAPI/Intr context
  175. * @int_rxdma2host_ring_mask:
  176. * @int_host2rxdma_ring_mask:
  177. * @int_rx_ring_near_full_irq_1_mask: Bitmap of REO DST ring near full interrupt
  178. * mapped to each NAPI/INTR context
  179. * @int_rx_ring_near_full_irq_2_mask: Bitmap of REO DST ring near full interrupt
  180. * mapped to each NAPI/INTR context
  181. * @int_tx_ring_near_full_irq_mask: Bitmap of Tx completion ring near full
  182. * interrupt mapped to each NAPI/INTR context
  183. * @int_host2txmon_ring_mask: Bitmap of Tx monitor source ring interrupt
  184. * mapped to each NAPI/INTR context
  185. * @int_ppeds_wbm_release_ring_mask:
  186. * @int_ppe2tcl_ring_mask:
  187. * @int_reo2ppe_ring_mask:
  188. * @int_umac_reset_intr_mask: Bitmap of UMAC reset interrupt mapped to each
  189. * NAPI/INTR context
  190. * @hw_macid:
  191. * @hw_macid_pdev_id_map:
  192. * @base_hw_macid:
  193. * @rx_hash: Enable hash based steering of rx packets
  194. * @tso_enabled: enable/disable tso feature
  195. * @lro_enabled: enable/disable LRO feature
  196. * @sg_enabled: enable disable scatter gather feature
  197. * @gro_enabled: enable disable GRO feature
  198. * @tc_based_dynamic_gro: enable/disable tc based dynamic gro
  199. * @tc_ingress_prio: ingress prio to be checked for dynamic gro
  200. * @ipa_enabled: Flag indicating if IPA is enabled
  201. * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
  202. * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
  203. * @rawmode_enabled: Flag indicating if RAW mode is enabled
  204. * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
  205. * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
  206. * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
  207. * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
  208. * @tcp_udp_checksumoffload: enable/disable checksum offload
  209. * @legacy_mode_checksumoffload_disable:
  210. * @defrag_timeout_check:
  211. * @nss_cfg: nss configuration
  212. * @tx_flow_stop_queue_threshold:
  213. * @tx_flow_start_queue_offset:
  214. * @rx_defrag_min_timeout: rx defrag minimum timeout
  215. * @reo_dst_ring_size:
  216. * @wbm_release_ring: wbm release ring size
  217. * @tcl_cmd_credit_ring: tcl command/credit ring size
  218. * @tcl_status_ring: tcl status ring size
  219. * @reo_reinject_ring: reo reinject ring
  220. * @rx_release_ring: rx release ring size
  221. * @reo_exception_ring: reo exception ring size
  222. * @reo_cmd_ring: reo cmd ring size
  223. * @reo_status_ring: reo status ting size
  224. * @rxdma_refill_ring: rxdma refill ring size
  225. * @rxdma_refill_lt_disable: rxdma refill low threshold disable
  226. * @rxdma_err_dst_ring: rxdma error destination ring size
  227. * @per_pkt_trace:
  228. * @raw_mode_war: enable/disable raw mode war
  229. * @enable_data_stall_detection: enable/disable specific data stall detection
  230. * @disable_intra_bss_fwd: flag to disable intra bss forwarding
  231. * @rxdma1_enable: flag to indicate if rxdma1 is enabled
  232. * @delay_mon_replenish: delay monitor buffer replenish
  233. * @max_ast_idx:
  234. * @tx_desc_limit_0: tx_desc limit for 5 GHz High
  235. * @tx_desc_limit_1: tx_desc limit for 2 GHz
  236. * @tx_desc_limit_2: tx_desc limit for 5 GHz Low
  237. * @tx_device_limit: tx device limit
  238. * @tx_spl_device_limit: tx device limit for special frames
  239. * @tx_sw_internode_queue: tx sw internode queue
  240. * @mon_drop_thresh:
  241. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  242. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  243. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  244. * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
  245. * dp_rx_process loop
  246. * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
  247. * at end of tx_comp_handler loop.
  248. * @rx_sw_desc_weight: rx sw descriptor weight configuration
  249. * @rx_sw_desc_num:
  250. * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
  251. * flow tagging in monitor/mon-lite mode
  252. * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
  253. * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
  254. * table should be used
  255. * @rx_flow_search_table_size: indicates the number of flows in the flow search
  256. * table
  257. * @rx_flow_max_search: max skid length for each hash entry
  258. * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
  259. * 5 tuple flow entry
  260. * @pktlog_buffer_size: packet log buffer size
  261. * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
  262. * @is_rx_fisa_lru_del_enabled:
  263. * @is_tso_desc_attach_defer:
  264. * @delayed_replenish_entries:
  265. * @reo_rings_mapping:
  266. * @pext_stats_enabled: Flag to enable and disabled peer extended stats
  267. * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
  268. * pool support
  269. * @is_rx_refill_buff_pool_enabled: flag to enable/disable RX refill buffer
  270. * pool support
  271. * @rx_pending_high_threshold: threshold of starting pkt drop
  272. * @rx_pending_low_threshold: threshold of stopping pkt drop
  273. * @is_poll_mode_enabled:
  274. * @is_swlm_enabled: flag to enable/disable SWLM
  275. * @fst_in_cmem:
  276. * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check
  277. * @radio0_rx_default_reo:
  278. * @radio1_rx_default_reo:
  279. * @radio2_rx_default_reo:
  280. * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW
  281. * @jitter_stats_enabled: true if jitter stats are enabled
  282. * @peer_link_stats_enabled: true if MLO Peer Link stats are enabled
  283. * @ipa_tx_ring_size: IPA tx ring size
  284. * @ipa_tx_comp_ring_size: IPA tx completion ring size
  285. * @ipa_tx_alt_ring_size: IPA tx alt ring size
  286. * @ipa_tx_alt_comp_ring_size: IPA tx alt completion ring size
  287. * @hw_cc_enabled: cookie conversion enabled
  288. * @tcl_wbm_map_array: TCL-WBM map array
  289. * @ppeds_enable: Enable PPE Direct Switch feature
  290. * @reo2ppe_ring: REO2PPE ring size
  291. * @ppe2tcl_ring: PPE2TCL ring size
  292. * @ppeds_num_tx_desc: Number of tx descs for PPE DS
  293. * @ppeds_tx_comp_napi_budget: Napi budget for tx completions
  294. * @ppeds_tx_desc_hotlist_len: PPE DS tx desc hotlist max length
  295. * @pkt_capture_mode: Packet capture mode config
  296. * @rx_mon_buf_ring_size: Rx monitor buf ring size
  297. * @tx_mon_buf_ring_size: Tx monitor buf ring size
  298. * @rx_rel_wbm2sw_ring_id: Rx WBM2SW ring id
  299. * @tx_rings_grp_bitmap: bitmap of group intr contexts which have
  300. * non-zero tx ring mask
  301. * @mlo_chip_rx_ring_map: map of chip_id to rx ring map
  302. * @vdev_stats_hw_offload_config: HW vdev stats config
  303. * @vdev_stats_hw_offload_timer: HW vdev stats timer duration
  304. * @num_rxdma_dst_rings_per_pdev: Number of Rx DMA rings per pdev
  305. * @txmon_hw_support: TxMON HW support
  306. * @txmon_sw_peer_filtering: TxMON sw peer filtering support
  307. * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings
  308. * @tx_capt_max_mem_allowed: Max memory for Tx packet capture
  309. * @sawf_enabled: Is SAWF enabled
  310. * @sawf_stats: SAWF Statistics
  311. * @mpdu_retry_threshold_1: MPDU retry threshold 1 to increment tx bad count
  312. * @mpdu_retry_threshold_2: MPDU retry threshold 2 to increment tx bad count
  313. * @napi_scale_factor: scaling factor to be used for napi polls
  314. * @notify_frame_support: flag indicating capability to mark notify frames
  315. * @is_handle_invalid_decap_type_disabled: flag to indicate if invalid decap
  316. * type handling is disabled
  317. * @tx_pkt_inspect_for_ilp: flag to indicate if TX packet inspection for HW
  318. * based ILP feature is enabled
  319. */
  320. struct wlan_cfg_dp_soc_ctxt {
  321. int num_int_ctxts;
  322. int max_clients;
  323. int max_alloc_size;
  324. int per_pdev_tx_ring;
  325. int num_tx_comp_rings;
  326. int num_tcl_data_rings;
  327. int num_nss_tcl_data_rings;
  328. int per_pdev_rx_ring;
  329. int per_pdev_lmac_ring;
  330. int num_reo_dest_rings;
  331. int num_nss_reo_dest_rings;
  332. int num_tx_desc_pool;
  333. int num_tx_ext_desc_pool;
  334. int num_global_tx_desc;
  335. int num_global_spcl_tx_desc;
  336. int num_tx_desc;
  337. int num_tx_spl_desc;
  338. int min_tx_desc;
  339. int num_tx_ext_desc;
  340. int max_peer_id;
  341. int htt_packet_type;
  342. int int_batch_threshold_ppe2tcl;
  343. int int_timer_threshold_ppe2tcl;
  344. int int_batch_threshold_tx;
  345. int int_timer_threshold_tx;
  346. int int_batch_threshold_rx;
  347. int int_timer_threshold_rx;
  348. int int_batch_threshold_other;
  349. int int_timer_threshold_other;
  350. int int_timer_threshold_mon;
  351. int tx_ring_size;
  352. int time_control_bp;
  353. int tx_comp_ring_size;
  354. int tx_comp_ring_size_nss;
  355. uint8_t int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  356. uint8_t int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  357. uint8_t int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  358. uint8_t int_tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  359. uint8_t int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  360. uint8_t int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  361. uint8_t int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  362. uint8_t int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  363. uint8_t int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  364. uint8_t int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  365. uint8_t int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  366. uint8_t int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  367. uint8_t int_rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  368. uint8_t int_rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  369. uint8_t int_tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  370. uint8_t int_host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  371. uint8_t int_ppeds_wbm_release_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  372. uint8_t int_ppe2tcl_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  373. uint8_t int_reo2ppe_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  374. uint8_t int_umac_reset_intr_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  375. int hw_macid[MAX_PDEV_CNT];
  376. int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
  377. int base_hw_macid;
  378. bool rx_hash;
  379. bool tso_enabled;
  380. bool lro_enabled;
  381. bool sg_enabled;
  382. bool gro_enabled;
  383. bool tc_based_dynamic_gro;
  384. uint32_t tc_ingress_prio;
  385. bool ipa_enabled;
  386. bool ol_tx_csum_enabled;
  387. bool ol_rx_csum_enabled;
  388. bool rawmode_enabled;
  389. bool peer_flow_ctrl_enabled;
  390. bool napi_enabled;
  391. bool p2p_tcp_udp_checksumoffload;
  392. bool nan_tcp_udp_checksumoffload;
  393. bool tcp_udp_checksumoffload;
  394. bool legacy_mode_checksumoffload_disable;
  395. bool defrag_timeout_check;
  396. int nss_cfg;
  397. uint32_t tx_flow_stop_queue_threshold;
  398. uint32_t tx_flow_start_queue_offset;
  399. int rx_defrag_min_timeout;
  400. int reo_dst_ring_size;
  401. int wbm_release_ring;
  402. int tcl_cmd_credit_ring;
  403. int tcl_status_ring;
  404. int reo_reinject_ring;
  405. int rx_release_ring;
  406. int reo_exception_ring;
  407. int reo_cmd_ring;
  408. int reo_status_ring;
  409. int rxdma_refill_ring;
  410. bool rxdma_refill_lt_disable;
  411. int rxdma_err_dst_ring;
  412. uint32_t per_pkt_trace;
  413. bool raw_mode_war;
  414. uint32_t enable_data_stall_detection;
  415. bool disable_intra_bss_fwd;
  416. bool rxdma1_enable;
  417. bool delay_mon_replenish;
  418. int max_ast_idx;
  419. int tx_desc_limit_0;
  420. int tx_desc_limit_1;
  421. int tx_desc_limit_2;
  422. int tx_device_limit;
  423. int tx_spl_device_limit;
  424. int tx_sw_internode_queue;
  425. int mon_drop_thresh;
  426. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  427. uint32_t tx_comp_loop_pkt_limit;
  428. uint32_t rx_reap_loop_pkt_limit;
  429. uint32_t rx_hp_oos_update_limit;
  430. bool rx_enable_eol_data_check;
  431. bool tx_comp_enable_eol_data_check;
  432. #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
  433. int rx_sw_desc_weight;
  434. int rx_sw_desc_num;
  435. bool is_rx_mon_protocol_flow_tag_enabled;
  436. bool is_rx_flow_tag_enabled;
  437. bool is_rx_flow_search_table_per_pdev;
  438. uint16_t rx_flow_search_table_size;
  439. uint16_t rx_flow_max_search;
  440. uint8_t *rx_toeplitz_hash_key;
  441. uint8_t pktlog_buffer_size;
  442. uint8_t is_rx_fisa_enabled;
  443. bool is_rx_fisa_lru_del_enabled;
  444. bool is_tso_desc_attach_defer;
  445. uint32_t delayed_replenish_entries;
  446. uint32_t reo_rings_mapping;
  447. bool pext_stats_enabled;
  448. bool is_rx_buff_pool_enabled;
  449. bool is_rx_refill_buff_pool_enabled;
  450. uint32_t rx_pending_high_threshold;
  451. uint32_t rx_pending_low_threshold;
  452. bool is_poll_mode_enabled;
  453. uint8_t is_swlm_enabled;
  454. bool fst_in_cmem;
  455. bool tx_per_pkt_vdev_id_check;
  456. uint8_t radio0_rx_default_reo;
  457. uint8_t radio1_rx_default_reo;
  458. uint8_t radio2_rx_default_reo;
  459. bool wow_check_rx_pending_enable;
  460. bool jitter_stats_enabled;
  461. bool peer_link_stats_enabled;
  462. #ifdef IPA_OFFLOAD
  463. uint32_t ipa_tx_ring_size;
  464. uint32_t ipa_tx_comp_ring_size;
  465. #ifdef IPA_WDI3_TX_TWO_PIPES
  466. int ipa_tx_alt_ring_size;
  467. int ipa_tx_alt_comp_ring_size;
  468. #endif /* IPA_WDI3_TX_TWO_PIPES */
  469. #endif /* IPA_OFFLOAD */
  470. bool hw_cc_enabled;
  471. struct wlan_cfg_tcl_wbm_ring_num_map *tcl_wbm_map_array;
  472. #ifdef WLAN_SUPPORT_PPEDS
  473. bool ppeds_enable;
  474. int reo2ppe_ring;
  475. int ppe2tcl_ring;
  476. int ppeds_num_tx_desc;
  477. int ppeds_tx_comp_napi_budget;
  478. int ppeds_tx_desc_hotlist_len;
  479. #endif
  480. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  481. uint32_t pkt_capture_mode;
  482. #endif
  483. uint32_t rx_mon_buf_ring_size;
  484. uint32_t tx_mon_buf_ring_size;
  485. uint8_t rx_rel_wbm2sw_ring_id;
  486. uint32_t tx_rings_grp_bitmap;
  487. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  488. uint8_t mlo_chip_rx_ring_map;
  489. #endif
  490. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  491. bool vdev_stats_hw_offload_config;
  492. int vdev_stats_hw_offload_timer;
  493. #endif
  494. uint8_t num_rxdma_dst_rings_per_pdev;
  495. bool txmon_hw_support;
  496. bool txmon_sw_peer_filtering;
  497. uint8_t num_rxdma_status_rings_per_pdev;
  498. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  499. uint32_t tx_capt_max_mem_allowed;
  500. #endif
  501. #ifdef CONFIG_SAWF
  502. bool sawf_enabled;
  503. #endif
  504. #ifdef CONFIG_SAWF_STATS
  505. uint8_t sawf_stats;
  506. #endif
  507. uint8_t mpdu_retry_threshold_1;
  508. uint8_t mpdu_retry_threshold_2;
  509. uint8_t napi_scale_factor;
  510. uint8_t notify_frame_support;
  511. bool is_handle_invalid_decap_type_disabled;
  512. #ifdef DP_TX_PACKET_INSPECT_FOR_ILP
  513. bool tx_pkt_inspect_for_ilp;
  514. #endif
  515. };
  516. /**
  517. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  518. * @rx_dma_buf_ring_size: Size of RxDMA buffer ring
  519. * @dma_mon_buf_ring_size: Size of RxDMA Monitor buffer ring
  520. * @dma_rx_mon_dest_ring_size: Size of RxDMA Monitor Destination ring
  521. * @dma_tx_mon_dest_ring_size: Size of Tx Monitor Destination ring
  522. * @dma_mon_status_ring_size: Size of RxDMA Monitor Status ring
  523. * @rxdma_monitor_desc_ring: rxdma monitor desc ring size
  524. * @num_mac_rings: Number of mac rings
  525. * @nss_enabled: 1 - NSS enabled, 0 - NSS disabled
  526. * @dma_tx_mon_buf_ring_size: Tx monitor BUF Ring size
  527. */
  528. struct wlan_cfg_dp_pdev_ctxt {
  529. int rx_dma_buf_ring_size;
  530. int dma_mon_buf_ring_size;
  531. int dma_rx_mon_dest_ring_size;
  532. int dma_tx_mon_dest_ring_size;
  533. int dma_mon_status_ring_size;
  534. int rxdma_monitor_desc_ring;
  535. int num_mac_rings;
  536. int nss_enabled;
  537. int dma_tx_mon_buf_ring_size;
  538. };
  539. /**
  540. * struct wlan_dp_prealloc_cfg - DP prealloc related config
  541. * @num_tx_ring_entries: num of tcl data ring entries
  542. * @num_tx_comp_ring_entries: num of tx comp ring entries
  543. * @num_wbm_rel_ring_entries: num of wbm err ring entries
  544. * @num_rxdma_err_dst_ring_entries: num of rxdma err ring entries
  545. * @num_reo_exception_ring_entries: num of rx exception ring entries
  546. * @num_tx_desc: num of tx descriptors
  547. * @num_tx_ext_desc: num of tx ext descriptors
  548. * @num_reo_dst_ring_entries: Number of entries in REO destination ring
  549. * @num_rxdma_buf_ring_entries: Number of entries in rxdma buf ring
  550. * @num_rxdma_refill_ring_entries: Number of entries in rxdma refill ring
  551. * @num_reo_status_ring_entries: Number of entries in REO status ring
  552. * @num_mon_status_ring_entries: Number of entries in monitor status ring
  553. */
  554. struct wlan_dp_prealloc_cfg {
  555. int num_tx_ring_entries;
  556. int num_tx_comp_ring_entries;
  557. int num_wbm_rel_ring_entries;
  558. int num_rxdma_err_dst_ring_entries;
  559. int num_reo_exception_ring_entries;
  560. int num_tx_desc;
  561. int num_tx_ext_desc;
  562. int num_reo_dst_ring_entries;
  563. int num_rxdma_buf_ring_entries;
  564. int num_rxdma_refill_ring_entries;
  565. int num_reo_status_ring_entries;
  566. int num_mon_status_ring_entries;
  567. };
  568. /**
  569. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  570. * @psoc: PSOC object
  571. *
  572. * Allocates context for Soc configuration parameters,
  573. * Read configuration information from device tree/ini file and
  574. * returns back handle
  575. *
  576. * Return: Handle to configuration context
  577. */
  578. struct wlan_cfg_dp_soc_ctxt *
  579. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc);
  580. /**
  581. * wlan_cfg_soc_detach() - Detach soc configuration handle
  582. * @wlan_cfg_ctx: soc configuration handle
  583. *
  584. * De-allocates memory allocated for SoC configuration
  585. *
  586. * Return:none
  587. */
  588. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  589. /**
  590. * wlan_cfg_pdev_attach() - Attach configuration interface for pdev
  591. * @ctrl_obj: PSOC object
  592. *
  593. * Allocates context for pdev configuration parameters,
  594. * Read configuration information from device tree/ini file and
  595. * returns back handle
  596. *
  597. * Return: Handle to configuration context
  598. */
  599. struct wlan_cfg_dp_pdev_ctxt *
  600. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  601. /**
  602. * wlan_cfg_pdev_detach() - Detach and free pdev configuration handle
  603. * @wlan_cfg_pdev_ctx: PDEV Configuration Handle
  604. *
  605. * Return: void
  606. */
  607. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  608. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  609. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  610. int context, int mask);
  611. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  612. int context, int mask);
  613. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  614. int context, int mask);
  615. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  616. int context, int mask);
  617. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  618. int mask);
  619. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  620. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  621. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
  622. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
  623. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  624. int context, int mask);
  625. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  626. int context, int mask);
  627. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  628. int context, int mask);
  629. /**
  630. * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
  631. * for monitor buffer ring at initialization
  632. * @wlan_cfg_ctx: Configuration Handle
  633. * @replenish_entries: number of entries to replenish at initialization
  634. *
  635. */
  636. void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  637. *wlan_cfg_ctx,
  638. uint32_t replenish_entries);
  639. /**
  640. * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
  641. * for monitor buffer ring at initialization
  642. * @wlan_cfg_ctx: Configuration Handle
  643. *
  644. * Return: delayed_replenish_entries;
  645. */
  646. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  647. *wlan_cfg_ctx);
  648. /**
  649. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  650. * @wlan_cfg_ctx: Configuration Handle
  651. *
  652. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  653. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  654. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  655. * that are processed by the handler.
  656. *
  657. * Return: num_contexts
  658. */
  659. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  660. /**
  661. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  662. * interrupt context
  663. * @wlan_cfg_ctx: Configuration Handle
  664. * @context: Numerical ID identifying the Interrupt/NAPI context
  665. *
  666. * Return: int_tx_ring_mask[context]
  667. */
  668. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  669. int context);
  670. /**
  671. * wlan_cfg_get_tcl_wbm_ring_num_for_index() - Get TCL/WBM ring number for index
  672. * @wlan_cfg_ctx: Configuration Handle
  673. * @index: index for which TCL/WBM ring numbers are needed
  674. * @tcl: pointer to TCL ring number, to be filled
  675. * @wbm: pointer to WBM ring number to be filled
  676. *
  677. * The function fills in tcl/wbm input pointers with TCL/WBM ring numbers for a
  678. * given index corresponding to soc->tcl_data_ring or soc->tx_comp_ring. This
  679. * is needed since WBM/TCL rings may not be sequentially available for HOST
  680. * to use. The function returns values as stored in tcl_wbm_map_array global
  681. * array.
  682. *
  683. * Return: None
  684. */
  685. static inline
  686. void wlan_cfg_get_tcl_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  687. int index, int *tcl, int *wbm)
  688. {
  689. *tcl = wlan_cfg_ctx->tcl_wbm_map_array[index].tcl_ring_num;
  690. *wbm = wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num;
  691. }
  692. /**
  693. * wlan_cfg_get_wbm_ring_num_for_index() - Get WBM ring number for index
  694. * @wlan_cfg_ctx: Configuration Handle
  695. * @index: index for which WBM ring numbers is needed
  696. *
  697. * Return: WBM Ring number for the index
  698. */
  699. static inline
  700. int wlan_cfg_get_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  701. int index)
  702. {
  703. return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num;
  704. }
  705. /**
  706. * wlan_cfg_get_rbm_id_for_index() - Get WBM RBM ID for TX ring index
  707. * @wlan_cfg_ctx: Configuration Handle
  708. * @index: TCL index for which WBM rbm value is needed
  709. *
  710. * The function fills in wbm rbm value corresponding to a TX ring index in
  711. * soc->tcl_data_ring. This is needed since WBM ring numbers donot map
  712. * sequentially to wbm rbm values.
  713. * The function returns rbm id values as stored in tcl_wbm_map_array global
  714. * array.
  715. *
  716. * Return: WBM rbm value corresnponding to TX ring index
  717. */
  718. static inline
  719. int wlan_cfg_get_rbm_id_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, int index)
  720. {
  721. return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_rbm_id;
  722. }
  723. /**
  724. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  725. * interrupt context
  726. * @wlan_cfg_ctx: Configuration Handle
  727. * @context: Numerical ID identifying the Interrupt/NAPI context
  728. *
  729. * Return: int_rx_ring_mask[context]
  730. */
  731. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  732. int context);
  733. /**
  734. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  735. * mapped to an interrupt context
  736. * @wlan_cfg_ctx: Configuration Handle
  737. * @context: Numerical ID identifying the Interrupt/NAPI context
  738. *
  739. * Return: int_rx_mon_ring_mask[context]
  740. */
  741. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  742. int context);
  743. /**
  744. * wlan_cfg_set_tx_mon_ring_mask() - Set Tx monitor ring interrupt mask
  745. * mapped to an interrupt context
  746. * @cfg: Configuration Handle
  747. * @context: Numerical ID identifying the Interrupt/NAPI context
  748. * @mask: Interrupt mask
  749. *
  750. * Return: None
  751. */
  752. void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  753. int context, int mask);
  754. /**
  755. * wlan_cfg_get_tx_mon_ring_mask() - Return Tx monitor ring interrupt mask
  756. * mapped to an interrupt context
  757. * @wlan_cfg_ctx: Configuration Handle
  758. * @context: Numerical ID identifying the Interrupt/NAPI context
  759. *
  760. * Return: int_tx_mon_ring_mask[context]
  761. */
  762. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  763. int context);
  764. /**
  765. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  766. * for the given interrupt context
  767. * @cfg: Configuration Handle
  768. * @context: Numerical ID identifying the Interrupt/NAPI context
  769. * @mask: Interrupt mask
  770. *
  771. */
  772. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  773. int context, int mask);
  774. /**
  775. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  776. * mapped to an interrupt context
  777. * @cfg: Configuration Handle
  778. * @context: Numerical ID identifying the Interrupt/NAPI context
  779. *
  780. * Return: int_rxdma2host_ring_mask[context]
  781. */
  782. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  783. int context);
  784. /**
  785. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  786. * for the given interrupt context
  787. * @cfg: Configuration Handle
  788. * @context: Numerical ID identifying the Interrupt/NAPI context
  789. * @mask: Interrupt mask
  790. *
  791. */
  792. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  793. int context, int mask);
  794. /**
  795. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  796. * mapped to an interrupt context
  797. * @cfg: Configuration Handle
  798. * @context: Numerical ID identifying the Interrupt/NAPI context
  799. *
  800. * Return: int_host2rxdma_ring_mask[context]
  801. */
  802. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  803. int context);
  804. /**
  805. * wlan_cfg_get_rx_near_full_grp_1_mask() - Return REO near full interrupt mask
  806. * mapped to an interrupt context
  807. * @cfg: Configuration Handle
  808. * @context: Numerical ID identifying the Interrupt/NAPI context
  809. *
  810. * Return: REO near full interrupt mask[context]
  811. */
  812. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  813. int context);
  814. /**
  815. * wlan_cfg_get_rx_near_full_grp_2_mask() - Return REO near full interrupt mask
  816. * mapped to an interrupt context
  817. * @cfg: Configuration Handle
  818. * @context: Numerical ID identifying the Interrupt/NAPI context
  819. *
  820. * Return: REO near full interrupt mask[context]
  821. */
  822. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  823. int context);
  824. /**
  825. * wlan_cfg_get_tx_ring_near_full_mask() - Return tx completion ring near full
  826. * interrupt mask mapped to an interrupt context
  827. * @cfg: Configuration Handle
  828. * @context: Numerical ID identifying the Interrupt/NAPI context
  829. *
  830. * Return: tx completion near full interrupt mask[context]
  831. */
  832. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  833. int context);
  834. /**
  835. * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
  836. * interrupt mask for the given interrupt context
  837. * @cfg: Configuration Handle
  838. * @context: Numerical ID identifying the Interrupt/NAPI context
  839. * @mask: Interrupt mask
  840. *
  841. */
  842. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  843. int context, int mask);
  844. /**
  845. * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
  846. * interrupt mask mapped to an interrupt context
  847. * @cfg: Configuration Handle
  848. * @context: Numerical ID identifying the Interrupt/NAPI context
  849. *
  850. * Return: int_host2rxdma_mon_ring_mask[context]
  851. */
  852. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  853. int context);
  854. /**
  855. * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
  856. * destination ring interrupt mask
  857. * for the given interrupt context
  858. * @cfg: Configuration Handle
  859. * @context: Numerical ID identifying the Interrupt/NAPI context
  860. * @mask: Interrupt mask
  861. *
  862. */
  863. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  864. int context, int mask);
  865. /**
  866. * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
  867. * destination ring interrupt mask
  868. * mapped to an interrupt context
  869. * @cfg: Configuration Handle
  870. * @context: Numerical ID identifying the Interrupt/NAPI context
  871. *
  872. * Return: int_rxdma2host_mon_ring_mask[context]
  873. */
  874. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  875. int context);
  876. /**
  877. * wlan_cfg_set_hw_mac_idx() - Set HW MAC Idx for the given PDEV index
  878. *
  879. * @cfg: Configuration Handle
  880. * @pdev_idx: Index of SW PDEV
  881. * @hw_macid: HW MAC Id
  882. *
  883. */
  884. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg,
  885. int pdev_idx, int hw_macid);
  886. /**
  887. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  888. * PDEV index
  889. *
  890. * @cfg: Configuration Handle
  891. * @pdev_idx: Index of SW PDEV
  892. *
  893. * Return: HW MAC index
  894. */
  895. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  896. /**
  897. * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
  898. *
  899. * @cfg: Configuration Handle
  900. * @hw_macid: Index of hw mac
  901. *
  902. * Return: PDEV ID
  903. */
  904. int
  905. wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  906. /**
  907. * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
  908. * hw mac index
  909. *
  910. * @cfg: Configuration Handle
  911. * @pdev_idx: Index of SW PDEV
  912. * @hw_macid: Index of hw mac
  913. *
  914. * Return: PDEV index
  915. */
  916. void wlan_cfg_set_pdev_idx
  917. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  918. /**
  919. * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
  920. * hw mac index
  921. *
  922. * @cfg: Configuration Handle
  923. * @hw_macid: Index of hw mac
  924. *
  925. * Return: PDEV index
  926. */
  927. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  928. /**
  929. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  930. * mapped to an interrupt context
  931. * @cfg: Configuration Handle
  932. * @context: Numerical ID identifying the Interrupt/NAPI context
  933. *
  934. * Return: int_rx_err_ring_mask[context]
  935. */
  936. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  937. context);
  938. /**
  939. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  940. * mapped to an interrupt context
  941. * @cfg: Configuration Handle
  942. * @context: Numerical ID identifying the Interrupt/NAPI context
  943. *
  944. * Return: int_wbm_rel_ring_mask[context]
  945. */
  946. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  947. context);
  948. /**
  949. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  950. * mapped to an interrupt context
  951. * @cfg: Configuration Handle
  952. * @context: Numerical ID identifying the Interrupt/NAPI context
  953. *
  954. * Return: int_reo_status_ring_mask[context]
  955. */
  956. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  957. context);
  958. /**
  959. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  960. * mapped to an interrupt context
  961. * @wlan_cfg_ctx: Configuration Handle
  962. * @context: Numerical ID identifying the Interrupt/NAPI context
  963. *
  964. * Return: int_ce_ring_mask[context]
  965. */
  966. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  967. int context);
  968. /**
  969. * wlan_cfg_get_umac_reset_intr_mask() - Get UMAC reset interrupt mask
  970. * mapped to an interrupt context
  971. * @cfg: Configuration Handle
  972. * @context: Numerical ID identifying the Interrupt/NAPI context
  973. *
  974. * Return: int_umac_reset_intr_mask[context]
  975. */
  976. int wlan_cfg_get_umac_reset_intr_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  977. int context);
  978. /**
  979. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  980. * supported by device
  981. * @wlan_cfg_ctx: Configuration Handle
  982. *
  983. * Return: max_clients
  984. */
  985. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  986. /**
  987. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  988. * memory allocation request for this device
  989. * @wlan_cfg_ctx: Configuration Handle
  990. *
  991. * Return: max_alloc_size
  992. */
  993. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  994. /**
  995. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  996. * one per radio
  997. * @wlan_cfg_ctx: Configuration Handle
  998. *
  999. * Return: per_pdev_tx_ring
  1000. */
  1001. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1002. /**
  1003. * wlan_cfg_num_tx_comp_rings() - Number of Tx comp rings (HOST mode)
  1004. * @wlan_cfg_ctx: Configuration Handle
  1005. *
  1006. * Return: num_tx_comp_rings
  1007. */
  1008. int wlan_cfg_num_tx_comp_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1009. /**
  1010. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings (HOST mode)
  1011. * @wlan_cfg_ctx: Configuration Handle
  1012. *
  1013. * Return: num_tcl_data_rings
  1014. */
  1015. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1016. /**
  1017. * wlan_cfg_num_nss_tcl_data_rings() - Number of TCL Data rings (NSS offload)
  1018. * @wlan_cfg_ctx: Configuration Handle
  1019. *
  1020. * Return: num_tcl_data_rings
  1021. */
  1022. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1023. /**
  1024. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  1025. * one per radio
  1026. * @wlan_cfg_ctx: Configuration Handle
  1027. *
  1028. * Return: per_pdev_rx_ring
  1029. */
  1030. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1031. /**
  1032. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  1033. * one per radio
  1034. * @wlan_cfg_ctx: Configuration Handle
  1035. *
  1036. * Return: return 1 if per pdev error ring else 0
  1037. */
  1038. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1039. /**
  1040. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings (HOST mode)
  1041. * @wlan_cfg_ctx: Configuration Handle
  1042. *
  1043. * Return: num_reo_dest_rings
  1044. */
  1045. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1046. /**
  1047. * wlan_cfg_num_nss_reo_dest_rings() - Number of REO Data rings (NSS offload)
  1048. * @wlan_cfg_ctx: Configuration Handle
  1049. *
  1050. * Return: num_reo_dest_rings
  1051. */
  1052. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1053. /**
  1054. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  1055. * @wlan_cfg_ctx: Configuration Handle
  1056. *
  1057. * Return: htt_pkt_type_ethernet
  1058. */
  1059. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1060. /**
  1061. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  1062. * device
  1063. * @wlan_cfg_ctx: Configuration Handle
  1064. *
  1065. * Return: num_tx_desc_pool
  1066. */
  1067. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1068. /**
  1069. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  1070. * device
  1071. * @cfg: Configuration Handle
  1072. * @num_pool: Number of pool
  1073. */
  1074. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  1075. /**
  1076. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  1077. * pools
  1078. * @wlan_cfg_ctx: Configuration Handle
  1079. *
  1080. * Return: num_tx_ext_desc_pool
  1081. */
  1082. int wlan_cfg_get_num_tx_ext_desc_pool(
  1083. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1084. /**
  1085. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  1086. *
  1087. * @cfg: Configuration Handle
  1088. *
  1089. * Return: reo_dst_ring_size
  1090. */
  1091. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1092. /**
  1093. * wlan_cfg_set_reo_dst_ring_size() - Set the REO Destination ring size
  1094. *
  1095. * @cfg: Configuration Handle
  1096. * @reo_dst_ring_size: REO Destination ring size
  1097. */
  1098. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1099. int reo_dst_ring_size);
  1100. /**
  1101. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  1102. *
  1103. * @cfg: Configuration Handle
  1104. * @raw_mode_war: raw mode war configuration
  1105. */
  1106. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  1107. bool raw_mode_war);
  1108. /**
  1109. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  1110. *
  1111. * @cfg: Configuration Handle
  1112. *
  1113. * Return: reo_dst_ring_size
  1114. */
  1115. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  1116. /**
  1117. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  1118. * pools
  1119. * @cfg: Configuration Handle
  1120. * @num_pool: Number of pool
  1121. */
  1122. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  1123. /**
  1124. * wlan_cfg_get_num_global_tx_desc() - Number of global Tx Descriptors allowed
  1125. * @wlan_cfg_ctx: Configuration Handle
  1126. *
  1127. * Return: num_global_tx_desc
  1128. */
  1129. int wlan_cfg_get_num_global_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1130. /**
  1131. * wlan_cfg_get_num_global_spcl_tx_desc() - Number of global special Tx Descriptors
  1132. * allowed
  1133. * @wlan_cfg_ctx: Configuration Handle
  1134. *
  1135. * Return: num_global_spcl_tx_desc
  1136. */
  1137. int wlan_cfg_get_num_global_spcl_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1138. /**
  1139. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  1140. * @wlan_cfg_ctx: Configuration Handle
  1141. *
  1142. * Return: num_tx_desc
  1143. */
  1144. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1145. /**
  1146. * wlan_cfg_get_num_tx_spl_desc() - Number of Tx Descriptors for special
  1147. * frames per pool
  1148. * @wlan_cfg_ctx: Configuration Handle
  1149. *
  1150. * Return: num_tx_desc
  1151. */
  1152. int wlan_cfg_get_num_tx_spl_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1153. /**
  1154. * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
  1155. * @wlan_cfg_ctx: Configuration Handle
  1156. *
  1157. * Return: num_tx_desc
  1158. */
  1159. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1160. /**
  1161. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  1162. *
  1163. * @cfg: Configuration Handle
  1164. * @num_desc: Number of descriptor
  1165. */
  1166. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  1167. /**
  1168. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  1169. * per pool
  1170. * @wlan_cfg_ctx: Configuration Handle
  1171. *
  1172. * Return: num_tx_ext_desc
  1173. */
  1174. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1175. /**
  1176. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension
  1177. * Descriptors per pool
  1178. * @cfg: Configuration Handle
  1179. * @num_ext_desc: Number of descriptor
  1180. */
  1181. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg,
  1182. int num_ext_desc);
  1183. /**
  1184. * wlan_cfg_max_peer_id() - Get maximum peer ID
  1185. * @cfg: Configuration Handle
  1186. *
  1187. * Return: maximum peer ID
  1188. */
  1189. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  1190. /**
  1191. * wlan_cfg_get_dma_mon_buf_ring_size(): Return Size of monitor buffer ring
  1192. * @wlan_cfg_pdev_ctx: pdev configuration context
  1193. *
  1194. * Return: dma_mon_buf_ring_size
  1195. */
  1196. int wlan_cfg_get_dma_mon_buf_ring_size(
  1197. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  1198. /**
  1199. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  1200. * @wlan_cfg_pdev_ctx: pdev configuration context
  1201. *
  1202. * Return: dma_mon_stat_ring_size
  1203. */
  1204. int wlan_cfg_get_dma_mon_stat_ring_size(
  1205. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  1206. /**
  1207. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  1208. * @cfg: soc configuration context
  1209. *
  1210. * Return: rxdma monitor desc ring size
  1211. */
  1212. int
  1213. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1214. /**
  1215. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  1216. * @wlan_cfg_pdev_ctx: pdev configuration context
  1217. *
  1218. * Return: rx_dma_buf_ring_size
  1219. */
  1220. int wlan_cfg_get_rx_dma_buf_ring_size(
  1221. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  1222. /**
  1223. * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
  1224. * @cfg: pdev configuration context
  1225. *
  1226. * Return: rx_pending_high_threshold
  1227. */
  1228. uint32_t
  1229. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  1230. /**
  1231. * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
  1232. * @cfg: soc configuration context
  1233. *
  1234. * Return: rx_pending_low_threshold
  1235. */
  1236. uint32_t
  1237. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
  1238. /**
  1239. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  1240. * per pdev
  1241. * @cfg: pdev configuration context
  1242. *
  1243. * Return: number of mac DMA rings per pdev
  1244. */
  1245. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1246. /**
  1247. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  1248. * @cfg: soc configuration context
  1249. *
  1250. * Return: true - LRO enabled false - LRO disabled
  1251. */
  1252. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1253. /**
  1254. * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
  1255. * @cfg: soc configuration context
  1256. *
  1257. * Return: true - GRO enabled false - GRO disabled
  1258. */
  1259. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1260. /**
  1261. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  1262. * @cfg: soc configuration context
  1263. *
  1264. * Return: true - enabled false - disabled
  1265. */
  1266. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1267. /**
  1268. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  1269. * @cfg: soc configuration context
  1270. *
  1271. * Return: true - enabled false - disabled
  1272. */
  1273. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1274. /**
  1275. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  1276. * @cfg: soc configuration context
  1277. * @rx_hash: true - enabled false - disabled
  1278. */
  1279. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  1280. /**
  1281. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  1282. * @cfg: pdev configuration context
  1283. *
  1284. * Return: 1 - enabled 0 - disabled
  1285. */
  1286. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  1287. /**
  1288. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  1289. * @cfg: pdev configuration context
  1290. * @nss_enabled: 1 - enabled 0 - disabled
  1291. */
  1292. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg,
  1293. int nss_enabled);
  1294. /**
  1295. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  1296. * @cfg: soc configuration context
  1297. *
  1298. * Return: nss_cfg
  1299. */
  1300. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  1301. /**
  1302. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  1303. * @cfg: soc configuration context
  1304. * @nss_cfg: NSS configuration
  1305. *
  1306. */
  1307. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  1308. /**
  1309. * wlan_cfg_get_int_timer_threshold_ppe2tcl - Get intr mitigation for ppe2tcl
  1310. * @cfg: soc configuration context
  1311. *
  1312. * Return: Timer threshold
  1313. */
  1314. int wlan_cfg_get_int_timer_threshold_ppe2tcl(struct wlan_cfg_dp_soc_ctxt *cfg);
  1315. /**
  1316. * wlan_cfg_get_int_batch_threshold_ppe2tcl - Get intr mitigation for ppe2tcl
  1317. * @cfg: soc configuration context
  1318. *
  1319. * Return: Batch threshold
  1320. */
  1321. int wlan_cfg_get_int_batch_threshold_ppe2tcl(struct wlan_cfg_dp_soc_ctxt *cfg);
  1322. /**
  1323. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  1324. * @cfg: soc configuration context
  1325. *
  1326. * Return: Batch threshold
  1327. */
  1328. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1329. /**
  1330. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  1331. * @cfg: soc configuration context
  1332. *
  1333. * Return: Timer threshold
  1334. */
  1335. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1336. /**
  1337. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  1338. * @cfg: soc configuration context
  1339. *
  1340. * Return: Batch threshold
  1341. */
  1342. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1343. /**
  1344. * wlan_cfg_get_int_timer_threshold_rx - Get interrupt mitigation cfg for Rx
  1345. * @cfg: soc configuration context
  1346. *
  1347. * Return: Timer threshold
  1348. */
  1349. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  1350. /**
  1351. * wlan_cfg_get_int_batch_threshold_other - Get interrupt mitigation cfg for
  1352. * other srngs
  1353. * @cfg: soc configuration context
  1354. *
  1355. * Return: Batch threshold
  1356. */
  1357. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  1358. /**
  1359. * wlan_cfg_get_int_timer_threshold_other - Get interrupt mitigation cfg for
  1360. * other srngs
  1361. * @cfg: soc configuration context
  1362. *
  1363. * Return: Timer threshold
  1364. */
  1365. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  1366. /**
  1367. * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
  1368. * @cfg: soc configuration context
  1369. *
  1370. * Return: Timer threshold
  1371. */
  1372. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
  1373. /**
  1374. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  1375. * @cfg: soc configuration context
  1376. *
  1377. * Return: Checksum offload enable or disable
  1378. */
  1379. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  1380. /**
  1381. * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
  1382. * @cfg: soc configuration context
  1383. *
  1384. * Return: Checksum offload enable or disable value for NAN mode
  1385. */
  1386. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  1387. /**
  1388. * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
  1389. * @cfg: soc configuration context
  1390. *
  1391. * Return: Checksum offload enable or disable value for P2P mode
  1392. */
  1393. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  1394. /**
  1395. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  1396. * @cfg: soc configuration context
  1397. *
  1398. * Return: Tx Ring Size
  1399. */
  1400. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1401. /**
  1402. * wlan_cfg_time_control_bp - Get time for interval in bp prints
  1403. * @cfg: soc configuration context
  1404. *
  1405. * Return: interval time
  1406. */
  1407. int wlan_cfg_time_control_bp(struct wlan_cfg_dp_soc_ctxt *cfg);
  1408. /**
  1409. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  1410. * @cfg: soc configuration context
  1411. *
  1412. * Return: Tx Completion ring size
  1413. */
  1414. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1415. /**
  1416. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  1417. * @cfg: soc configuration context
  1418. *
  1419. * Return: wbm_release_ring size
  1420. */
  1421. int
  1422. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1423. /**
  1424. * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
  1425. * @cfg: soc configuration context
  1426. *
  1427. * Return: tcl_cmd_credit_ring size
  1428. */
  1429. int
  1430. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1431. /**
  1432. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  1433. * @cfg: soc configuration context
  1434. *
  1435. * Return: tcl_status_ring size
  1436. */
  1437. int
  1438. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1439. /**
  1440. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  1441. * @cfg: soc configuration context
  1442. *
  1443. * Return: reo_reinject_ring size
  1444. */
  1445. int
  1446. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1447. /**
  1448. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  1449. * @cfg: soc configuration context
  1450. *
  1451. * Return: rx_release_ring size
  1452. */
  1453. int
  1454. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1455. /**
  1456. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  1457. * @cfg: soc configuration context
  1458. *
  1459. * Return: reo_exception_ring size
  1460. */
  1461. int
  1462. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1463. /**
  1464. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  1465. * @cfg: soc configuration context
  1466. *
  1467. * Return: reo_cmd_ring size
  1468. */
  1469. int
  1470. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1471. /**
  1472. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  1473. * @cfg: soc configuration context
  1474. *
  1475. * Return: reo_status_ring size
  1476. */
  1477. int
  1478. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1479. /**
  1480. * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
  1481. * @cfg: soc configuration context
  1482. *
  1483. * Return: tx desc limit for 5G H
  1484. */
  1485. int
  1486. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
  1487. /**
  1488. * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
  1489. * @cfg: soc configuration context
  1490. *
  1491. * Return: tx desc limit for 2G
  1492. */
  1493. int
  1494. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
  1495. /**
  1496. * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
  1497. * @cfg: soc configuration context
  1498. *
  1499. * Return: tx desc limit for 5G L
  1500. */
  1501. int
  1502. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
  1503. /**
  1504. * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
  1505. * @cfg: soc configuration context
  1506. *
  1507. * Return: tx device limit
  1508. */
  1509. int
  1510. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  1511. /**
  1512. * wlan_cfg_get_dp_soc_tx_spl_device_limit - Get tx device limit for special
  1513. * frames
  1514. * @cfg: Configuration Handle
  1515. *
  1516. * Return: tx device limit for special frames
  1517. */
  1518. int
  1519. wlan_cfg_get_dp_soc_tx_spl_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  1520. /**
  1521. * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
  1522. * @cfg: soc configuration context
  1523. *
  1524. * Return: tx sw internode queue
  1525. */
  1526. int
  1527. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
  1528. /**
  1529. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  1530. * @cfg: soc configuration context
  1531. *
  1532. * Return: rxdma refill ring size
  1533. */
  1534. int
  1535. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1536. /**
  1537. * wlan_cfg_get_dp_soc_rxdma_refill_lt_disable - Get RxDMA refill LT status
  1538. * @cfg: soc configuration context
  1539. *
  1540. * Return: true if Low threshold disable else false
  1541. */
  1542. bool
  1543. wlan_cfg_get_dp_soc_rxdma_refill_lt_disable(struct wlan_cfg_dp_soc_ctxt *cfg);
  1544. /**
  1545. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  1546. * @cfg: soc configuration context
  1547. *
  1548. * Return: rxdma error dst ring size
  1549. */
  1550. int
  1551. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1552. /**
  1553. * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
  1554. * @cfg: soc configuration context
  1555. *
  1556. * Return: rx_sw_desc_weight
  1557. */
  1558. int
  1559. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
  1560. /**
  1561. * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num
  1562. * @cfg: soc configuration context
  1563. *
  1564. * Return: rx_sw_desc_num
  1565. */
  1566. int
  1567. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg);
  1568. /**
  1569. * wlan_cfg_get_dp_caps - Get dp capabilities
  1570. * @cfg: soc configuration context
  1571. * @dp_caps: enum for dp capabilities
  1572. *
  1573. * Return: bool if a dp capabilities is enabled
  1574. */
  1575. bool
  1576. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1577. enum cdp_capabilities dp_caps);
  1578. /**
  1579. * wlan_set_srng_cfg() - Fill per ring specific
  1580. * configuration parameters
  1581. * @wlan_cfg: global srng configuration table
  1582. *
  1583. * Return: None
  1584. */
  1585. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
  1586. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1587. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  1588. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  1589. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1590. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  1591. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  1592. /**
  1593. * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
  1594. * in number of entries
  1595. *
  1596. * @cfg: soc configuration context
  1597. *
  1598. * Return: rx_fst_size
  1599. */
  1600. uint16_t
  1601. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1602. /**
  1603. * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
  1604. *
  1605. * @cfg: soc configuration context
  1606. *
  1607. * Return: max_search
  1608. */
  1609. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
  1610. /**
  1611. * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
  1612. * search
  1613. *
  1614. * @cfg: soc configuration context
  1615. *
  1616. * Return: 320-bit Hash Key
  1617. */
  1618. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
  1619. /**
  1620. * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
  1621. * DP soc context
  1622. * @cfg: soc configuration context
  1623. * @val: Rx flow tag feature flag value
  1624. *
  1625. * Return: None
  1626. */
  1627. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1628. bool val);
  1629. /**
  1630. * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
  1631. * DP soc context
  1632. * @cfg: soc configuration context
  1633. *
  1634. * Return: true if feature is enabled, else false
  1635. */
  1636. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1637. /**
  1638. * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
  1639. * Rx FST is per pdev
  1640. * @cfg: soc configuration context
  1641. * @val: boolean flag indicating Rx FST per pdev or per SOC
  1642. *
  1643. * Return: None
  1644. */
  1645. void
  1646. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1647. bool val);
  1648. /**
  1649. * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
  1650. * @cfg: soc configuration context
  1651. *
  1652. * Return: true if Rx FST is per pdev, else false
  1653. */
  1654. bool
  1655. wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
  1656. /**
  1657. * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
  1658. * @cfg: soc configuration context
  1659. * @val: Rx FST size in number of entries
  1660. *
  1661. * Return: None
  1662. */
  1663. void
  1664. wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1665. uint16_t val);
  1666. /**
  1667. * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
  1668. * in DP soc context
  1669. * @cfg: soc configuration context
  1670. * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
  1671. *
  1672. * Return: None
  1673. */
  1674. void
  1675. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1676. bool val);
  1677. /**
  1678. * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
  1679. * from DP soc context
  1680. * @cfg: soc configuration context
  1681. *
  1682. * Return: true if feature is enabled in monitor mode for protocol or flow
  1683. * tagging in INI, false otherwise
  1684. */
  1685. bool
  1686. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1687. /**
  1688. * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt
  1689. * vdev id check in tx.
  1690. * @cfg: soc configuration context
  1691. * @val: feature flag value
  1692. *
  1693. * Return: None
  1694. */
  1695. void
  1696. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  1697. bool val);
  1698. /**
  1699. * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if
  1700. * perpkt vdev id check is enabled in tx.
  1701. * @cfg: soc configuration context
  1702. *
  1703. * Return: true if feature is enabled, false otherwise
  1704. */
  1705. bool
  1706. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1707. /**
  1708. * wlan_cfg_fill_interrupt_mask() - set interrupt mask
  1709. *
  1710. * @wlan_cfg_ctx: soc configuration context
  1711. * @num_dp_msi: Number of DP interrupts available (0 for integrated)
  1712. * @interrupt_mode: Type of interrupt
  1713. * @is_monitor_mode: is monitor mode enabled
  1714. *
  1715. * Return: void
  1716. */
  1717. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1718. int num_dp_msi, int interrupt_mode,
  1719. bool is_monitor_mode);
  1720. /**
  1721. * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
  1722. *
  1723. *
  1724. * @cfg: soc configuration context
  1725. *
  1726. * Return: true if enabled, false otherwise.
  1727. */
  1728. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1729. /**
  1730. * wlan_cfg_is_rx_fisa_lru_del_enabled() - Get Rx FISA LRU del enabled flag
  1731. *
  1732. *
  1733. * @cfg: soc configuration context
  1734. *
  1735. * Return: true if enabled, false otherwise.
  1736. */
  1737. bool wlan_cfg_is_rx_fisa_lru_del_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1738. /**
  1739. * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag
  1740. *
  1741. *
  1742. * @cfg: soc configuration context
  1743. *
  1744. * Return: true if enabled, false otherwise.
  1745. */
  1746. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1747. /**
  1748. * wlan_cfg_is_rx_refill_buffer_pool_enabled() - Get RX refill buffer pool enabled flag
  1749. *
  1750. *
  1751. * @cfg: soc configuration context
  1752. *
  1753. * Return: true if enabled, false otherwise.
  1754. */
  1755. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1756. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1757. bool val);
  1758. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);
  1759. /**
  1760. * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap
  1761. *
  1762. *
  1763. * @cfg: soc configuration context
  1764. *
  1765. * Return: reo ring bitmap.
  1766. */
  1767. uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg);
  1768. /**
  1769. * wlan_cfg_set_peer_ext_stats() - set peer extended stats
  1770. *
  1771. * @cfg: soc configuration context
  1772. * @val: Flag value read from INI
  1773. *
  1774. * Return: void
  1775. */
  1776. void
  1777. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1778. bool val);
  1779. /**
  1780. * wlan_cfg_set_peer_jitter_stats() - set peer jitter stats
  1781. *
  1782. * @cfg: soc configuration context
  1783. * @val: Flag value read from INI
  1784. *
  1785. * Return: bool
  1786. */
  1787. void
  1788. wlan_cfg_set_peer_jitter_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1789. bool val);
  1790. /**
  1791. * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended
  1792. * stats are enabled
  1793. *
  1794. * @cfg: soc configuration context
  1795. *
  1796. * Return: bool
  1797. */
  1798. bool
  1799. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1800. /**
  1801. * wlan_cfg_is_peer_jitter_stats_enabled() - check if jitter stats are enabled
  1802. *
  1803. * @cfg: soc configuration context
  1804. *
  1805. * Return: bool
  1806. */
  1807. bool
  1808. wlan_cfg_is_peer_jitter_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1809. /**
  1810. * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled
  1811. *
  1812. * @cfg: soc configuration context
  1813. *
  1814. * Return: bool
  1815. */
  1816. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1817. /**
  1818. * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled
  1819. * @cfg: soc configuration context
  1820. *
  1821. * Return: true if enabled, false otherwise.
  1822. */
  1823. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1824. /**
  1825. * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag
  1826. * @cfg: soc configuration context
  1827. *
  1828. * Return: true if enabled, false otherwise.
  1829. */
  1830. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1831. /**
  1832. * wlan_cfg_set_peer_link_stats() - set peer link stats
  1833. *
  1834. * @cfg: soc configuration context
  1835. * @val: Flag value read from INI
  1836. *
  1837. * Return: void
  1838. */
  1839. void
  1840. wlan_cfg_set_peer_link_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1841. bool val);
  1842. /**
  1843. * wlan_cfg_is_peer_link_stats_enabled() - check if link peer stats are enabled
  1844. *
  1845. * @cfg: soc configuration context
  1846. *
  1847. * Return: bool
  1848. */
  1849. bool
  1850. wlan_cfg_is_peer_link_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1851. #ifdef IPA_OFFLOAD
  1852. /**
  1853. * wlan_cfg_ipa_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  1854. * @cfg: dp cfg context
  1855. *
  1856. * Return: IPA Tx Ring Size
  1857. */
  1858. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1859. /**
  1860. * wlan_cfg_ipa_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  1861. * @cfg: dp cfg context
  1862. *
  1863. * Return: IPA Tx Completion ring size
  1864. */
  1865. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1866. /**
  1867. * wlan_cfg_ipa_tx_alt_ring_size - Get Tx alt DMA ring size (TCL Data Ring)
  1868. * @cfg: dp cfg context
  1869. *
  1870. * Return: IPA Tx alt Ring Size
  1871. */
  1872. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1873. /**
  1874. * wlan_cfg_ipa_tx_alt_comp_ring_size - Get Tx alt comp DMA ring size
  1875. * (TCL Data Ring)
  1876. * @cfg: dp cfg context
  1877. *
  1878. * Return: IPA Tx alt comp Ring Size
  1879. */
  1880. int
  1881. wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1882. #else
  1883. static inline
  1884. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1885. {
  1886. return 0;
  1887. }
  1888. static inline
  1889. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1890. {
  1891. return 0;
  1892. }
  1893. #endif
  1894. /**
  1895. * wlan_cfg_radio0_default_reo_get - Get Radio0 default REO
  1896. * @cfg: soc configuration context
  1897. *
  1898. * Return: None
  1899. */
  1900. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  1901. /**
  1902. * wlan_cfg_radio1_default_reo_get - Get Radio1 default REO
  1903. * @cfg: soc configuration context
  1904. *
  1905. * Return: None
  1906. */
  1907. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  1908. /**
  1909. * wlan_cfg_radio2_default_reo_get() - Get Radio2 default REO
  1910. * @cfg: soc configuration context
  1911. *
  1912. * Return: None
  1913. */
  1914. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  1915. /**
  1916. * wlan_cfg_set_rxdma1_enable() - Enable rxdma1
  1917. * @wlan_cfg_ctx: soc configuration context
  1918. *
  1919. * Return: None
  1920. */
  1921. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  1922. /**
  1923. * wlan_cfg_is_delay_mon_replenish() - Get if delayed monitor replenish
  1924. * is enabled
  1925. * @cfg: soc configuration context
  1926. *
  1927. * Return: true if enabled, false otherwise.
  1928. */
  1929. bool
  1930. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg);
  1931. /**
  1932. * wlan_cfg_set_delay_mon_replenish() - Set delayed monitor replenish
  1933. * @cfg: soc configuration context
  1934. * @val: val to set
  1935. *
  1936. * Return: None
  1937. */
  1938. void
  1939. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, bool val);
  1940. /**
  1941. * wlan_cfg_dp_soc_ctx_dump() - Dump few DP cfg soc parameters
  1942. * @cfg: soc configuration context
  1943. *
  1944. * Return:
  1945. */
  1946. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg);
  1947. #ifdef WLAN_SUPPORT_PPEDS
  1948. /**
  1949. * wlan_cfg_get_dp_soc_is_ppeds_enabled() - API to get ppe enable flag
  1950. * @cfg: Configuration Handle
  1951. *
  1952. * Return: true if ppe is enabled else return false
  1953. */
  1954. bool
  1955. wlan_cfg_get_dp_soc_is_ppeds_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1956. /**
  1957. * wlan_cfg_get_dp_soc_reo2ppe_ring_size() - get ppe rx ring size
  1958. * @cfg: Configuration Handle
  1959. *
  1960. * Return: size of reo2ppe ring
  1961. */
  1962. int
  1963. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1964. /**
  1965. * wlan_cfg_get_dp_soc_ppe2tcl_ring_size() - get ppe tx ring size
  1966. * @cfg: Configuration Handle
  1967. *
  1968. * Return: size of ppe2tcl ring
  1969. */
  1970. int
  1971. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1972. /**
  1973. * wlan_cfg_get_dp_soc_ppeds_num_tx_desc() - Number of ppeds tx Descriptors
  1974. * @cfg: Configuration Handle
  1975. *
  1976. * Return: num_tx_desc
  1977. */
  1978. int
  1979. wlan_cfg_get_dp_soc_ppeds_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg);
  1980. /**
  1981. * wlan_cfg_get_dp_soc_ppeds_tx_desc_hotlist_len() - Max hotlist len of tx descs
  1982. * @cfg: Configuration Handle
  1983. *
  1984. * Return: hotlist len
  1985. */
  1986. int
  1987. wlan_cfg_get_dp_soc_ppeds_tx_desc_hotlist_len(struct wlan_cfg_dp_soc_ctxt *cfg);
  1988. /**
  1989. * wlan_cfg_get_dp_soc_ppeds_tx_comp_napi_budget() - ppeds Tx comp napi budget
  1990. * @cfg: Configuration Handle
  1991. *
  1992. * Return: napi budget
  1993. */
  1994. int
  1995. wlan_cfg_get_dp_soc_ppeds_tx_comp_napi_budget(struct wlan_cfg_dp_soc_ctxt *cfg);
  1996. #else
  1997. static inline bool
  1998. wlan_cfg_get_dp_soc_is_ppeds_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1999. {
  2000. return false;
  2001. }
  2002. static inline int
  2003. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2004. {
  2005. return 0;
  2006. }
  2007. static inline int
  2008. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2009. {
  2010. return 0;
  2011. }
  2012. static inline int
  2013. wlan_cfg_get_dp_soc_ppeds_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2014. {
  2015. return 0;
  2016. }
  2017. static inline int
  2018. wlan_cfg_get_dp_soc_ppeds_tx_comp_napi_budget(struct wlan_cfg_dp_soc_ctxt *cfg)
  2019. {
  2020. return 0;
  2021. }
  2022. static inline int
  2023. wlan_cfg_get_dp_soc_ppeds_tx_desc_hotlist_len(struct wlan_cfg_dp_soc_ctxt *cfg)
  2024. {
  2025. return 0;
  2026. }
  2027. #endif
  2028. /**
  2029. * wlan_cfg_get_prealloc_cfg() - Get dp prealloc related cfg param
  2030. * @ctrl_psoc: PSOC object
  2031. * @cfg: cfg ctx where values will be populated
  2032. *
  2033. * Return: None
  2034. */
  2035. void
  2036. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  2037. struct wlan_dp_prealloc_cfg *cfg);
  2038. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2039. /**
  2040. * wlan_cfg_get_pkt_capture_mode() - Get packet capture mode config
  2041. * @cfg: config context
  2042. *
  2043. * Return: value of packet capture mode
  2044. */
  2045. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg);
  2046. #else
  2047. static inline
  2048. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  2049. {
  2050. return 0;
  2051. }
  2052. #endif
  2053. /**
  2054. * wlan_cfg_get_dp_soc_rx_mon_buf_ring_size() - Rx MON buf ring size
  2055. * @cfg: Configuration Handle
  2056. *
  2057. * Return: Size of Rx MON buf ring size
  2058. */
  2059. uint32_t
  2060. wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  2061. /**
  2062. * wlan_cfg_get_dp_soc_tx_mon_buf_ring_size() - Tx MON buf ring size
  2063. * @cfg: Configuration Handle
  2064. *
  2065. * Return: Size of Tx MON buf ring size
  2066. */
  2067. uint32_t
  2068. wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  2069. /**
  2070. * wlan_cfg_get_dma_rx_mon_dest_ring_size() - Rx MON dest ring size
  2071. * @cfg: Configuration Handle
  2072. *
  2073. * Return: Size of Rx MON dest ring size
  2074. */
  2075. int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  2076. /**
  2077. * wlan_cfg_get_dma_tx_mon_dest_ring_size() - Tx MON dest ring size
  2078. * @cfg: Configuration Handle
  2079. *
  2080. * Return: Size of Tx MON dest ring size
  2081. */
  2082. int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  2083. /**
  2084. * wlan_cfg_get_rx_rel_ring_id() - get wbm2sw ring id for Rx release ring
  2085. * @cfg: Configuration Handle
  2086. *
  2087. * Return: wbm2sw ring id
  2088. */
  2089. uint8_t
  2090. wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  2091. /**
  2092. * wlan_cfg_set_rx_rel_ring_id() - set wbm2sw ring id for Rx release ring
  2093. * @cfg: soc configuration context
  2094. * @wbm2sw_ring_id: wbm2sw ring id
  2095. *
  2096. * Return: None
  2097. */
  2098. void
  2099. wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2100. uint8_t wbm2sw_ring_id);
  2101. /**
  2102. * wlan_cfg_set_vdev_stats_hw_offload_config() - Set hw vdev stats offload
  2103. * config
  2104. * @cfg: config context
  2105. * @value: value to be set
  2106. *
  2107. * Return: none
  2108. */
  2109. void
  2110. wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
  2111. bool value);
  2112. /**
  2113. * wlan_cfg_get_vdev_stats_hw_offload_config() - Get hw vdev stats offload
  2114. * config
  2115. * @cfg: config context
  2116. *
  2117. * Return: value of hw vdev stats config
  2118. */
  2119. bool
  2120. wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg);
  2121. /**
  2122. * wlan_cfg_get_vdev_stats_hw_offload_timer()- Get hw vdev stats timer duration
  2123. * @cfg: config context
  2124. *
  2125. * Return: value of hw vdev stats timer duration
  2126. */
  2127. int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg);
  2128. /**
  2129. * wlan_cfg_set_sawf_config() - Set SAWF config enable/disable
  2130. * @cfg: config context
  2131. * @value: value to be set
  2132. *
  2133. * Return: none
  2134. */
  2135. void
  2136. wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool value);
  2137. /**
  2138. * wlan_cfg_get_sawf_config() - Get SAWF config enable/disable
  2139. * @cfg: config context
  2140. *
  2141. * Return: true or false
  2142. */
  2143. bool
  2144. wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg);
  2145. /**
  2146. * wlan_cfg_set_sawf_stats_config() - Set SAWF stats config
  2147. * @cfg: config context
  2148. * @value: value to be set
  2149. *
  2150. * Return: void
  2151. */
  2152. void
  2153. wlan_cfg_set_sawf_stats_config(struct wlan_cfg_dp_soc_ctxt *cfg, uint8_t value);
  2154. /**
  2155. * wlan_cfg_get_sawf_stats_config() - Get SAWF stats config
  2156. * @cfg: config context
  2157. *
  2158. * Return: value for sawf_stats_config
  2159. */
  2160. uint8_t
  2161. wlan_cfg_get_sawf_stats_config(struct wlan_cfg_dp_soc_ctxt *cfg);
  2162. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  2163. /**
  2164. * wlan_cfg_mlo_rx_ring_map_get() - get rx ring map
  2165. * @cfg: soc configuration context
  2166. *
  2167. * Return: rx_ring_map
  2168. */
  2169. uint8_t
  2170. wlan_cfg_mlo_rx_ring_map_get(struct wlan_cfg_dp_soc_ctxt *cfg);
  2171. #endif
  2172. /**
  2173. * wlan_cfg_set_host2txmon_ring_mask() - Set host2txmon ring
  2174. * interrupt mask mapped to an interrupt context
  2175. * @cfg: Configuration Handle
  2176. * @context: interrupt context
  2177. * @mask: interrupt mask
  2178. *
  2179. * Return: None
  2180. */
  2181. void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2182. int context, int mask);
  2183. /**
  2184. * wlan_cfg_get_host2txmon_ring_mask() - Return host2txmon ring
  2185. * interrupt mask mapped to an interrupt context
  2186. * @cfg: Configuration Handle
  2187. * @context: Numerical ID identifying the Interrupt/NAPI context
  2188. *
  2189. * Return: int_host2txmon_ring_mask[context]
  2190. */
  2191. int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2192. int context);
  2193. /**
  2194. * wlan_cfg_set_txmon_hw_support () - Set txmon hw support
  2195. * @cfg: Configuration Handle
  2196. * @txmon_hw_support: value to set
  2197. *
  2198. * Return: None
  2199. */
  2200. void wlan_cfg_set_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg,
  2201. bool txmon_hw_support);
  2202. /**
  2203. * wlan_cfg_get_txmon_hw_support () - Get txmon hw support
  2204. * @cfg: Configuration Handle
  2205. *
  2206. * Return: txmon_hw_support
  2207. */
  2208. bool wlan_cfg_get_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg);
  2209. void wlan_cfg_set_txmon_sw_peer_filtering(struct wlan_cfg_dp_soc_ctxt *cfg,
  2210. bool txmon_sw_peer_filtering);
  2211. bool wlan_cfg_get_txmon_sw_peer_filtering(struct wlan_cfg_dp_soc_ctxt *cfg);
  2212. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  2213. /**
  2214. * wlan_cfg_get_tx_capt_max_mem - Get max memory allowed for TX capture feature
  2215. * @cfg: Configuration Handle
  2216. *
  2217. * Return: user given size in bytes
  2218. */
  2219. static inline int
  2220. wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg)
  2221. {
  2222. return cfg->tx_capt_max_mem_allowed;
  2223. }
  2224. #endif /* WLAN_TX_PKT_CAPTURE_ENH */
  2225. /**
  2226. * wlan_cfg_get_napi_scale_factor() - Get napi scale factor
  2227. * @cfg: soc configuration context
  2228. *
  2229. * Return: napi scale factor
  2230. */
  2231. uint8_t wlan_cfg_get_napi_scale_factor(struct wlan_cfg_dp_soc_ctxt *cfg);
  2232. /**
  2233. * wlan_cfg_soc_update_tgt_params() - Update band specific params
  2234. * @wlan_cfg_ctx: SOC cfg context
  2235. * @ctrl_obj: PSOC object
  2236. *
  2237. * Return: void
  2238. */
  2239. void
  2240. wlan_cfg_soc_update_tgt_params(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  2241. struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  2242. #endif /*__WLAN_CFG_H*/