wlan_cfg.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*
  2. * Copyright (c) 2013-2017 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. struct wlan_cfg_dp_pdev_ctxt;
  21. struct wlan_cfg_dp_soc_ctxt;
  22. /**
  23. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  24. *
  25. * Allocates context for Soc configuration parameters,
  26. * Read configuration information from device tree/ini file and
  27. * returns back handle
  28. *
  29. * Return: Handle to configuration context
  30. */
  31. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void);
  32. /**
  33. * wlan_cfg_soc_detach() - Detach soc configuration handle
  34. * @wlan_cfg_ctx: soc configuration handle
  35. *
  36. * De-allocates memory allocated for SoC configuration
  37. *
  38. * Return:none
  39. */
  40. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  41. /**
  42. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  43. *
  44. * Allocates context for pdev configuration parameters,
  45. * Read configuration information from device tree/ini file and
  46. * returns back handle
  47. *
  48. * Return: Handle to configuration context
  49. */
  50. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void);
  51. /**
  52. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  53. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  54. *
  55. * Return: void
  56. */
  57. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  58. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  59. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  60. int context, int mask);
  61. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  62. int context, int mask);
  63. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  64. int context, int mask);
  65. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  66. int context, int mask);
  67. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  68. int mask);
  69. /**
  70. * wlan_cfg_get_num_contexts() Number of interrupt contexts to be registered
  71. * @wlan_cfg_ctx - Configuration Handle
  72. *
  73. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  74. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  75. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  76. * that are processed by the handler.
  77. *
  78. * Return: num_contexts
  79. */
  80. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  81. /**
  82. * wlan_cfg_get_intr_tx_ring_mask() - Return Tx interrupt mask mapped to an
  83. * interrupt context
  84. * @wlan_cfg_ctx - Configuration Handle
  85. * @context - Numerical ID identifying the Interrupt/NAPI context
  86. *
  87. * Return: int_tx_ring_mask[context]
  88. */
  89. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  90. int context);
  91. /**
  92. * wlan_cfg_get_intr_rx_ring_mask() - Return Rx interrupt mask mapped to an
  93. * interrupt context
  94. * @wlan_cfg_ctx - Configuration Handle
  95. * @context - Numerical ID identifying the Interrupt/NAPI context
  96. *
  97. * Return: int_rx_ring_mask[context]
  98. */
  99. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  100. int context);
  101. /**
  102. * wlan_cfg_get_intr_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  103. * mapped to an interrupt context
  104. * @wlan_cfg_ctx - Configuration Handle
  105. * @context - Numerical ID identifying the Interrupt/NAPI context
  106. *
  107. * Return: int_rx_mon_ring_mask[context]
  108. */
  109. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  110. int context);
  111. /**
  112. * wlan_cfg_get_intr_ce_ring_mask() - Return CE ring interrupt mask
  113. * mapped to an interrupt context
  114. * @wlan_cfg_ctx - Configuration Handle
  115. * @context - Numerical ID identifying the Interrupt/NAPI context
  116. *
  117. * Return: int_ce_ring_mask[context]
  118. */
  119. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  120. int context);
  121. /**
  122. * wlan_cfg_get_num_tx_pools() - Return Number of Tx Descriptor pools for SoC
  123. * @wlan_cfg_ctx - Configuration Handle
  124. *
  125. * Return: num_tx_pools
  126. */
  127. int wlan_cfg_get_num_tx_pools(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  128. /**
  129. * wlan_cfg_get_max_clients() Return maximum number of peers/stations supported
  130. * by device
  131. * @wlan_cfg_ctx - Configuration Handle
  132. *
  133. * Return: max_clients
  134. */
  135. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  136. /**
  137. * wlan_cfg_max_alloc_size() Return Maximum allocation size for any dynamic
  138. * memory allocation request for this device
  139. * @wlan_cfg_ctx - Configuration Handle
  140. *
  141. * Return: max_alloc_size
  142. */
  143. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  144. /*
  145. * wlan_cfg_per_pdev_tx_ring() Return true if Tx rings are mapped as
  146. * one per radio
  147. * @wlan_cfg_ctx - Configuration Handle
  148. *
  149. * Return: per_pdev_tx_ring
  150. */
  151. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  152. /*
  153. * wlan_cfg_num_tcl_data_rings() Number of TCL Data rings supported by device
  154. * @wlan_cfg_ctx
  155. *
  156. * Return: num_tcl_data_rings
  157. */
  158. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  159. /*
  160. * wlan_cfg_per_pdev_rx_ring() Return true if Rx rings are mapped as
  161. * one per radio
  162. * @wlan_cfg_ctx
  163. *
  164. * Return: per_pdev_rx_ring
  165. */
  166. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  167. /*
  168. * wlan_cfg_num_reo_dest_rings() Number of REO Data rings supported by device
  169. * @wlan_cfg_ctx - Configuration Handle
  170. *
  171. * Return: num_reo_dest_rings
  172. */
  173. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  174. /*
  175. * wlan_cfg_pkt_type() Default 802.11 encapsulation type
  176. * @wlan_cfg_ctx - Configuration Handle
  177. *
  178. * Return: htt_pkt_type_ethernet
  179. */
  180. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  181. /*
  182. * wlan_cfg_get_num_tx_desc_pool() Number of Tx Descriptor pools for the device
  183. * @wlan_cfg_ctx - Configuration Handle
  184. *
  185. * Return: num_tx_desc_pool
  186. */
  187. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  188. /*
  189. * wlan_cfg_get_num_tx_ext_desc_pool Number of Tx MSDU ext Descriptor pools
  190. * @wlan_cfg_ctx - Configuration Handle
  191. *
  192. * Return: num_tx_ext_desc_pool
  193. */
  194. int wlan_cfg_get_num_tx_ext_desc_pool(
  195. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  196. /*
  197. * wlan_cfg_get_num_tx_desc Number of Tx Descriptors per pool
  198. * @wlan_cfg_ctx - Configuration Handle
  199. *
  200. * Return: num_tx_desc
  201. */
  202. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  203. /*
  204. * wlan_cfg_get_num_tx_ext_desc Number of Tx MSDU extension Descriptors per pool
  205. * @wlan_cfg_ctx - Configuration Handle
  206. *
  207. * Return: num_tx_ext_desc
  208. */
  209. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  210. /*
  211. * wlan_cfg_max_peer_id() - Get maximum peer ID
  212. * @cfg: Configuration Handle
  213. *
  214. * Return: maximum peer ID
  215. */
  216. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  217. /*
  218. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  219. * @wlan_cfg_pdev_ctx
  220. *
  221. * Return: dma_mon_buf_ring_size
  222. */
  223. int wlan_cfg_get_dma_mon_buf_ring_size(
  224. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  225. /*
  226. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  227. * Destination ring
  228. * @wlan_cfg_pdev_ctx
  229. *
  230. * Return: dma_mon_dest_size
  231. */
  232. int wlan_cfg_get_dma_mon_dest_ring_size(
  233. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  234. /*
  235. * wlan_cfg_get_dma_mon_stat_ring_size - Return size of Monitor Status ring
  236. * @wlan_cfg_pdev_ctx
  237. *
  238. * Return: dma_mon_stat_ring_size
  239. */
  240. int wlan_cfg_get_dma_mon_stat_ring_size(
  241. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  242. /*
  243. * wlan_cfg_get_rx_dma_buf_ring_size - Return Size of RxDMA buffer ring
  244. * @wlan_cfg_pdev_ctx
  245. *
  246. * Return: rx_dma_buf_ring_size
  247. */
  248. int wlan_cfg_get_rx_dma_buf_ring_size(
  249. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  250. #endif