1 /*
2  * Copyright (c) 2011-2014, 2016, 2018-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /*
21  *
22  * This file lim_prop_exts_utils.h contains the definitions
23  * used by all LIM modules to support proprietary features.
24  * Author:        Chandra Modumudi
25  * Date:          12/11/02
26  * History:-
27  * Date           Modified by    Modification Information
28  * --------------------------------------------------------------------
29  *
30  */
31 
32 #ifndef __LIM_PROP_EXTS_UTILS_H
33 #define __LIM_PROP_EXTS_UTILS_H
34 
35 #define LIM_ADAPTIVE_11R_OUI      "\x00\x40\x96\x2C"
36 #define LIM_ADAPTIVE_11R_OUI_SIZE 4
37 
38 /**
39  * lim_extract_ap_capability() - extract AP's HCF/WME/WSM capability
40  * @mac_ctx: Pointer to Global MAC structure
41  * @p_ie: Pointer to starting IE in Beacon/Probe Response
42  * @ie_len: Length of all IEs combined
43  * @qos_cap: Bits are set according to capabilities
44  * @uapsd: pointer to uapsd
45  * @local_constraint: Pointer to local power constraint.
46  * @session: A pointer to session entry.
47  * @is_pwr_constraint: Check for Power constraint bit in beacon
48  *
49  * This function is called to extract AP's HCF/WME/WSM capability
50  * from the IEs received from it in Beacon/Probe Response frames
51  *
52  * Return: None
53  */
54 void
55 lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
56 			  uint16_t ie_len, uint8_t *qos_cap, uint8_t *uapsd,
57 			  int8_t *local_constraint, struct pe_session *session,
58 			  bool *is_pwr_constraint);
59 
60 #ifdef WLAN_FEATURE_11BE
61 /**
62  * lim_extract_eht_op() - Extract EHT operation IE into session
63  * @session: Pointer to pe_session
64  * @beacon_struct: Pointer to extracted beacon/probe response of the
65  * AP
66  *
67  * Return: None
68  */
69 void lim_extract_eht_op(struct pe_session *session,
70 			tSirProbeRespBeacon *beacon_struct);
71 #else
72 static inline void
lim_extract_eht_op(struct pe_session * session,tSirProbeRespBeacon * beacon_struct)73 lim_extract_eht_op(struct pe_session *session,
74 		   tSirProbeRespBeacon *beacon_struct)
75 {}
76 #endif
77 
78 ePhyChanBondState lim_get_htcb_state(ePhyChanBondState aniCBMode);
79 
80 /**
81  * lim_objmgr_update_vdev_nss() - update nss in vdev object
82  * @psoc: Pointer to Global MAC structure
83  * @vdev_id: vdev id
84  * @nss: nss
85  *
86  * Return: None
87  */
88 void lim_objmgr_update_vdev_nss(struct wlan_objmgr_psoc *psoc,
89 				uint8_t vdev_id, uint8_t nss);
90 
91 /**
92  * lim_update_he_mcs_12_13_map() - update he_mcs_12_13_map in vdev object
93  * @psoc: Pointer to Global MAC structure
94  * @vdev_id: vdev id
95  * @he_mcs_12_13_map: he mcs 12/13 map
96  *
97  * Return: None
98  */
99 void lim_update_he_mcs_12_13_map(struct wlan_objmgr_psoc *psoc,
100 				 uint8_t vdev_id, uint16_t he_mcs_12_13_map);
101 
102 #ifdef WLAN_FEATURE_11BE_MLO
103 void lim_objmgr_update_emlsr_caps(struct wlan_objmgr_psoc *psoc,
104 				  uint8_t vdev_id, tpSirAssocRsp assoc_rsp);
105 #else
106 static inline
lim_objmgr_update_emlsr_caps(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,tpSirAssocRsp assoc_rsp)107 void lim_objmgr_update_emlsr_caps(struct wlan_objmgr_psoc *psoc,
108 				  uint8_t vdev_id, tpSirAssocRsp assoc_rsp)
109 {
110 }
111 #endif /* WLAN_FEATURE_11BE_MLO */
112 #endif /* __LIM_PROP_EXTS_UTILS_H */
113