wlan_rnr.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Copyright (c) 2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _WLAN_RNR_H_
  17. #define _WLAN_RNR_H_
  18. #include <qdf_atomic.h>
  19. #include <wlan_objmgr_pdev_obj.h>
  20. /**
  21. * struct rnr_global_info - Global context for RNR
  22. * @vdev_lower_band_cnt: 5ghz/2ghz vdev count
  23. * @vdev_6ghz_band_cnt: 6ghz vdev count
  24. * @pdev_6ghz_ctx: 6Ghz pdev context
  25. */
  26. struct rnr_global_info {
  27. qdf_atomic_t vdev_lower_band_cnt;
  28. qdf_atomic_t vdev_6ghz_band_cnt;
  29. uint32_t rnr_mbss_idx_map;
  30. struct wlan_objmgr_pdev *pdev_6ghz_ctx;
  31. };
  32. /**
  33. * wlan_rnr_lower_band_vdev_inc - Atomic increment of
  34. * global lower band vdev counter
  35. *
  36. * API to increment global lower band vdev counter
  37. *
  38. * Return:void
  39. */
  40. void wlan_rnr_lower_band_vdev_inc(void);
  41. /**
  42. * wlan_rnr_lower_band_vdev_dec - Atomic decrement of
  43. * global lower band vdev counter
  44. *
  45. * API to decrement global lower band vdev counter
  46. *
  47. * Return:void
  48. */
  49. void wlan_rnr_lower_band_vdev_dec(void);
  50. /**
  51. * wlan_rnr_6ghz_vdev_inc - Atomic increment of
  52. * 6ghz vdev counter
  53. *
  54. * API to increment of 6Ghz vdev counter
  55. *
  56. * Return:void
  57. */
  58. void wlan_rnr_6ghz_vdev_inc(void);
  59. /**
  60. * wlan_rnr_6ghz_vdev_dec - Atomic decrement of
  61. * 6ghz vdev counter
  62. *
  63. * API to decrement of 6Ghz vdev counter
  64. *
  65. * Return:void
  66. */
  67. void wlan_rnr_6ghz_vdev_dec(void);
  68. /**
  69. * wlan_global_6ghz_pdev_set - Store 6Ghz pdev in
  70. * global context
  71. *
  72. * API to save 6Ghz pdev in global context for
  73. * faster access
  74. *
  75. * Return:void
  76. */
  77. void wlan_global_6ghz_pdev_set(struct wlan_objmgr_pdev *pdev);
  78. /**
  79. * wlan_global_6ghz_pdev_destroy - Delete 6Ghz pdev in
  80. * global context
  81. *
  82. * API to delete 6Ghz pdev in global context for
  83. * faster access
  84. *
  85. * Return:void
  86. */
  87. void wlan_global_6ghz_pdev_destroy(void);
  88. /**
  89. * wlan_lower_band_ap_cnt_get - Get lower band AP count
  90. *
  91. * API to get lower band vdev from global context for
  92. * faster access
  93. *
  94. * Return: int32_t
  95. */
  96. int32_t wlan_lower_band_ap_cnt_get(void);
  97. /**
  98. * wlan_rnr_init_cnt - Initialize counters for
  99. * 6Ghz vdev and lower band vdev
  100. *
  101. * API to initialize atomic counters used for 6Ghz vdev
  102. * and lower band vdev
  103. *
  104. * Return: void
  105. */
  106. void wlan_rnr_init_cnt(void);
  107. /**
  108. * wlan_gbl_6ghz_pdev_get - Retrieve 6Ghz pdev pointer
  109. *
  110. * API to get 6Ghz pdev pointer
  111. *
  112. * Return: struct wlan_objmgr_pdev
  113. */
  114. struct wlan_objmgr_pdev *wlan_gbl_6ghz_pdev_get(void);
  115. /**
  116. * wlan_rnr_set_bss_idx - Set bit corresponding to bss index
  117. *
  118. * API to set bss index bitmap for adding Non Tx APs
  119. * not included in Mbss IE in the RNR IE
  120. *
  121. * Return: void
  122. */
  123. void wlan_rnr_set_bss_idx(uint32_t bss_idx);
  124. /**
  125. * wlan_rnr_get_bss_idx - Get bit corresponding to bss index
  126. *
  127. * API to Get bss index bitmap for adding Non Tx APs
  128. * not included in Mbss IE in the RNR IE
  129. *
  130. * Return: void
  131. */
  132. uint32_t wlan_rnr_get_bss_idx(void);
  133. /**
  134. * wlan_rnr_clear_bss_idx - Clear bits corresponding to bss index map
  135. *
  136. * API to clear bss index bitmap for adding Non Tx APs
  137. * not included in Mbss IE in the RNR IE
  138. *
  139. * Return: void
  140. */
  141. void wlan_rnr_clear_bss_idx(void);
  142. #endif /* End of _WLAN_RNR_H_ */