wlan_psoc_mlme.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /*
  2. * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /**
  18. * DOC: Define PSOC MLME structure
  19. */
  20. #ifndef _WLAN_PSOC_MLME_H_
  21. #define _WLAN_PSOC_MLME_H_
  22. #include <wlan_ext_mlme_obj_types.h>
  23. #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
  24. #include <qdf_timer.h>
  25. #include <wlan_cm_bss_score_param.h>
  26. #ifdef FEATURE_VDEV_OPS_WAKELOCK
  27. #include <target_if_psoc_wake_lock.h>
  28. #endif
  29. /* Max RNR size given max vaps are 16 */
  30. #define MAX_RNR_SIZE (16 * 16 /* 11be compatible tbtt_info length */ \
  31. + 4 /* Neighbor AP info field length */ \
  32. + 2 /* RNR header bytes */)
  33. /**
  34. * struct wlan_6ghz_rnr_global_cache - 6 GHz RNR cache buffer per soc
  35. * @rnr_buf: RNR cache buffer
  36. * @rnr_cnt: Count of APs in cache
  37. * @rnr_size: Size of RNR cache (RNR IE)
  38. */
  39. struct wlan_6ghz_rnr_global_cache {
  40. char rnr_buf[MAX_RNR_SIZE];
  41. int rnr_cnt;
  42. uint16_t rnr_size;
  43. };
  44. /**
  45. * struct psoc_phy_config - psoc phy caps
  46. * @vdev_nss_24g: Number of NSS the device support in 2.4Ghz
  47. * @vdev_nss_5g: Number of NSS the device support in 5Ghz
  48. * @ht_cap: If dev is configured as HT capable
  49. * @vht_cap:If dev is configured as VHT capable
  50. * @he_cap: If dev is configured as HE capable
  51. * @eht_cap: If dev is configured as EHT capable
  52. * @vht_24G_cap:If dev is configured as VHT capable for 2.4Ghz
  53. * @beamformee_cap:If dev is configured as BF capable
  54. * @bw_above_20_5ghz: BW greater than 20Mhz supported for 5Ghz
  55. * @bw_above_20_24ghz: BW greater than 20Mhz supported for 2.4Ghz
  56. * @max_chan_switch_ie: If max channel switch IE is supported
  57. */
  58. struct psoc_phy_config {
  59. uint8_t vdev_nss_24g;
  60. uint8_t vdev_nss_5g;
  61. uint32_t ht_cap:1,
  62. vht_cap:1,
  63. he_cap:1,
  64. eht_cap:1,
  65. vht_24G_cap:1,
  66. beamformee_cap:1,
  67. bw_above_20_5ghz:1,
  68. bw_above_20_24ghz:1,
  69. max_chan_switch_ie:1;
  70. };
  71. /**
  72. * struct psoc_mlo_config - psoc mlo config
  73. * @reconfig_reassoc_en: If reassoc on ML reconfig AP addition is enabled
  74. */
  75. struct psoc_mlo_config {
  76. uint8_t reconfig_reassoc_en;
  77. };
  78. /**
  79. * struct psoc_config - psoc level configs
  80. * @score_config: BSS scoring related config
  81. * @phy_config: Psoc Phy config
  82. * @mlo_config: Psoc mlo config
  83. */
  84. struct psoc_config {
  85. struct scoring_cfg score_config;
  86. struct psoc_phy_config phy_config;
  87. struct psoc_mlo_config mlo_config;
  88. };
  89. #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
  90. /**
  91. * enum wlan_peer_tbl_trans_entry_flags - Peer table transition flags
  92. * @WLAN_PEER_TBL_TRANS_CREATE: Peer table modify due to create
  93. * @WLAN_PEER_TBL_TRANS_DESTROY: Peer table modify due to destroy
  94. * @WLAN_PEER_TBL_TRANS_CONNECT: Peer table modify during connect
  95. * @WLAN_PEER_TBL_TRANS_DISCONNECT: Peer table modify during disconnect
  96. * @WLAN_PEER_TBL_TRANS_ROAM: Peer table modify during roaming
  97. * @WLAN_PEER_TBL_TRANS_LINK_SWITCH: Peer table modify during link switch
  98. */
  99. enum wlan_peer_tbl_trans_entry_flags {
  100. WLAN_PEER_TBL_TRANS_CREATE = BIT(0),
  101. WLAN_PEER_TBL_TRANS_DESTROY = BIT(1),
  102. WLAN_PEER_TBL_TRANS_CONNECT = BIT(2),
  103. WLAN_PEER_TBL_TRANS_DISCONNECT = BIT(3),
  104. WLAN_PEER_TBL_TRANS_ROAM = BIT(4),
  105. WLAN_PEER_TBL_TRANS_LINK_SWITCH = BIT(5),
  106. };
  107. /**
  108. * struct wlan_peer_tbl_trans_entry - Peer transition history node
  109. * @node: Node of the entry
  110. * @ts: Timestamp of peer table modify
  111. * @vdev_id: Peer's vdev's ID
  112. * @opmode: Peer's VDEV opmode
  113. * @is_mlo: %true if peer's VDEV MLO else %false
  114. * @is_mlo_link: %true if peer's VDEV mlo link, else %false
  115. * @is_primary: %true if this peer is primary
  116. * @is_first_link: %true if this peer is the first link, else %false
  117. * @auth_status: Status of auth from FW roam sync
  118. * @num_roam_links: Count of roamed link from FW roam sync
  119. * @peer_addr: MAC address of peer
  120. * @peer_mld_addr: MLD address of peer
  121. * @peer_flags: Peer flags from enum wlan_peer_tbl_trans_entry_flags
  122. */
  123. struct wlan_peer_tbl_trans_entry {
  124. qdf_list_node_t node;
  125. qdf_time_t ts;
  126. uint8_t vdev_id;
  127. enum QDF_OPMODE opmode;
  128. uint8_t is_mlo:1,
  129. is_mlo_link:1,
  130. is_primary:1,
  131. is_first_link:1,
  132. auth_status:2,
  133. num_roam_links:2;
  134. struct qdf_mac_addr peer_addr;
  135. struct qdf_mac_addr peer_mld_addr;
  136. unsigned long peer_flags;
  137. };
  138. #endif
  139. /**
  140. * struct psoc_mlme_obj - PSoC MLME component object
  141. * @psoc: PSoC object
  142. * @ext_psoc_ptr: PSoC legacy pointer
  143. * @psoc_vdev_rt: PSoC Vdev response timer
  144. * @psoc_mlme_wakelock: Wakelock to prevent system going to suspend
  145. * @rnr_6ghz_cache: Cache of 6Ghz vap in RNR ie format
  146. * @rnr_6ghz_cache_legacy: Legacy (13TBTT) cache of 6Ghz vap in RNR ie format
  147. * @psoc_cfg: Psoc level configs
  148. * @peer_history_list: Peer table transition history
  149. */
  150. struct psoc_mlme_obj {
  151. struct wlan_objmgr_psoc *psoc;
  152. mlme_psoc_ext_t *ext_psoc_ptr;
  153. struct vdev_response_timer psoc_vdev_rt[WLAN_UMAC_PSOC_MAX_VDEVS];
  154. #ifdef FEATURE_VDEV_OPS_WAKELOCK
  155. struct psoc_mlme_wakelock psoc_mlme_wakelock;
  156. #endif
  157. struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache[WLAN_UMAC_MAX_PDEVS];
  158. struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache_legacy[WLAN_UMAC_MAX_PDEVS];
  159. struct psoc_config psoc_cfg;
  160. #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
  161. qdf_list_t peer_history_list;
  162. #endif
  163. };
  164. #endif