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