xref: /wlan-driver/qcacld-3.0/core/mac/src/pe/lim/lim_sme_req_utils.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2011-2012,2014-2015,2018-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  * This file lim_sme_req_utils.h contains the utility definitions
23  * LIM uses while processing SME request messages.
24  * Author:        Chandra Modumudi
25  * Date:          02/13/02
26  * History:-
27  * Date           Modified by    Modification Information
28  * --------------------------------------------------------------------
29  */
30 #ifndef __LIM_SME_REQ_UTILS_H
31 #define __LIM_SME_REQ_UTILS_H
32 
33 #include "sir_api.h"
34 #include "lim_types.h"
35 
36 /* LIM SME request messages related utility functions */
37 
38 /**
39  * lim_is_sme_start_bss_req_valid() - To validate sme start bss request
40  * @mac_ctx: Pointer to Global MAC structure
41  * @start_bss_req: Pointer to received SME_START_BSS_REQ message
42  * @bss_type: bss type
43  *
44  * This function is called by lim_process_sme_req_messages() upon
45  * receiving SME_START_BSS_REQ message from application.
46  *
47  * Return: true when received SME_START_BSS_REQ is formatted correctly false
48  *         otherwise
49  */
50 bool lim_is_sme_start_bss_req_valid(struct mac_context *mac_ctx,
51 				    struct start_bss_config *start_bss_req,
52 				    enum bss_type bss_type);
53 uint8_t lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(struct mac_context *,
54 							    tpSirRSNie, struct pe_session *);
55 
56 /**
57  * lim_is_sme_disassoc_req_valid() - Validate disassoc req message
58  * @mac: Pointer to Global MAC structure
59  * @disassoc_req: Pointer to received SME_DISASSOC_REQ message
60  * @pe_session: Pointer to the PE session
61  *
62  * This function is called by lim_process_sme_req_messages() upon
63  * receiving SME_DISASSOC_REQ message from application.
64  *
65  * Return: true  When received SME_DISASSOC_REQ is formatted correctly
66  *         false otherwise
67  */
68 bool lim_is_sme_disassoc_req_valid(struct mac_context *mac,
69 				   struct disassoc_req *disassoc_req,
70 				   struct pe_session *pe_session);
71 
72 /**
73  * lim_is_sme_deauth_req_valid() - Validate deauth req message
74  * @mac: Pointer to Global MAC structure
75  * @disassoc_req: Pointer to received SME_DEAUTH_REQ message
76  * @pe_session: Pointer to the PE session
77  *
78  * This function is called by lim_process_sme_req_messages() upon
79  * receiving SME_DEAUTH_REQ message from application.
80  *
81  * Return: true  When received SME_DEAUTH_REQ is formatted correctly
82  *         false otherwise
83  */
84 bool lim_is_sme_deauth_req_valid(struct mac_context *mac,
85 				 struct deauth_req *deauth_req,
86 				 struct pe_session *pe_session);
87 
88 /**
89  * lim_is_sme_disassoc_cnf_valid() - Validate disassoc cnf message
90  * @mac: Pointer to Global MAC structure
91  * @disassoc_cnf: Pointer to received SME_DISASSOC_CNF message
92  * @pe_session: Pointer to the PE session
93  *
94  * This function is called by lim_process_sme_req_messages() upon
95  * receiving SME_DISASSOC_CNF message from application.
96  *
97  * Return: true  When received SME_DISASSOC_CNF is formatted correctly
98  *         false otherwise
99  */
100 bool lim_is_sme_disassoc_cnf_valid(struct mac_context *mac,
101 				   struct disassoc_cnf *disassoc_cnf,
102 				   struct pe_session *pe_session);
103 
104 #endif /* __LIM_SME_REQ_UTILS_H */
105