xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/include/wlan_psoc_mlme.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 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 /**
19  * DOC: Define PSOC MLME structure
20  */
21 #ifndef _WLAN_PSOC_MLME_H_
22 #define _WLAN_PSOC_MLME_H_
23 
24 #include <wlan_ext_mlme_obj_types.h>
25 #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
26 #include <qdf_timer.h>
27 #include <wlan_cm_bss_score_param.h>
28 #ifdef FEATURE_VDEV_OPS_WAKELOCK
29 #include <target_if_psoc_wake_lock.h>
30 #endif
31 
32 /* Max RNR size given max vaps are 16 */
33 #define MAX_RNR_SIZE (16 * 16 /* 11be compatible tbtt_info length */ \
34 			+ 4   /* Neighbor AP info field length */    \
35 			+ 2   /* RNR header bytes */)
36 
37 /**
38  * struct wlan_6ghz_rnr_global_cache - 6 GHz RNR cache buffer per soc
39  * @rnr_buf: RNR cache buffer
40  * @rnr_cnt: Count of APs in cache
41  * @rnr_size: Size of RNR cache (RNR IE)
42  */
43 struct wlan_6ghz_rnr_global_cache {
44 	char rnr_buf[MAX_RNR_SIZE];
45 	int rnr_cnt;
46 	uint16_t rnr_size;
47 };
48 
49 /**
50  * struct psoc_phy_config - psoc phy caps
51  * @vdev_nss_24g: Number of NSS the device support in 2.4Ghz
52  * @vdev_nss_5g: Number of NSS the device support in 5Ghz
53  * @ht_cap: If dev is configured as HT capable
54  * @vht_cap:If dev is configured as VHT capable
55  * @he_cap: If dev is configured as HE capable
56  * @eht_cap: If dev is configured as EHT capable
57  * @vht_24G_cap:If dev is configured as VHT capable for 2.4Ghz
58  * @beamformee_cap:If dev is configured as BF capable
59  * @bw_above_20_5ghz: BW greater than 20Mhz supported for 5Ghz
60  * @bw_above_20_24ghz: BW greater than 20Mhz supported for 2.4Ghz
61  * @max_chan_switch_ie: If max channel switch IE is supported
62  */
63 struct psoc_phy_config {
64 	uint8_t vdev_nss_24g;
65 	uint8_t vdev_nss_5g;
66 	uint32_t ht_cap:1,
67 		 vht_cap:1,
68 		 he_cap:1,
69 		 eht_cap:1,
70 		 vht_24G_cap:1,
71 		 beamformee_cap:1,
72 		 bw_above_20_5ghz:1,
73 		 bw_above_20_24ghz:1,
74 		 max_chan_switch_ie:1;
75 };
76 
77 /**
78  * struct psoc_mlo_config - psoc mlo config
79  * @reconfig_reassoc_en: If reassoc on ML reconfig AP addition is enabled
80  */
81 struct psoc_mlo_config {
82 	uint8_t reconfig_reassoc_en;
83 };
84 
85 /**
86  * struct psoc_config - psoc level configs
87  * @score_config:          BSS scoring related config
88  * @phy_config:            Psoc Phy config
89  * @mlo_config:            Psoc mlo config
90  */
91 struct psoc_config {
92 	struct scoring_cfg score_config;
93 	struct psoc_phy_config phy_config;
94 	struct psoc_mlo_config mlo_config;
95 };
96 
97 /**
98  * struct psoc_mlme_obj -  PSoC MLME component object
99  * @psoc:                  PSoC object
100  * @ext_psoc_ptr:          PSoC legacy pointer
101  * @psoc_vdev_rt:          PSoC Vdev response timer
102  * @psoc_mlme_wakelock:    Wakelock to prevent system going to suspend
103  * @rnr_6ghz_cache:        Cache of 6Ghz vap in RNR ie format
104  * @psoc_cfg:              Psoc level configs
105  */
106 struct psoc_mlme_obj {
107 	struct wlan_objmgr_psoc *psoc;
108 	mlme_psoc_ext_t *ext_psoc_ptr;
109 	struct vdev_response_timer psoc_vdev_rt[WLAN_UMAC_PSOC_MAX_VDEVS];
110 #ifdef FEATURE_VDEV_OPS_WAKELOCK
111 	struct psoc_mlme_wakelock psoc_mlme_wakelock;
112 #endif
113 	struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache[WLAN_UMAC_MAX_PDEVS];
114 	struct psoc_config psoc_cfg;
115 };
116 
117 #endif
118