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