xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/include/wlan_psoc_mlme.h (revision d63e03e207713f1d4d8a384c065ef4e076216f2e)
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  * @max_chan_switch_ie: If max channel switch IE is supported
58  */
59 struct psoc_phy_config {
60 	uint8_t vdev_nss_24g;
61 	uint8_t vdev_nss_5g;
62 	uint32_t ht_cap:1,
63 		 vht_cap:1,
64 		 he_cap:1,
65 		 eht_cap:1,
66 		 vht_24G_cap:1,
67 		 beamformee_cap:1,
68 		 bw_above_20_5ghz:1,
69 		 bw_above_20_24ghz:1,
70 		 max_chan_switch_ie:1;
71 };
72 
73 /**
74  * struct psoc_config - psoc level configs
75  * @score_config:          BSS scoring related config
76  * @phy_config:            Psoc Phy config
77  */
78 struct psoc_config {
79 	struct scoring_cfg score_config;
80 	struct psoc_phy_config phy_config;
81 };
82 
83 /**
84  * struct psoc_mlme_obj -  PSoC MLME component object
85  * @psoc:                  PSoC object
86  * @ext_psoc_ptr:          PSoC legacy pointer
87  * @psoc_vdev_rt:          PSoC Vdev response timer
88  * @psoc_mlme_wakelock:    Wakelock to prevent system going to suspend
89  * @rnr_6ghz_cache:        Cache of 6Ghz vap in RNR ie format
90  * @psoc_cfg:              Psoc level configs
91  */
92 struct psoc_mlme_obj {
93 	struct wlan_objmgr_psoc *psoc;
94 	mlme_psoc_ext_t *ext_psoc_ptr;
95 	struct vdev_response_timer psoc_vdev_rt[WLAN_UMAC_PSOC_MAX_VDEVS];
96 #ifdef FEATURE_VDEV_OPS_WAKELOCK
97 	struct psoc_mlme_wakelock psoc_mlme_wakelock;
98 #endif
99 	struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache;
100 	struct psoc_config psoc_cfg;
101 };
102 
103 #endif
104