1 /* 2 * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2022 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_rnr_global_cache - 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 supprted for 5Ghz 60 * @bw_above_20_24ghz: BW greater than 20Mhz supprted 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_config - psoc level configs 79 * @score_config: BSS scoring related config 80 * @phy_config: Psoc Phy config 81 */ 82 struct psoc_config { 83 struct scoring_cfg score_config; 84 struct psoc_phy_config phy_config; 85 }; 86 87 /** 88 * struct psoc_mlme_obj - PSoC MLME component object 89 * @psoc: PSoC object 90 * @ext_psoc_ptr: PSoC legacy pointer 91 * @psoc_vdev_rt: PSoC Vdev response timer 92 * @psoc_mlme_wakelock: Wakelock to prevent system going to suspend 93 * @rnr_6ghz_cache: Cache of 6Ghz vap in RNR ie format 94 * @psoc_cfg: Psoc level configs 95 */ 96 struct psoc_mlme_obj { 97 struct wlan_objmgr_psoc *psoc; 98 mlme_psoc_ext_t *ext_psoc_ptr; 99 struct vdev_response_timer psoc_vdev_rt[WLAN_UMAC_PSOC_MAX_VDEVS]; 100 #ifdef FEATURE_VDEV_OPS_WAKELOCK 101 struct psoc_mlme_wakelock psoc_mlme_wakelock; 102 #endif 103 struct wlan_6ghz_rnr_global_cache rnr_6ghz_cache; 104 struct psoc_config psoc_cfg; 105 }; 106 107 #endif 108