wlan_cfg.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. /*
  2. * * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef __WLAN_CFG_H
  19. #define __WLAN_CFG_H
  20. /*
  21. * Temporary place holders. These should come either from target config
  22. * or platform configuration
  23. */
  24. #if defined(CONFIG_MCL)
  25. #define MAX_PDEV_CNT 1
  26. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  27. /*
  28. * This mask defines how many transmit frames account for 1 NAPI work unit
  29. * 0 means each tx completion is 1 unit
  30. */
  31. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  32. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  33. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF
  34. #define NUM_RXDMA_RINGS_PER_PDEV 2
  35. #else
  36. #define MAX_PDEV_CNT 3
  37. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  38. /*
  39. * This mask defines how many transmit frames account for 1 NAPI work unit
  40. * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
  41. */
  42. #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
  43. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  44. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF
  45. #define NUM_RXDMA_RINGS_PER_PDEV 1
  46. #endif
  47. /* Tx configuration */
  48. #define MAX_LINK_DESC_BANKS 8
  49. #define MAX_TXDESC_POOLS 4
  50. #define MAX_TCL_DATA_RINGS 4
  51. /* Rx configuration */
  52. #define MAX_RXDESC_POOLS 4
  53. #define MAX_REO_DEST_RINGS 4
  54. #define MAX_RX_MAC_RINGS 2
  55. /* DP process status */
  56. #ifdef CONFIG_MCL
  57. #define CONFIG_PROCESS_RX_STATUS 1
  58. #define CONFIG_PROCESS_TX_STATUS 1
  59. #else
  60. #define CONFIG_PROCESS_RX_STATUS 0
  61. #define CONFIG_PROCESS_TX_STATUS 0
  62. #endif
  63. /* Miscellaneous configuration */
  64. #define MAX_IDLE_SCATTER_BUFS 16
  65. #define DP_MAX_IRQ_PER_CONTEXT 12
  66. #define DP_MAX_INTERRUPT_CONTEXTS 8
  67. #define DP_MAX_INTERRUPT_CONTEXTS 8
  68. #define MAX_HTT_METADATA_LEN 32
  69. #define MAX_NUM_PEER_ID_PER_PEER 8
  70. #define DP_MAX_TIDS 17
  71. #define DP_NON_QOS_TID 16
  72. struct wlan_cfg_dp_pdev_ctxt;
  73. /**
  74. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  75. * @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP
  76. * @max_clients - Maximum number of peers/stations supported by device
  77. * @max_alloc_size - Maximum allocation size for any dynamic memory
  78. * allocation request for this device
  79. * @per_pdev_tx_ring - 0 - TCL ring is not mapped per radio
  80. * 1 - Each TCL ring is mapped to one radio/pdev
  81. * @num_tcl_data_rings - Number of TCL Data rings supported by device
  82. * @per_pdev_rx_ring - 0 - REO ring is not mapped per radio
  83. * 1 - Each REO ring is mapped to one radio/pdev
  84. * @num_tx_desc_pool - Number of Tx Descriptor pools
  85. * @num_tx_ext_desc_pool - Number of Tx MSDU extension Descriptor pools
  86. * @num_tx_desc - Number of Tx Descriptors per pool
  87. * @num_tx_ext_desc - Number of Tx MSDU extension Descriptors per pool
  88. * @max_peer_id - Maximum value of peer id that FW can assign for a client
  89. * @htt_packet_type - Default 802.11 encapsulation type for any VAP created
  90. * @int_tx_ring_mask - Bitmap of Tx interrupts mapped to each NAPI/Intr context
  91. * @int_rx_ring_mask - Bitmap of Rx interrupts mapped to each NAPI/Intr context
  92. * @int_rx_mon_ring_mask - Bitmap of Rx monitor ring interrupts mapped to each
  93. * NAPI/Intr context
  94. * @int_rx_err_ring_mask - Bitmap of Rx err ring interrupts mapped to each
  95. * NAPI/Intr context
  96. * @int_wbm_rel_ring_mask - Bitmap of wbm rel ring interrupts mapped to each
  97. * NAPI/Intr context
  98. * @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each
  99. * NAPI/Intr context
  100. * @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context
  101. * @lro_enabled - enable/disable lro feature
  102. * @rx_hash - Enable hash based steering of rx packets
  103. * @tso_enabled - enable/disable tso feature
  104. * @napi_enabled - enable/disable interrupt mode for reaping tx and rx packets
  105. * @tcp_Udp_Checksumoffload - enable/disable checksum offload
  106. * @nss_cfg - nss configuration
  107. * @rx_defrag_min_timeout - rx defrag minimum timeout
  108. * @wbm_release_ring - wbm release ring size
  109. * @tcl_cmd_ring - tcl cmd ring size
  110. * @tcl_status_ring - tcl status ring size
  111. * @reo_reinject_ring - reo reinject ring
  112. * @rx_release_ring - rx release ring size
  113. * @reo_exception_ring - reo exception ring size
  114. * @reo_cmd_ring - reo cmd ring size
  115. * @reo_status_ring - reo status ting size
  116. * @rxdma_refill_ring - rxdma refill ring size
  117. * @rxdma_err_dst_ring - rxdma error detination ring size
  118. * @raw_mode_war - enable/disable raw mode war
  119. */
  120. struct wlan_cfg_dp_soc_ctxt {
  121. int num_int_ctxts;
  122. int max_clients;
  123. int max_alloc_size;
  124. int per_pdev_tx_ring;
  125. int num_tcl_data_rings;
  126. int per_pdev_rx_ring;
  127. int per_pdev_lmac_ring;
  128. int num_reo_dest_rings;
  129. int num_tx_desc_pool;
  130. int num_tx_ext_desc_pool;
  131. int num_tx_desc;
  132. int num_tx_ext_desc;
  133. int max_peer_id;
  134. int htt_packet_type;
  135. int int_batch_threshold_tx;
  136. int int_timer_threshold_tx;
  137. int int_batch_threshold_rx;
  138. int int_timer_threshold_rx;
  139. int int_batch_threshold_other;
  140. int int_timer_threshold_other;
  141. int tx_ring_size;
  142. int tx_comp_ring_size;
  143. int tx_comp_ring_size_nss;
  144. int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  145. int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  146. int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  147. int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  148. int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  149. int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  150. int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  151. int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  152. int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  153. int hw_macid[MAX_PDEV_CNT];
  154. int base_hw_macid;
  155. bool lro_enabled;
  156. bool rx_hash;
  157. bool tso_enabled;
  158. bool napi_enabled;
  159. bool tcp_udp_checksumoffload;
  160. bool defrag_timeout_check;
  161. int nss_cfg;
  162. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  163. uint32_t tx_flow_stop_queue_threshold;
  164. uint32_t tx_flow_start_queue_offset;
  165. #endif
  166. int rx_defrag_min_timeout;
  167. int reo_dst_ring_size;
  168. int wbm_release_ring;
  169. int tcl_cmd_ring;
  170. int tcl_status_ring;
  171. int reo_reinject_ring;
  172. int rx_release_ring;
  173. int reo_exception_ring;
  174. int reo_cmd_ring;
  175. int reo_status_ring;
  176. int rxdma_refill_ring;
  177. int rxdma_err_dst_ring;
  178. bool raw_mode_war;
  179. };
  180. /**
  181. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  182. * @ctrl_obj - PSOC object
  183. *
  184. * Allocates context for Soc configuration parameters,
  185. * Read configuration information from device tree/ini file and
  186. * returns back handle
  187. *
  188. * Return: Handle to configuration context
  189. */
  190. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj);
  191. /**
  192. * wlan_cfg_soc_detach() - Detach soc configuration handle
  193. * @wlan_cfg_ctx: soc configuration handle
  194. *
  195. * De-allocates memory allocated for SoC configuration
  196. *
  197. * Return:none
  198. */
  199. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  200. /**
  201. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  202. * @ctrl_obj - PSOC object
  203. *
  204. * Allocates context for pdev configuration parameters,
  205. * Read configuration information from device tree/ini file and
  206. * returns back handle
  207. *
  208. * Return: Handle to configuration context
  209. */
  210. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj);
  211. /**
  212. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  213. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  214. *
  215. * Return: void
  216. */
  217. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  218. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  219. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  220. int context, int mask);
  221. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  222. int context, int mask);
  223. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  224. int context, int mask);
  225. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  226. int context, int mask);
  227. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  228. int mask);
  229. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  230. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  231. int context, int mask);
  232. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  233. int context, int mask);
  234. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  235. int context, int mask);
  236. /**
  237. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  238. * @wlan_cfg_ctx - Configuration Handle
  239. *
  240. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  241. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  242. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  243. * that are processed by the handler.
  244. *
  245. * Return: num_contexts
  246. */
  247. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  248. /**
  249. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  250. * interrupt context
  251. * @wlan_cfg_ctx - Configuration Handle
  252. * @context - Numerical ID identifying the Interrupt/NAPI context
  253. *
  254. * Return: int_tx_ring_mask[context]
  255. */
  256. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  257. int context);
  258. /**
  259. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  260. * interrupt context
  261. * @wlan_cfg_ctx - Configuration Handle
  262. * @context - Numerical ID identifying the Interrupt/NAPI context
  263. *
  264. * Return: int_rx_ring_mask[context]
  265. */
  266. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  267. int context);
  268. /**
  269. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  270. * mapped to an interrupt context
  271. * @wlan_cfg_ctx - Configuration Handle
  272. * @context - Numerical ID identifying the Interrupt/NAPI context
  273. *
  274. * Return: int_rx_mon_ring_mask[context]
  275. */
  276. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  277. int context);
  278. /**
  279. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  280. * for the given interrupt context
  281. * @wlan_cfg_ctx - Configuration Handle
  282. * @context - Numerical ID identifying the Interrupt/NAPI context
  283. *
  284. */
  285. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  286. int context, int mask);
  287. /**
  288. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  289. * mapped to an interrupt context
  290. * @wlan_cfg_ctx - Configuration Handle
  291. * @context - Numerical ID identifying the Interrupt/NAPI context
  292. *
  293. * Return: int_rxdma2host_ring_mask[context]
  294. */
  295. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  296. int context);
  297. /**
  298. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  299. * for the given interrupt context
  300. * @wlan_cfg_ctx - Configuration Handle
  301. * @context - Numerical ID identifying the Interrupt/NAPI context
  302. *
  303. */
  304. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  305. int context, int mask);
  306. /**
  307. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  308. * mapped to an interrupt context
  309. * @wlan_cfg_ctx - Configuration Handle
  310. * @context - Numerical ID identifying the Interrupt/NAPI context
  311. *
  312. * Return: int_host2rxdma_ring_mask[context]
  313. */
  314. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  315. int context);
  316. /**
  317. * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
  318. *
  319. * @wlan_cfg_ctx - Configuration Handle
  320. * @pdev_idx - Index of SW PDEV
  321. * @hw_macid - HW MAC Id
  322. *
  323. */
  324. void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  325. int hw_macid);
  326. /**
  327. * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
  328. *
  329. * @wlan_cfg_ctx - Configuration Handle
  330. * @pdev_idx - Index of SW PDEV
  331. *
  332. * Return: HW MAC Id
  333. */
  334. int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  335. /**
  336. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  337. * PDEV index
  338. *
  339. * @wlan_cfg_ctx - Configuration Handle
  340. * @pdev_idx - Index of SW PDEV
  341. *
  342. * Return: HW MAC index
  343. */
  344. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  345. /**
  346. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  347. * mapped to an interrupt context
  348. * @wlan_cfg_ctx - Configuration Handle
  349. * @context - Numerical ID identifying the Interrupt/NAPI context
  350. *
  351. * Return: int_rx_err_ring_mask[context]
  352. */
  353. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  354. context);
  355. /**
  356. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  357. * mapped to an interrupt context
  358. * @wlan_cfg_ctx - Configuration Handle
  359. * @context - Numerical ID identifying the Interrupt/NAPI context
  360. *
  361. * Return: int_wbm_rel_ring_mask[context]
  362. */
  363. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  364. context);
  365. /**
  366. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  367. * mapped to an interrupt context
  368. * @wlan_cfg_ctx - Configuration Handle
  369. * @context - Numerical ID identifying the Interrupt/NAPI context
  370. *
  371. * Return: int_reo_status_ring_mask[context]
  372. */
  373. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  374. context);
  375. /**
  376. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  377. * mapped to an interrupt context
  378. * @wlan_cfg_ctx - Configuration Handle
  379. * @context - Numerical ID identifying the Interrupt/NAPI context
  380. *
  381. * Return: int_ce_ring_mask[context]
  382. */
  383. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  384. int context);
  385. /**
  386. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  387. * supported by device
  388. * @wlan_cfg_ctx - Configuration Handle
  389. *
  390. * Return: max_clients
  391. */
  392. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  393. /**
  394. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  395. * memory allocation request for this device
  396. * @wlan_cfg_ctx - Configuration Handle
  397. *
  398. * Return: max_alloc_size
  399. */
  400. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  401. /*
  402. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  403. * one per radio
  404. * @wlan_cfg_ctx - Configuration Handle
  405. *
  406. * Return: per_pdev_tx_ring
  407. */
  408. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  409. /*
  410. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  411. * @wlan_cfg_ctx
  412. *
  413. * Return: num_tcl_data_rings
  414. */
  415. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  416. /*
  417. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  418. * one per radio
  419. * @wlan_cfg_ctx
  420. *
  421. * Return: per_pdev_rx_ring
  422. */
  423. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  424. /*
  425. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  426. * one per radio
  427. * @wlan_cfg_ctx
  428. *
  429. * Return: return 1 if per pdev error ring else 0
  430. */
  431. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  432. /*
  433. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  434. * @wlan_cfg_ctx - Configuration Handle
  435. *
  436. * Return: num_reo_dest_rings
  437. */
  438. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  439. /*
  440. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  441. * @wlan_cfg_ctx - Configuration Handle
  442. *
  443. * Return: htt_pkt_type_ethernet
  444. */
  445. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  446. /*
  447. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  448. * device
  449. * @wlan_cfg_ctx - Configuration Handle
  450. *
  451. * Return: num_tx_desc_pool
  452. */
  453. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  454. /*
  455. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  456. * device
  457. * @wlan_cfg_ctx - Configuration Handle
  458. * @num_pool - Number of pool
  459. */
  460. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  461. /*
  462. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  463. * pools
  464. * @wlan_cfg_ctx - Configuration Handle
  465. *
  466. * Return: num_tx_ext_desc_pool
  467. */
  468. int wlan_cfg_get_num_tx_ext_desc_pool(
  469. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  470. /*
  471. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  472. *
  473. * @wlan_cfg_ctx - Configuration Handle
  474. *
  475. * Return: reo_dst_ring_size
  476. */
  477. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  478. /*
  479. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  480. *
  481. * @wlan_cfg_ctx - Configuration Handle
  482. * @reo_dst_ring_size - REO Destination ring size
  483. */
  484. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  485. int reo_dst_ring_size);
  486. /*
  487. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  488. *
  489. * @wlan_cfg_ctx - Configuration Handle
  490. * @raw_mode_war - raw mode war configuration
  491. */
  492. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  493. bool raw_mode_war);
  494. /*
  495. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  496. *
  497. * @wlan_cfg_ctx - Configuration Handle
  498. *
  499. * Return: reo_dst_ring_size
  500. */
  501. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  502. /*
  503. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  504. * pools
  505. * @wlan_cfg_ctx - Configuration Handle
  506. * @num_pool - Number of pool
  507. */
  508. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  509. /*
  510. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  511. * @wlan_cfg_ctx - Configuration Handle
  512. *
  513. * Return: num_tx_desc
  514. */
  515. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  516. /*
  517. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  518. *
  519. * @wlan_cfg_ctx - Configuration Handle
  520. * @num_desc: Number of descriptor
  521. */
  522. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  523. /*
  524. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  525. * per pool
  526. * @wlan_cfg_ctx - Configuration Handle
  527. *
  528. * Return: num_tx_ext_desc
  529. */
  530. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  531. /*
  532. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  533. * per pool
  534. * @wlan_cfg_ctx - Configuration Handle
  535. * @num_desc: Number of descriptor
  536. */
  537. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  538. /*
  539. * wlan_cfg_max_peer_id() - Get maximum peer ID
  540. * @cfg: Configuration Handle
  541. *
  542. * Return: maximum peer ID
  543. */
  544. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  545. /*
  546. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  547. * @wlan_cfg_pdev_ctx
  548. *
  549. * Return: dma_mon_buf_ring_size
  550. */
  551. int wlan_cfg_get_dma_mon_buf_ring_size(
  552. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  553. /*
  554. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  555. * Destination ring
  556. * @wlan_cfg_pdev_ctx
  557. *
  558. * Return: dma_mon_dest_size
  559. */
  560. int wlan_cfg_get_dma_mon_dest_ring_size(
  561. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  562. /*
  563. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  564. * @wlan_cfg_pdev_ctx
  565. *
  566. * Return: dma_mon_stat_ring_size
  567. */
  568. int wlan_cfg_get_dma_mon_stat_ring_size(
  569. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  570. /*
  571. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  572. * @wlan_cfg_soc_ctx
  573. *
  574. * Return: rxdma monitor desc ring size
  575. */
  576. int
  577. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  578. /*
  579. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  580. * @wlan_cfg_pdev_ctx
  581. *
  582. * Return: rx_dma_buf_ring_size
  583. */
  584. int wlan_cfg_get_rx_dma_buf_ring_size(
  585. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  586. /*
  587. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  588. * per pdev
  589. * @wlan_cfg_pdev_ctx
  590. *
  591. * Return: number of mac DMA rings per pdev
  592. */
  593. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  594. /*
  595. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  596. * @wlan_cfg_pdev_ctx
  597. *
  598. * Return: true - LRO enabled false - LRO disabled
  599. */
  600. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  601. /*
  602. * wlan_cfg_is_lro_enabled - Return RX hash enabled/disabled
  603. * @wlan_cfg_pdev_ctx
  604. *
  605. * Return: true - enabled false - disabled
  606. */
  607. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  608. /*
  609. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  610. * @wlan_cfg_soc_ctx
  611. * @rx_hash
  612. */
  613. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  614. /*
  615. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  616. * @wlan_cfg_pdev_ctx
  617. *
  618. * Return: 1 - enabled 0 - disabled
  619. */
  620. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  621. /*
  622. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  623. * @wlan_cfg_pdev_ctx
  624. */
  625. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  626. /*
  627. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  628. * @wlan_cfg_pdev_ctx
  629. *
  630. * Return: nss_cfg
  631. */
  632. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  633. /*
  634. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  635. * @wlan_cfg_pdev_ctx
  636. *
  637. */
  638. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  639. /*
  640. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  641. * @wlan_cfg_soc_ctx
  642. *
  643. * Return: Batch threshold
  644. */
  645. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  646. /*
  647. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  648. * @wlan_cfg_soc_ctx
  649. *
  650. * Return: Timer threshold
  651. */
  652. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  653. /*
  654. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  655. * @wlan_cfg_soc_ctx
  656. *
  657. * Return: Batch threshold
  658. */
  659. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  660. /*
  661. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  662. * @wlan_cfg_soc_ctx
  663. *
  664. * Return: Timer threshold
  665. */
  666. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  667. /*
  668. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  669. * @wlan_cfg_soc_ctx
  670. *
  671. * Return: Batch threshold
  672. */
  673. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  674. /*
  675. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  676. * @wlan_cfg_soc_ctx
  677. *
  678. * Return: Timer threshold
  679. */
  680. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  681. /*
  682. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  683. * @wlan_cfg_soc_ctx
  684. *
  685. * Return: Checksum offload enable or disable
  686. */
  687. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  688. /*
  689. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  690. * @wlan_cfg_soc_ctx
  691. *
  692. * Return: Tx Ring Size
  693. */
  694. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  695. /*
  696. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  697. * @wlan_cfg_soc_ctx
  698. *
  699. * Return: Tx Completion ring size
  700. */
  701. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  702. /*
  703. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  704. * @wlan_cfg_soc_ctx
  705. *
  706. * Return: wbm_release_ring size
  707. */
  708. int
  709. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  710. /*
  711. * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
  712. * @wlan_cfg_soc_ctx
  713. *
  714. * Return: tcl_cmd_ring size
  715. */
  716. int
  717. wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  718. /*
  719. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  720. * @wlan_cfg_soc_ctx
  721. *
  722. * Return: tcl_status_ring size
  723. */
  724. int
  725. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  726. /*
  727. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  728. * @wlan_cfg_soc_ctx
  729. *
  730. * Return: reo_reinject_ring size
  731. */
  732. int
  733. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  734. /*
  735. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  736. * @wlan_cfg_soc_ctx
  737. *
  738. * Return: rx_release_ring size
  739. */
  740. int
  741. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  742. /*
  743. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  744. * @wlan_cfg_soc_ctx
  745. *
  746. * Return: reo_exception_ring size
  747. */
  748. int
  749. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  750. /*
  751. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  752. * @wlan_cfg_soc_ctx
  753. *
  754. * Return: reo_cmd_ring size
  755. */
  756. int
  757. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  758. /*
  759. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  760. * @wlan_cfg_soc_ctx
  761. *
  762. * Return: reo_status_ring size
  763. */
  764. int
  765. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  766. /*
  767. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  768. * @wlan_cfg_soc_ctx
  769. *
  770. * Return: rxdma refill ring size
  771. */
  772. int
  773. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  774. /*
  775. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  776. * @wlan_cfg_soc_ctx
  777. *
  778. * Return: rxdma error dst ring size
  779. */
  780. int
  781. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  782. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  783. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  784. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  785. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  786. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  787. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  788. #endif