wlan_cfg.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  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 rx_hash;
  156. bool tso_enabled;
  157. bool lro_enabled;
  158. bool sg_enabled;
  159. bool gro_enabled;
  160. bool ol_tx_csum_enabled;
  161. bool ol_rx_csum_enabled;
  162. bool rawmode_enabled;
  163. bool peer_flow_ctrl_enabled;
  164. bool napi_enabled;
  165. bool tcp_udp_checksumoffload;
  166. bool defrag_timeout_check;
  167. int nss_cfg;
  168. uint32_t tx_flow_stop_queue_threshold;
  169. uint32_t tx_flow_start_queue_offset;
  170. int rx_defrag_min_timeout;
  171. int reo_dst_ring_size;
  172. int wbm_release_ring;
  173. int tcl_cmd_ring;
  174. int tcl_status_ring;
  175. int reo_reinject_ring;
  176. int rx_release_ring;
  177. int reo_exception_ring;
  178. int reo_cmd_ring;
  179. int reo_status_ring;
  180. int rxdma_refill_ring;
  181. int rxdma_err_dst_ring;
  182. bool raw_mode_war;
  183. bool enable_data_stall_detection;
  184. bool disable_intra_bss_fwd;
  185. };
  186. /**
  187. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  188. * @ctrl_obj - PSOC object
  189. *
  190. * Allocates context for Soc configuration parameters,
  191. * Read configuration information from device tree/ini file and
  192. * returns back handle
  193. *
  194. * Return: Handle to configuration context
  195. */
  196. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj);
  197. /**
  198. * wlan_cfg_soc_detach() - Detach soc configuration handle
  199. * @wlan_cfg_ctx: soc configuration handle
  200. *
  201. * De-allocates memory allocated for SoC configuration
  202. *
  203. * Return:none
  204. */
  205. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  206. /**
  207. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  208. * @ctrl_obj - PSOC object
  209. *
  210. * Allocates context for pdev configuration parameters,
  211. * Read configuration information from device tree/ini file and
  212. * returns back handle
  213. *
  214. * Return: Handle to configuration context
  215. */
  216. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj);
  217. /**
  218. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  219. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  220. *
  221. * Return: void
  222. */
  223. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  224. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  225. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  226. int context, int mask);
  227. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  228. int context, int mask);
  229. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  230. int context, int mask);
  231. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  232. int context, int mask);
  233. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  234. int mask);
  235. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  236. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  237. int context, int mask);
  238. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  239. int context, int mask);
  240. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  241. int context, int mask);
  242. /**
  243. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  244. * @wlan_cfg_ctx - Configuration Handle
  245. *
  246. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  247. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  248. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  249. * that are processed by the handler.
  250. *
  251. * Return: num_contexts
  252. */
  253. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  254. /**
  255. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  256. * interrupt context
  257. * @wlan_cfg_ctx - Configuration Handle
  258. * @context - Numerical ID identifying the Interrupt/NAPI context
  259. *
  260. * Return: int_tx_ring_mask[context]
  261. */
  262. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  263. int context);
  264. /**
  265. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  266. * interrupt context
  267. * @wlan_cfg_ctx - Configuration Handle
  268. * @context - Numerical ID identifying the Interrupt/NAPI context
  269. *
  270. * Return: int_rx_ring_mask[context]
  271. */
  272. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  273. int context);
  274. /**
  275. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  276. * mapped to an interrupt context
  277. * @wlan_cfg_ctx - Configuration Handle
  278. * @context - Numerical ID identifying the Interrupt/NAPI context
  279. *
  280. * Return: int_rx_mon_ring_mask[context]
  281. */
  282. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  283. int context);
  284. /**
  285. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  286. * for the given interrupt context
  287. * @wlan_cfg_ctx - Configuration Handle
  288. * @context - Numerical ID identifying the Interrupt/NAPI context
  289. *
  290. */
  291. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  292. int context, int mask);
  293. /**
  294. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  295. * mapped to an interrupt context
  296. * @wlan_cfg_ctx - Configuration Handle
  297. * @context - Numerical ID identifying the Interrupt/NAPI context
  298. *
  299. * Return: int_rxdma2host_ring_mask[context]
  300. */
  301. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  302. int context);
  303. /**
  304. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  305. * for the given interrupt context
  306. * @wlan_cfg_ctx - Configuration Handle
  307. * @context - Numerical ID identifying the Interrupt/NAPI context
  308. *
  309. */
  310. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  311. int context, int mask);
  312. /**
  313. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  314. * mapped to an interrupt context
  315. * @wlan_cfg_ctx - Configuration Handle
  316. * @context - Numerical ID identifying the Interrupt/NAPI context
  317. *
  318. * Return: int_host2rxdma_ring_mask[context]
  319. */
  320. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  321. int context);
  322. /**
  323. * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
  324. *
  325. * @wlan_cfg_ctx - Configuration Handle
  326. * @pdev_idx - Index of SW PDEV
  327. * @hw_macid - HW MAC Id
  328. *
  329. */
  330. void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  331. int hw_macid);
  332. /**
  333. * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
  334. *
  335. * @wlan_cfg_ctx - Configuration Handle
  336. * @pdev_idx - Index of SW PDEV
  337. *
  338. * Return: HW MAC Id
  339. */
  340. int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  341. /**
  342. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  343. * PDEV index
  344. *
  345. * @wlan_cfg_ctx - Configuration Handle
  346. * @pdev_idx - Index of SW PDEV
  347. *
  348. * Return: HW MAC index
  349. */
  350. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  351. /**
  352. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  353. * mapped to an interrupt context
  354. * @wlan_cfg_ctx - Configuration Handle
  355. * @context - Numerical ID identifying the Interrupt/NAPI context
  356. *
  357. * Return: int_rx_err_ring_mask[context]
  358. */
  359. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  360. context);
  361. /**
  362. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  363. * mapped to an interrupt context
  364. * @wlan_cfg_ctx - Configuration Handle
  365. * @context - Numerical ID identifying the Interrupt/NAPI context
  366. *
  367. * Return: int_wbm_rel_ring_mask[context]
  368. */
  369. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  370. context);
  371. /**
  372. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  373. * mapped to an interrupt context
  374. * @wlan_cfg_ctx - Configuration Handle
  375. * @context - Numerical ID identifying the Interrupt/NAPI context
  376. *
  377. * Return: int_reo_status_ring_mask[context]
  378. */
  379. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  380. context);
  381. /**
  382. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  383. * mapped to an interrupt context
  384. * @wlan_cfg_ctx - Configuration Handle
  385. * @context - Numerical ID identifying the Interrupt/NAPI context
  386. *
  387. * Return: int_ce_ring_mask[context]
  388. */
  389. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  390. int context);
  391. /**
  392. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  393. * supported by device
  394. * @wlan_cfg_ctx - Configuration Handle
  395. *
  396. * Return: max_clients
  397. */
  398. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  399. /**
  400. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  401. * memory allocation request for this device
  402. * @wlan_cfg_ctx - Configuration Handle
  403. *
  404. * Return: max_alloc_size
  405. */
  406. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  407. /*
  408. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  409. * one per radio
  410. * @wlan_cfg_ctx - Configuration Handle
  411. *
  412. * Return: per_pdev_tx_ring
  413. */
  414. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  415. /*
  416. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  417. * @wlan_cfg_ctx
  418. *
  419. * Return: num_tcl_data_rings
  420. */
  421. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  422. /*
  423. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  424. * one per radio
  425. * @wlan_cfg_ctx
  426. *
  427. * Return: per_pdev_rx_ring
  428. */
  429. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  430. /*
  431. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  432. * one per radio
  433. * @wlan_cfg_ctx
  434. *
  435. * Return: return 1 if per pdev error ring else 0
  436. */
  437. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  438. /*
  439. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  440. * @wlan_cfg_ctx - Configuration Handle
  441. *
  442. * Return: num_reo_dest_rings
  443. */
  444. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  445. /*
  446. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  447. * @wlan_cfg_ctx - Configuration Handle
  448. *
  449. * Return: htt_pkt_type_ethernet
  450. */
  451. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  452. /*
  453. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  454. * device
  455. * @wlan_cfg_ctx - Configuration Handle
  456. *
  457. * Return: num_tx_desc_pool
  458. */
  459. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  460. /*
  461. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  462. * device
  463. * @wlan_cfg_ctx - Configuration Handle
  464. * @num_pool - Number of pool
  465. */
  466. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  467. /*
  468. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  469. * pools
  470. * @wlan_cfg_ctx - Configuration Handle
  471. *
  472. * Return: num_tx_ext_desc_pool
  473. */
  474. int wlan_cfg_get_num_tx_ext_desc_pool(
  475. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  476. /*
  477. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  478. *
  479. * @wlan_cfg_ctx - Configuration Handle
  480. *
  481. * Return: reo_dst_ring_size
  482. */
  483. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  484. /*
  485. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  486. *
  487. * @wlan_cfg_ctx - Configuration Handle
  488. * @reo_dst_ring_size - REO Destination ring size
  489. */
  490. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  491. int reo_dst_ring_size);
  492. /*
  493. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  494. *
  495. * @wlan_cfg_ctx - Configuration Handle
  496. * @raw_mode_war - raw mode war configuration
  497. */
  498. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  499. bool raw_mode_war);
  500. /*
  501. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  502. *
  503. * @wlan_cfg_ctx - Configuration Handle
  504. *
  505. * Return: reo_dst_ring_size
  506. */
  507. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  508. /*
  509. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  510. * pools
  511. * @wlan_cfg_ctx - Configuration Handle
  512. * @num_pool - Number of pool
  513. */
  514. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  515. /*
  516. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  517. * @wlan_cfg_ctx - Configuration Handle
  518. *
  519. * Return: num_tx_desc
  520. */
  521. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  522. /*
  523. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  524. *
  525. * @wlan_cfg_ctx - Configuration Handle
  526. * @num_desc: Number of descriptor
  527. */
  528. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  529. /*
  530. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  531. * per pool
  532. * @wlan_cfg_ctx - Configuration Handle
  533. *
  534. * Return: num_tx_ext_desc
  535. */
  536. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  537. /*
  538. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  539. * per pool
  540. * @wlan_cfg_ctx - Configuration Handle
  541. * @num_desc: Number of descriptor
  542. */
  543. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  544. /*
  545. * wlan_cfg_max_peer_id() - Get maximum peer ID
  546. * @cfg: Configuration Handle
  547. *
  548. * Return: maximum peer ID
  549. */
  550. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  551. /*
  552. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  553. * @wlan_cfg_pdev_ctx
  554. *
  555. * Return: dma_mon_buf_ring_size
  556. */
  557. int wlan_cfg_get_dma_mon_buf_ring_size(
  558. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  559. /*
  560. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  561. * Destination ring
  562. * @wlan_cfg_pdev_ctx
  563. *
  564. * Return: dma_mon_dest_size
  565. */
  566. int wlan_cfg_get_dma_mon_dest_ring_size(
  567. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  568. /*
  569. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  570. * @wlan_cfg_pdev_ctx
  571. *
  572. * Return: dma_mon_stat_ring_size
  573. */
  574. int wlan_cfg_get_dma_mon_stat_ring_size(
  575. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  576. /*
  577. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  578. * @wlan_cfg_soc_ctx
  579. *
  580. * Return: rxdma monitor desc ring size
  581. */
  582. int
  583. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  584. /*
  585. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  586. * @wlan_cfg_pdev_ctx
  587. *
  588. * Return: rx_dma_buf_ring_size
  589. */
  590. int wlan_cfg_get_rx_dma_buf_ring_size(
  591. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  592. /*
  593. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  594. * per pdev
  595. * @wlan_cfg_pdev_ctx
  596. *
  597. * Return: number of mac DMA rings per pdev
  598. */
  599. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  600. /*
  601. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  602. * @wlan_cfg_pdev_ctx
  603. *
  604. * Return: true - LRO enabled false - LRO disabled
  605. */
  606. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  607. /*
  608. * wlan_cfg_is_lro_enabled - Return RX hash enabled/disabled
  609. * @wlan_cfg_pdev_ctx
  610. *
  611. * Return: true - enabled false - disabled
  612. */
  613. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  614. /*
  615. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  616. * @wlan_cfg_soc_ctx
  617. * @rx_hash
  618. */
  619. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  620. /*
  621. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  622. * @wlan_cfg_pdev_ctx
  623. *
  624. * Return: 1 - enabled 0 - disabled
  625. */
  626. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  627. /*
  628. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  629. * @wlan_cfg_pdev_ctx
  630. */
  631. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  632. /*
  633. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  634. * @wlan_cfg_pdev_ctx
  635. *
  636. * Return: nss_cfg
  637. */
  638. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  639. /*
  640. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  641. * @wlan_cfg_pdev_ctx
  642. *
  643. */
  644. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  645. /*
  646. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  647. * @wlan_cfg_soc_ctx
  648. *
  649. * Return: Batch threshold
  650. */
  651. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  652. /*
  653. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  654. * @wlan_cfg_soc_ctx
  655. *
  656. * Return: Timer threshold
  657. */
  658. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  659. /*
  660. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  661. * @wlan_cfg_soc_ctx
  662. *
  663. * Return: Batch threshold
  664. */
  665. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  666. /*
  667. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  668. * @wlan_cfg_soc_ctx
  669. *
  670. * Return: Timer threshold
  671. */
  672. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  673. /*
  674. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  675. * @wlan_cfg_soc_ctx
  676. *
  677. * Return: Batch threshold
  678. */
  679. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  680. /*
  681. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  682. * @wlan_cfg_soc_ctx
  683. *
  684. * Return: Timer threshold
  685. */
  686. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  687. /*
  688. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  689. * @wlan_cfg_soc_ctx
  690. *
  691. * Return: Checksum offload enable or disable
  692. */
  693. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  694. /*
  695. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  696. * @wlan_cfg_soc_ctx
  697. *
  698. * Return: Tx Ring Size
  699. */
  700. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  701. /*
  702. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  703. * @wlan_cfg_soc_ctx
  704. *
  705. * Return: Tx Completion ring size
  706. */
  707. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  708. /*
  709. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  710. * @wlan_cfg_soc_ctx
  711. *
  712. * Return: wbm_release_ring size
  713. */
  714. int
  715. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  716. /*
  717. * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
  718. * @wlan_cfg_soc_ctx
  719. *
  720. * Return: tcl_cmd_ring size
  721. */
  722. int
  723. wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  724. /*
  725. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  726. * @wlan_cfg_soc_ctx
  727. *
  728. * Return: tcl_status_ring size
  729. */
  730. int
  731. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  732. /*
  733. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  734. * @wlan_cfg_soc_ctx
  735. *
  736. * Return: reo_reinject_ring size
  737. */
  738. int
  739. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  740. /*
  741. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  742. * @wlan_cfg_soc_ctx
  743. *
  744. * Return: rx_release_ring size
  745. */
  746. int
  747. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  748. /*
  749. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  750. * @wlan_cfg_soc_ctx
  751. *
  752. * Return: reo_exception_ring size
  753. */
  754. int
  755. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  756. /*
  757. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  758. * @wlan_cfg_soc_ctx
  759. *
  760. * Return: reo_cmd_ring size
  761. */
  762. int
  763. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  764. /*
  765. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  766. * @wlan_cfg_soc_ctx
  767. *
  768. * Return: reo_status_ring size
  769. */
  770. int
  771. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  772. /*
  773. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  774. * @wlan_cfg_soc_ctx
  775. *
  776. * Return: rxdma refill ring size
  777. */
  778. int
  779. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  780. /*
  781. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  782. * @wlan_cfg_soc_ctx
  783. *
  784. * Return: rxdma error dst ring size
  785. */
  786. int
  787. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  788. /*
  789. * wlan_cfg_get_dp_caps - Get dp capablities
  790. * @wlan_cfg_soc_ctx
  791. * @dp_caps: enum for dp capablities
  792. *
  793. * Return: bool if a dp capabilities is enabled
  794. */
  795. bool
  796. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  797. enum cdp_capabilities dp_caps);
  798. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  799. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  800. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  801. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  802. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  803. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  804. #endif