1 /*
2 * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022-2023 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 Macros and Function prototypes FT and 802.11R purposes
23
24 ========================================================================*/
25
26 #ifndef __LIMFT_H__
27 #define __LIMFT_H__
28
29 #include <cds_api.h>
30 #include <lim_global.h>
31 #include <ani_global.h>
32 #include <lim_ser_des_utils.h>
33
34 /*-------------------------------------------------------------------------
35 Function declarations and documentation
36 ------------------------------------------------------------------------*/
37 void lim_ft_open(struct mac_context *mac, struct pe_session *pe_session);
38 void lim_ft_cleanup(struct mac_context *mac, struct pe_session *pe_session);
39 #ifdef WLAN_FEATURE_HOST_ROAM
40 void lim_ft_cleanup_pre_auth_info(struct mac_context *mac,
41 struct pe_session *pe_session);
42 bool lim_process_ft_pre_auth_req(struct mac_context *mac,
43 tpSirFTPreAuthReq ft_pre_auth_req);
44 void lim_process_ft_preauth_rsp_timeout(struct mac_context *mac);
45
46 /**
47 * lim_process_mlm_ft_reassoc_req() - Handle the Reassoc request
48 * @mac: Global MAC context
49 * @reassoc_req: reassoc req
50 *
51 * This function handles the Reassoc Req from SME
52 *
53 * Return: None
54 */
55 void lim_process_mlm_ft_reassoc_req(struct mac_context *mac,
56 tLimMlmReassocReq *reassoc_req);
57 void lim_perform_ft_pre_auth(struct mac_context *mac, QDF_STATUS status,
58 uint32_t *data, struct pe_session *pe_session);
59 void lim_post_ft_pre_auth_rsp(struct mac_context *mac, QDF_STATUS status,
60 uint8_t *auth_rsp, uint16_t auth_rsp_length,
61 struct pe_session *pe_session);
62 void lim_handle_ft_pre_auth_rsp(struct mac_context *mac, QDF_STATUS status,
63 uint8_t *auth_rsp, uint16_t auth_rsp_len,
64 struct pe_session *pe_session);
65 QDF_STATUS lim_ft_setup_auth_session(struct mac_context *mac,
66 struct pe_session *pe_session);
67 void lim_process_mlm_reassoc_cnf(struct mac_context *mac_ctx, uint32_t *msg);
68 /**
69 * lim_process_sta_mlm_add_bss_rsp_ft() - Handle ft add bss response
70 * @mac: Global MAC context
71 * @add_bss_rsp: Bss params rsp data
72 * @pe_session: PE Session
73 *
74 * Function to handle fast roaming add bss response in FT reassoc state,
75 * send reassociation Request.
76 *
77 * Return: None
78 */
79 void lim_process_sta_mlm_add_bss_rsp_ft(struct mac_context *mac,
80 struct add_bss_rsp *add_bss_rsp,
81 struct pe_session *pe_session);
82 void lim_process_mlm_reassoc_req(struct mac_context *mac_ctx,
83 tLimMlmReassocReq *reassoc_req);
84
85 /**
86 * lim_preauth_scan_event_handler() - Process preauth scan events
87 * @mac_ctx:Pointer to global MAC structure
88 * @event: Scan event
89 * @vdev_id: vdev id
90 * @scan_id: scan id from WMA scan event.
91 *
92 * If scan event signifies failure or successful completion, operation
93 * is complete.
94 * If scan event signifies that STA is on foreign channel, send auth frame
95 *
96 * Return: void
97 */
98 void lim_preauth_scan_event_handler(struct mac_context *mac_ctx,
99 enum sir_scan_event_type event,
100 uint8_t vdev_id, uint32_t scan_id);
101 QDF_STATUS lim_send_preauth_scan_offload(struct mac_context *mac_ctx,
102 struct pe_session *session_entry, tSirFTPreAuthReq *ft_preauth_req);
103 #else
lim_ft_cleanup_pre_auth_info(struct mac_context * mac,struct pe_session * pe_session)104 static inline void lim_ft_cleanup_pre_auth_info(struct mac_context *mac,
105 struct pe_session *pe_session)
106 {}
lim_process_ft_preauth_rsp_timeout(struct mac_context * mac)107 static inline void lim_process_ft_preauth_rsp_timeout(struct mac_context *mac)
108 {}
109 static inline
lim_process_mlm_ft_reassoc_req(struct mac_context * mac,tLimMlmReassocReq * reassoc_req)110 void lim_process_mlm_ft_reassoc_req(struct mac_context *mac,
111 tLimMlmReassocReq *reassoc_req)
112 {}
lim_handle_ft_pre_auth_rsp(struct mac_context * mac,QDF_STATUS status,uint8_t * auth_rsp,uint16_t auth_rsp_len,struct pe_session * pe_session)113 static inline void lim_handle_ft_pre_auth_rsp(struct mac_context *mac,
114 QDF_STATUS status, uint8_t *auth_rsp,
115 uint16_t auth_rsp_len, struct pe_session *pe_session)
116 {}
lim_process_mlm_reassoc_cnf(struct mac_context * mac_ctx,uint32_t * msg)117 static inline void lim_process_mlm_reassoc_cnf(struct mac_context *mac_ctx,
118 uint32_t *msg)
119 {}
120 static inline
lim_process_sta_mlm_add_bss_rsp_ft(struct mac_context * mac,struct add_bss_rsp * add_bss_rsp,struct pe_session * pe_session)121 void lim_process_sta_mlm_add_bss_rsp_ft(struct mac_context *mac,
122 struct add_bss_rsp *add_bss_rsp,
123 struct pe_session *pe_session)
124 {}
lim_process_mlm_reassoc_req(struct mac_context * mac_ctx,tLimMlmReassocReq * reassoc_req)125 static inline void lim_process_mlm_reassoc_req(struct mac_context *mac_ctx,
126 tLimMlmReassocReq *reassoc_req)
127 {}
lim_preauth_scan_event_handler(struct mac_context * mac_ctx,enum sir_scan_event_type event,uint8_t vdev_id,uint32_t scan_id)128 static inline void lim_preauth_scan_event_handler(struct mac_context *mac_ctx,
129 enum sir_scan_event_type event,
130 uint8_t vdev_id, uint32_t scan_id)
131 {}
lim_process_ft_pre_auth_req(struct mac_context * mac,tpSirFTPreAuthReq ft_pre_auth_req)132 static inline bool lim_process_ft_pre_auth_req(
133 struct mac_context *mac, tpSirFTPreAuthReq ft_pre_auth_req)
134 {
135 return false;
136 }
137 #endif
138
139 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
140 QDF_STATUS
141 lim_fill_ft_session(struct mac_context *mac,
142 struct bss_description *pbssDescription,
143 struct pe_session *ft_session,
144 struct pe_session *pe_session,
145 enum wlan_phymode bss_phymode);
146
147 /**
148 * lim_ft_prepare_add_bss_req() - Create Add Bss Req to the new AP
149 * @mac: Global MAC context
150 * @add_bss_params: Bss params including rsp data
151 * @pe_session: PE Session
152 *
153 * This will be used when we are ready to FT to the new AP.
154 * The newly created ft Session entry is passed to this function
155 *
156 * Return: None
157 */
158 void lim_ft_prepare_add_bss_req(struct mac_context *mac,
159 struct pe_session *ft_session,
160 struct bss_description *bssDescription);
161
162 QDF_STATUS lim_send_preauth_scan_offload(struct mac_context *mac_ctx,
163 struct pe_session *session_entry, tSirFTPreAuthReq *ft_preauth_req);
164 #else
165 static inline QDF_STATUS
lim_fill_ft_session(struct mac_context * mac struct bss_description * pbssDescription,struct pe_session * ft_session,struct pe_session * pe_session,enum wlan_phymode bss_phymode)166 lim_fill_ft_session(struct mac_context *mac
167 struct bss_description *pbssDescription,
168 struct pe_session *ft_session,
169 struct pe_session *pe_session,
170 enum wlan_phymode bss_phymode)
171 {
172 return QDF_STATUS_SUCCESS;
173 }
lim_ft_prepare_add_bss_req(struct mac_context * mac,struct pe_session * ft_session,struct bss_description * bssDescription)174 static inline void lim_ft_prepare_add_bss_req(struct mac_context *mac,
175 struct pe_session *ft_session,
176 struct bss_description *bssDescription)
177 {}
178 #endif
179
180 QDF_STATUS lim_process_ft_aggr_qos_req(struct mac_context *mac,
181 uint32_t *msg_buf);
182 void lim_process_ft_aggr_qos_rsp(struct mac_context *mac,
183 struct scheduler_msg *limMsg);
184 void lim_ft_cleanup_all_ft_sessions(struct mac_context *mac);
185 #endif /* __LIMFT_H__ */
186