wlan_cfg.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /*
  2. * Copyright (c) 2013-2016 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. /**
  59. * wlan_cfg_get_num_contexts() Number of interrupt contexts to be registered
  60. * @wlan_cfg_ctx - Configuration Handle
  61. *
  62. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  63. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  64. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  65. * that are processed by the handler.
  66. *
  67. * Return: num_contexts
  68. */
  69. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  70. /**
  71. * wlan_cfg_get_intr_tx_ring_mask() - Return Tx interrupt mask mapped to an
  72. * interrupt context
  73. * @wlan_cfg_ctx - Configuration Handle
  74. * @context - Numerical ID identifying the Interrupt/NAPI context
  75. *
  76. * Return: int_tx_ring_mask[context]
  77. */
  78. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  79. int context);
  80. /**
  81. * wlan_cfg_get_intr_rx_ring_mask() - Return Rx interrupt mask mapped to an
  82. * interrupt context
  83. * @wlan_cfg_ctx - Configuration Handle
  84. * @context - Numerical ID identifying the Interrupt/NAPI context
  85. *
  86. * Return: int_rx_ring_mask[context]
  87. */
  88. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  89. int context);
  90. /**
  91. * wlan_cfg_get_intr_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  92. * mapped to an interrupt context
  93. * @wlan_cfg_ctx - Configuration Handle
  94. * @context - Numerical ID identifying the Interrupt/NAPI context
  95. *
  96. * Return: int_rx_mon_ring_mask[context]
  97. */
  98. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  99. int context);
  100. /**
  101. * wlan_cfg_get_intr_ce_ring_mask() - Return CE ring interrupt mask
  102. * mapped to an interrupt context
  103. * @wlan_cfg_ctx - Configuration Handle
  104. * @context - Numerical ID identifying the Interrupt/NAPI context
  105. *
  106. * Return: int_ce_ring_mask[context]
  107. */
  108. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  109. int context);
  110. /**
  111. * wlan_cfg_get_num_tx_pools() - Return Number of Tx Descriptor pools for SoC
  112. * @wlan_cfg_ctx - Configuration Handle
  113. *
  114. * Return: num_tx_pools
  115. */
  116. int wlan_cfg_get_num_tx_pools(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  117. /**
  118. * wlan_cfg_get_max_clients() Return maximum number of peers/stations supported
  119. * by device
  120. * @wlan_cfg_ctx - Configuration Handle
  121. *
  122. * Return: max_clients
  123. */
  124. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  125. /**
  126. * wlan_cfg_max_alloc_size() Return Maximum allocation size for any dynamic
  127. * memory allocation request for this device
  128. * @wlan_cfg_ctx - Configuration Handle
  129. *
  130. * Return: max_alloc_size
  131. */
  132. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  133. /*
  134. * wlan_cfg_per_pdev_tx_ring() Return true if Tx rings are mapped as
  135. * one per radio
  136. * @wlan_cfg_ctx - Configuration Handle
  137. *
  138. * Return: per_pdev_tx_ring
  139. */
  140. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  141. /*
  142. * wlan_cfg_num_tcl_data_rings() Number of TCL Data rings supported by device
  143. * @wlan_cfg_ctx
  144. *
  145. * Return: num_tcl_data_rings
  146. */
  147. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  148. /*
  149. * wlan_cfg_per_pdev_rx_ring() Return true if Rx rings are mapped as
  150. * one per radio
  151. * @wlan_cfg_ctx
  152. *
  153. * Return: per_pdev_rx_ring
  154. */
  155. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  156. /*
  157. * wlan_cfg_num_reo_dest_rings() Number of REO Data rings supported by device
  158. * @wlan_cfg_ctx - Configuration Handle
  159. *
  160. * Return: num_reo_dest_rings
  161. */
  162. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  163. /*
  164. * wlan_cfg_pkt_type() Default 802.11 encapsulation type
  165. * @wlan_cfg_ctx - Configuration Handle
  166. *
  167. * Return: htt_pkt_type_ethernet
  168. */
  169. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  170. /*
  171. * wlan_cfg_get_num_tx_desc_pool() Number of Tx Descriptor pools for the device
  172. * @wlan_cfg_ctx - Configuration Handle
  173. *
  174. * Return: num_tx_desc_pool
  175. */
  176. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  177. /*
  178. * wlan_cfg_get_num_tx_ext_desc_pool Number of Tx MSDU ext Descriptor pools
  179. * @wlan_cfg_ctx - Configuration Handle
  180. *
  181. * Return: num_tx_ext_desc_pool
  182. */
  183. int wlan_cfg_get_num_tx_ext_desc_pool(
  184. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  185. /*
  186. * wlan_cfg_get_num_tx_desc Number of Tx Descriptors per pool
  187. * @wlan_cfg_ctx - Configuration Handle
  188. *
  189. * Return: num_tx_desc
  190. */
  191. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  192. /*
  193. * wlan_cfg_get_num_tx_ext_desc Number of Tx MSDU extension Descriptors per pool
  194. * @wlan_cfg_ctx - Configuration Handle
  195. *
  196. * Return: num_tx_ext_desc
  197. */
  198. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  199. /*
  200. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  201. * @wlan_cfg_pdev_ctx
  202. *
  203. * Return: dma_mon_buf_ring_size
  204. */
  205. int wlan_cfg_get_dma_mon_buf_ring_size(
  206. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  207. /*
  208. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  209. * Destination ring
  210. * @wlan_cfg_pdev_ctx
  211. *
  212. * Return: dma_mon_dest_size
  213. */
  214. int wlan_cfg_get_dma_mon_dest_ring_size(
  215. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  216. /*
  217. * wlan_cfg_get_dma_mon_stat_ring_size - Return size of Monitor Status ring
  218. * @wlan_cfg_pdev_ctx
  219. *
  220. * Return: dma_mon_stat_ring_size
  221. */
  222. int wlan_cfg_get_dma_mon_stat_ring_size(
  223. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  224. /*
  225. * wlan_cfg_get_rx_dma_buf_ring_size - Return Size of RxDMA buffer ring
  226. * @wlan_cfg_pdev_ctx
  227. *
  228. * Return: rx_dma_buf_ring_size
  229. */
  230. int wlan_cfg_get_rx_dma_buf_ring_size(
  231. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  232. #endif