xref: /wlan-driver/qcacld-3.0/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-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  * This file lim_send_sme_rsp_messages.h contains the definitions for
22  * sending SME response/notification messages to applications above
23  * MAC software.
24  * Author:        Chandra Modumudi
25  * Date:          02/11/02
26  * History:-
27  * Date           Modified by    Modification Information
28  * --------------------------------------------------------------------
29  *
30  */
31 #ifndef __LIM_SEND_SME_RSP_H
32 #define __LIM_SEND_SME_RSP_H
33 
34 #include "sir_common.h"
35 #include "sir_api.h"
36 #include "sir_mac_prot_def.h"
37 #include <../../core/src/wlan_cm_vdev_api.h>
38 
39 /* Functions for sending responses up the stack */
40 
41 /**
42  * lim_send_sme_rsp() - Send Generic Response to upper layers
43  * @mac_ctx:        Pointer to Global MAC structure
44  * @msg_type:       Indicates message type
45  * @result_code:    Indicates the result of previously issued
46  *                  eWNI_SME_msg_type_REQ message
47  * @vdev_id: vdev_id
48  *
49  * This function is called by lim_process_sme_req_messages() to send
50  * eWNI_SME_START_RSP, eWNI_SME_STOP_BSS_RSP
51  * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC
52  * Software.
53  *
54  * Return: None
55  */
56 void lim_send_sme_rsp(struct mac_context *mac_ctx, uint16_t msg_type,
57 		      tSirResultCodes result_code, uint8_t vdev_id);
58 
59 /**
60  * lim_send_sme_start_bss_rsp() - Send Start BSS response
61  * @mac: Pointer to Global MAC structure
62  * @resultCode: Indicates the result of previously issued request
63  * @pe_session: PE session associated with the BSS
64  * @smesessionId: ID of the SME session associated with the BSS
65  *
66  * This function is called to send eWNI_SME_START_BSS_RSP
67  * message to applications above MAC Software.
68  */
69 void lim_send_sme_start_bss_rsp(struct mac_context *mac,
70 				tSirResultCodes resultCode,
71 				struct pe_session *pe_session,
72 				uint8_t smesessionId);
73 
74 /**
75  * lim_send_sme_join_reassoc_rsp() - Send Response to Upper Layers
76  * @mac_ctx: Pointer to Global MAC structure
77  * @msg_type: Indicates message type
78  * @result_code: Indicates the result of previously issued request
79  * @prot_status_code: Protocol Status Code
80  * @session_entry: PE Session Info
81  * @vdev_id: vdev_id
82  *
83  * This function is called by lim_process_sme_req_messages() to send
84  * eWNI_SME_JOIN_RSP or eWNI_SME_REASSOC_RSP messages to applications
85  * above MAC Software.
86  *
87  * Return: None
88  */
89 void lim_send_sme_join_reassoc_rsp(struct mac_context *mac_ctx,
90 				   uint16_t msg_type,
91 				   tSirResultCodes result_code,
92 				   uint16_t prot_status_code,
93 				   struct pe_session *session_entry,
94 				   uint8_t vdev_id);
95 
96 /**
97  * lim_cm_send_connect_rsp() - Send Response to Upper Layers
98  * @mac_ctx: Pointer to Global MAC structure
99  * @pe_session: PE Session Info
100  * @req: connect req if pe session is NULL
101  * @reason: reason of failure, valid only if status is failure
102  * @connect_status: Indicates the status of the req
103  * @status_code: Protocol Status Code
104  * @is_reassoc: if reassoc resp
105  *
106  * Return: None
107  */
108 void lim_cm_send_connect_rsp(struct mac_context *mac_ctx,
109 			     struct pe_session *pe_session,
110 			     struct cm_vdev_join_req *req,
111 			     enum wlan_cm_connect_fail_reason reason,
112 			     QDF_STATUS connect_status,
113 			     enum wlan_status_code status_code,
114 			     bool is_reassoc);
115 
116 /**
117  * lim_prepare_disconnect_done_ind() - Prepares the disconnect done ind message
118  * @mac_ctx: Global mac_ctx
119  * @session_id: PE session id
120  * @reason_code: Disconnect indication reason code
121  * @peer_mac_addr: MAC address of the peer
122  *
123  * Prepares the disconnect done indication message to be sent to the upper layer
124  *
125  * Return: QDF Status
126  */
127 QDF_STATUS lim_prepare_disconnect_done_ind(struct mac_context *mac_ctx,
128 					   uint32_t **msg,
129 					   uint8_t session_id,
130 					   tSirResultCodes reason_code,
131 					   uint8_t *peer_mac_addr);
132 
133 /**
134  * lim_send_sme_disassoc_ntf() - Send disassoc notification to upper layer
135  * @mac: Global MAC context
136  * @peerMacAddr: The peer MAC addr to which disassociate was initiated
137  * @reasonCode: The reason for Disassociation
138  * @disassocTrigger: The trigger for Disassociation
139  * @aid: The STAID. This parameter is present only on AP
140  * @smesessionId: ID of the SME session associated with the event
141  * @pe_session: The PE session associated with the event
142  *
143  * This function is used for sending eWNI_SME_DISASSOC_RSP,
144  * or eWNI_SME_DISASSOC_IND to upper layer depending on
145  * disassociation trigger.
146  *
147  * Return: None
148  */
149 void lim_send_sme_disassoc_ntf(struct mac_context *mac,
150 			       tSirMacAddr peerMacAddr,
151 			       tSirResultCodes reasonCode,
152 			       uint16_t disassocTrigger,
153 			       uint16_t aid,
154 			       uint8_t smesessionId,
155 			       struct pe_session *pe_session);
156 
157 /**
158  * lim_send_sme_deauth_ntf() - send deauth notice to upper layer
159  * @peerMacAddr: peer MAC addr to which deauthentication was initiated
160  * @reasonCode: the reason for Deauthetication
161  * @deauthTrigger: the trigger for Deauthetication
162  * @aid: the STAID. This parameter is present only on AP.
163  * @vdev_id: vdev id
164  *
165  * This function is used for sending eWNI_SME_DEAUTH_RSP or
166  * eWNI_SME_DEAUTH_IND to upper layers depending on deauthentication
167  * trigger.
168  *
169  * Return: None
170  */
171 void lim_send_sme_deauth_ntf(struct mac_context *mac, tSirMacAddr peerMacAddr,
172 			     tSirResultCodes reasonCode, uint16_t deauthTrigger,
173 			     uint16_t aid, uint8_t vdev_id);
174 
175 void lim_send_sme_disassoc_ind(struct mac_context *, tpDphHashNode, struct pe_session *);
176 void lim_send_sme_deauth_ind(struct mac_context *, tpDphHashNode,
177 			     struct pe_session *pe_session);
178 /**
179  * lim_send_sme_set_context_rsp() - Send set context response to upper layer
180  * @mac: Pointer to Global MAC structure
181  * @peer_macaddr: the peer MAC addr to which setContext was performed
182  * @aid: the aid corresponding to the peer MAC address
183  * @resultCode: the result of previously issued Set Context Req message
184  * @pe_session: The PE session associated with the peer
185  * @smesessionId: ID of the SME session associated with the peer
186  *
187  * This function is called to send eWNI_SME_SETCONTEXT_RSP message to
188  * upper layer
189  *
190  * Return: None
191  */
192 void lim_send_sme_set_context_rsp(struct mac_context *mac,
193 				  struct qdf_mac_addr peer_macaddr,
194 				  uint16_t aid,
195 				  tSirResultCodes resultCode,
196 				  struct pe_session *pe_session,
197 				  uint8_t smesessionId);
198 
199 /**
200  * lim_handle_delete_bss_rsp () - API to handle delete bss response
201  * @mac: global mac structure
202  * @del_bss_rsp: pointer to del bss response
203  *
204  * Return: None
205  */
206 void lim_handle_delete_bss_rsp(struct mac_context *mac,
207 				struct del_bss_resp *del_bss_rsp);
208 
209 /**
210  * lim_handle_csa_offload_msg() - Handle CSA offload message
211  * @mac_ctx:         pointer to global adapter context
212  * @msg:             Message pointer.
213  *
214  * Return: None
215  */
216 void lim_handle_csa_offload_msg(struct mac_context *mac_ctx,
217 				struct scheduler_msg *msg);
218 
219 void
220 lim_send_sme_aggr_qos_rsp(struct mac_context *mac, tpSirAggrQosRsp aggrQosRsp,
221 			  uint8_t smesessionId);
222 
223 /**
224  * lim_send_sme_addts_rsp() - sends SME ADDTS RSP
225  * @mac: global mac structure
226  * @rspReqd: is SmeAddTsRsp required
227  * @status: status code of SME_ADD_TS_RSP
228  * @pe_session: The PE session associated with the connection
229  * @tspec: The TSpec that was added
230  * @smesessionId: ID of the SME session associated with the connection
231  *
232  * This function sends a eWNI_SME_ADDTS_RSP to upper layer
233  *
234  * Return: None
235  */
236 void lim_send_sme_addts_rsp(struct mac_context *mac,
237 			    uint8_t rspReqd, uint32_t status,
238 			    struct pe_session *pe_session,
239 			    struct mac_tspec_ie tspec,
240 			    uint8_t smesessionId);
241 
242 void lim_send_sme_delts_rsp(struct mac_context *mac, tpSirDeltsReq delts,
243 			    uint32_t status, struct pe_session *pe_session,
244 			    uint8_t smesessionId);
245 void lim_send_sme_delts_ind(struct mac_context *mac,
246 			    struct delts_req_info *delts,
247 			    uint16_t aid, struct pe_session *);
248 
249 #ifdef FEATURE_WLAN_ESE
250 void lim_send_sme_pe_ese_tsm_rsp(struct mac_context *mac, tAniGetTsmStatsRsp *pStats);
251 #endif
252 
253 void lim_send_sme_max_assoc_exceeded_ntf(struct mac_context *mac, tSirMacAddr peerMacAddr,
254 					 uint8_t smesessionId);
255 
256 void lim_send_sme_ap_channel_switch_resp(struct mac_context *mac,
257 					 struct pe_session *pe_session,
258 					 struct vdev_start_response *rsp);
259 /*
260  * lim_process_beacon_tx_success_ind() - handle successful beacon transmission
261  * indication from the FW This is a generic event generated by the FW after the
262  * first beacon is sent out after the beacon template update by the host.
263  *
264  * @mac_ctx: Global mac_ctx
265  * @msg_type: msg_type
266  */
267 void
268 lim_process_beacon_tx_success_ind(struct mac_context *mac, uint16_t msgType,
269 				  void *event);
270 
271 /**
272  * lim_handle_sta_csa_param() - Handle CSA offload param
273  * @mac_ctx: pointer to global adapter context
274  * @csa_params: csa parameters.
275  * @send_status: Flag to send CSA status to fw in case of failure
276  *
277  * Return: None
278  */
279 void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
280 			      struct csa_offload_params *csa_params,
281 			      bool send_status);
282 
283 #ifdef WLAN_FEATURE_11BE_MLO
284 /**
285  * lim_handle_mlo_sta_csa_param() - handle mlo sta csa parameters
286  * @vdev: vdev
287  * @csa_params: csa parameters
288  *
289  * Return: None
290  */
291 void lim_handle_mlo_sta_csa_param(struct wlan_objmgr_vdev *vdev,
292 				  struct csa_offload_params *csa_params);
293 #endif /* WLAN_FEATURE_11BE_MLO */
294 
295 /** lim_send_stop_bss_response() - Send stop bss response to CSR
296  *
297  * @mac_ctx : Global mac ctx
298  * @vdev_id : vdev_id
299  * @result_code: result
300  *
301  * Return: None
302  */
303 void lim_send_stop_bss_response(struct mac_context *mac_ctx, uint8_t vdev_id,
304 				tSirResultCodes result_code);
305 
306 /**
307  * lim_nss_or_ch_width_update_rsp() - send NSS/ch_width update response to SME
308  * @mac_ctx Pointer to Global MAC structure
309  * @status: nss/ch_width update status
310  * @reason: Indicates whether it's from NSS update or ch_width update
311  *
312  * Return: None
313  */
314 void lim_nss_or_ch_width_update_rsp(struct mac_context *mac_ctx,
315 				    uint8_t vdev_id, QDF_STATUS status,
316 				    enum sir_bcn_update_reason reason);
317 #endif /* __LIM_SEND_SME_RSP_H */
318