xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/include/wlan_psoc_mlme.h (revision 00bcc8cbd3251495b2372fa547568b4656558e1c)
1 /*
2  * Copyright (c) 2019-2021 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 
17 /**
18  * DOC: Define PSOC MLME structure
19  */
20 #ifndef _WLAN_PSOC_MLME_H_
21 #define _WLAN_PSOC_MLME_H_
22 
23 #include <wlan_ext_mlme_obj_types.h>
24 #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
25 #include <qdf_timer.h>
26 #include <wlan_cm_bss_score_param.h>
27 #ifdef FEATURE_VDEV_OPS_WAKELOCK
28 #include <target_if_psoc_wake_lock.h>
29 #endif
30 /* Max RNR size given max vaps are 16 */
31 #define MAX_RNR_SIZE 256
32 
33 /**
34  * struct wlan_rnr_global_cache - 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 /**
46  * struct psoc_phy_config - psoc phy caps
47  * @vdev_nss_24g: Number of NSS the device support in 2.4Ghz
48  * @vdev_nss_5g: Number of NSS the device support in 5Ghz
49  * @ht_cap: If dev is configured as HT capable
50  * @vht_cap:If dev is configured as VHT capable
51  * @he_cap: If dev is configured as HE capable
52  * @eht_cap: If dev is configured as EHT capable
53  * @vht_24G_cap:If dev is configured as VHT capable for 2.4Ghz
54  * @beamformee_cap:If dev is configured as BF capable
55  * @bw_above_20_5ghz: BW greater than 20Mhz supprted for 5Ghz
56  * @bw_above_20_24ghz: BW greater than 20Mhz supprted for 2.4Ghz
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 };
70 
71 /**
72  * struct psoc_config - psoc level configs
73  * @score_config:          BSS scoring related config
74  * @phy_config:            Psoc Phy config
75  */
76 struct psoc_config {
77 	struct scoring_cfg score_config;
78 	struct psoc_phy_config phy_config;
79 };
80 
81 /**
82  * struct psoc_mlme_obj -  PSoC MLME component object
83  * @psoc:                  PSoC object
84  * @ext_psoc_ptr:          PSoC legacy pointer
85  * @psoc_vdev_rt:          PSoC Vdev response timer
86  * @psoc_mlme_wakelock:    Wakelock to prevent system going to suspend
87  * @rnr_6ghz_cache:        Cache of 6Ghz vap in RNR ie format
88  * @psoc_cfg:              Psoc level configs
89  */
90 struct psoc_mlme_obj {
91 	struct wlan_objmgr_psoc *psoc;
92 	mlme_psoc_ext_t *ext_psoc_ptr;
93 	struct vdev_response_timer psoc_vdev_rt[WLAN_UMAC_PSOC_MAX_VDEVS];
94 #ifdef FEATURE_VDEV_OPS_WAKELOCK
95 	struct psoc_mlme_wakelock psoc_mlme_wakelock;
96 #endif
97 	struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache;
98 	struct psoc_config psoc_cfg;
99 };
100 
101 #endif
102