xref: /wlan-dirver/qca-wifi-host-cmn/os_if/linux/mlme/inc/osif_cm_req.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: osif_cm_req.h
19  *
20  * This header file maintains declarations of connect, disconnect, roam
21  * request apis.
22  */
23 
24 #ifndef __OSIF_CM_REQ_H
25 #define __OSIF_CM_REQ_H
26 
27 #include "qdf_status.h"
28 #include "wlan_cm_public_struct.h"
29 #include <net/cfg80211.h>
30 #include "wlan_objmgr_vdev_obj.h"
31 
32 /**
33  * struct osif_connect_params - extra connect params
34  * @scan_ie: default scan ie to be used in connect scan and unicast probe req
35  * during connect
36  * @force_rsne_override: force the arbitrary rsne received in connect req to be
37  * used with out validation, used for the scenarios where the device is used
38  * as a testbed device with special functionality and not recommended
39  * for production.
40  * @dot11mode_filter: dot11mode filter used to restrict connection to
41  * 11n/11ac/11ax.
42  * @sae_pwe: SAE mechanism for PWE derivation
43  *           0 = hunting-and-pecking loop only
44  *           1 = hash-to-element only
45  *           2 = both hunting-and-pecking loop and hash-to-element enabled
46  * @prev_bssid: Previous bssid in case of roam scenario
47  */
48 struct osif_connect_params {
49 	struct element_info scan_ie;
50 	bool force_rsne_override;
51 	enum dot11_mode_filter dot11mode_filter;
52 	uint8_t sae_pwe;
53 	struct qdf_mac_addr prev_bssid;
54 };
55 
56 #if defined(WLAN_FEATURE_FILS_SK) && \
57 	(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
58 		 (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
59 /**
60  * osif_cm_get_fils_auth_type() - get fils auth type
61  * @auth: nl auth type
62  *
63  * Return: enum wlan_fils_auth_type
64  */
65 enum wlan_fils_auth_type
66 osif_cm_get_fils_auth_type(enum nl80211_auth_type auth);
67 #endif
68 
69 /**
70  * osif_cm_connect() - Connect start request
71  * @dev: net dev
72  * @vdev: vdev pointer
73  * @req: connect req
74  * @params: connect params
75  *
76  * Return: int
77  */
78 int osif_cm_connect(struct net_device *dev, struct wlan_objmgr_vdev *vdev,
79 		    const struct cfg80211_connect_params *req,
80 		    const struct osif_connect_params *params);
81 
82 /**
83  * osif_cm_disconnect() - Disconnect start request
84  * @dev: net dev
85  * @vdev: vdev pointer
86  * @reason: disconnect reason
87  *
88  * Return: int
89  */
90 int osif_cm_disconnect(struct net_device *dev, struct wlan_objmgr_vdev *vdev,
91 		       uint16_t reason);
92 
93 /**
94  * osif_cm_disconnect_sync() - Disconnect vdev and wait for it to complete
95  * @vdev: vdev pointer
96  * @reason: disconnect reason
97  *
98  * Return: int
99  */
100 int osif_cm_disconnect_sync(struct wlan_objmgr_vdev *vdev, uint16_t reason);
101 
102 #endif /* __OSIF_CM_REQ_H */
103