wlan_cfg.h 58 KB

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