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_rsp.h 20 * 21 * This header file maintains declarations of connect, disconnect, roam 22 * response apis. 23 */ 24 25 #ifndef __OSIF_CM_RSP_H 26 #define __OSIF_CM_RSP_H 27 28 #include "wlan_objmgr_vdev_obj.h" 29 #include "wlan_cm_public_struct.h" 30 31 /** 32 * osif_disconnect_handler() - Indicate disconnect to userspace 33 * @vdev: vdev pointer 34 * @rsp: Disconnect response from connection manager 35 * 36 * This function indicates disconnect to the kernel which thus indicates 37 * to the userspace. 38 * 39 * Context: Any context 40 * Return: QDF_STATUS_SUCCESS on successful indication to kernel, 41 * else QDF_STATUS with failure reason 42 */ 43 QDF_STATUS osif_disconnect_handler(struct wlan_objmgr_vdev *vdev, 44 struct wlan_cm_discon_rsp *rsp); 45 46 /** 47 * osif_cm_get_assoc_req_ie_data() - Get the assoc req IE offset and length 48 * if valid assoc req is present 49 * @assoc_req: assoc req info 50 * @ie_data_len: IE date length to be calculated 51 * @ie_data_ptr: IE data pointer to be calculated 52 * 53 * Return: void 54 */ 55 void osif_cm_get_assoc_req_ie_data(struct element_info *assoc_req, 56 size_t *ie_data_len, 57 const uint8_t **ie_data_ptr); 58 59 /** 60 * osif_cm_get_assoc_rsp_ie_data() - Get the assoc resp IE offset and length 61 * if valid assoc req is present 62 * @assoc_req: assoc req info 63 * @ie_data_len: IE date length to be calculated 64 * @ie_data_ptr: IE data pointer to be calculated 65 * 66 * Return: void 67 */ 68 void osif_cm_get_assoc_rsp_ie_data(struct element_info *assoc_rsp, 69 size_t *ie_data_len, 70 const uint8_t **ie_data_ptr); 71 72 /** 73 * osif_connect_handler() - API to send connect response to kernel 74 * @vdev: vdev pointer 75 * @rsp: Connection manager connect response 76 * 77 * The API is used to send connection response to kernel 78 * 79 * Context: Any context. 80 * Return: QDF_STATUS 81 */ 82 QDF_STATUS osif_connect_handler(struct wlan_objmgr_vdev *vdev, 83 struct wlan_cm_connect_resp *rsp); 84 85 #ifdef CONN_MGR_ADV_FEATURE 86 /** 87 * osif_indicate_reassoc_results() - API to send reassoc response to kernel 88 * @vdev: vdev pointer 89 * @osif_priv: OS private structure of vdev 90 * @rsp: Connection manager response 91 * 92 * The API is used to send reassoc response to kernel 93 * 94 * Context: Any context. 95 * Return: QDF_STATUS 96 */ 97 void osif_indicate_reassoc_results(struct wlan_objmgr_vdev *vdev, 98 struct vdev_osif_priv *osif_priv, 99 struct wlan_cm_connect_resp *rsp); 100 101 /** 102 * @osif_pmksa_candidate_notify_cb: Roam pmksa candidate notify callback 103 * @vdev: vdev pointer 104 * @bssid: bssid 105 * @index: index 106 * @preauth: preauth flag 107 * 108 * Return: QDF_STATUS 109 */ 110 QDF_STATUS 111 osif_pmksa_candidate_notify(struct wlan_objmgr_vdev *vdev, 112 struct qdf_mac_addr *bssid, 113 int index, bool preauth); 114 #else 115 static inline void 116 osif_indicate_reassoc_results(struct wlan_objmgr_vdev *vdev, 117 struct vdev_osif_priv *osif_priv, 118 struct wlan_cm_connect_resp *rsp) 119 {} 120 #endif 121 122 /** 123 * osif_failed_candidate_handler() - API to indicate individual candidate 124 * connect failure resp 125 * @vdev: vdev pointer 126 * @rsp: Connection manager connect response for the candidate 127 * 128 * The API is is used indicate individual candidate connect failure resp for 129 * for tried all but last tried candidate. The last candidate will be sent in 130 * osif_connect_handler. 131 * 132 * Context: Any context. 133 * Return: QDF_STATUS 134 */ 135 QDF_STATUS osif_failed_candidate_handler(struct wlan_objmgr_vdev *vdev, 136 struct wlan_cm_connect_resp *rsp); 137 138 /** 139 * osif_cm_indicate_disconnect - notify osif that connection was dropped 140 * 141 * @vdev: pointer to vdev 142 * @dev: network device 143 * @reason: reason code for the disconnection, set it to 0 if unknown 144 * @locally_generated: disconnection was requested locally 145 * @ie: information elements of the deauth/disassoc frame (may be %NULL) 146 * @ie_len: length of IEs 147 * @gfp: allocation flags 148 * 149 * After it calls this function, the driver should enter an idle state 150 * and not try to connect to any AP any more. 151 */ 152 void 153 osif_cm_indicate_disconnect(struct wlan_objmgr_vdev *vdev, 154 struct net_device *dev, 155 enum ieee80211_reasoncode reason, 156 bool locally_generated, const u8 *ie, 157 size_t ie_len, gfp_t gfp); 158 159 #ifdef WLAN_FEATURE_11BE_MLO 160 /** 161 * osif_get_partner_info_from_mlie() - API to get partner information 162 * from basic variant mlo ie 163 * @rsp: Connection manager connect response for the candidate 164 * @partner_info: mlo partner info pointer 165 * 166 * The API is is used get partner information from basic variant ml ie. 167 * 168 * Context: Any context. 169 * Return: QDF_STATUS 170 */ 171 QDF_STATUS 172 osif_get_partner_info_from_mlie(struct wlan_cm_connect_resp *connect_rsp, 173 struct mlo_partner_info *partner_info); 174 /** 175 * osif_get_link_id_from_assoc_ml_ie() - API to get link id from assoc rsp 176 * ml ie. 177 * @rsp_link_info: pointer to mlo link info 178 * @partner_info: mlo partner info pointer 179 * @link_id: Link id information 180 * 181 * The API is used to get link id from assoc response basic variant mlo ie 182 * 183 * Context: Any context. 184 * Return: QDF_STATUS 185 */ 186 QDF_STATUS 187 osif_get_link_id_from_assoc_ml_ie(struct mlo_link_info *rsp_link_info, 188 struct mlo_partner_info *assoc_partner_info, 189 uint8_t *link_id); 190 191 /** 192 * osif_get_chan_bss_from_kernel() - API to get chan bss from kernel 193 * @vdev: vdev pointer 194 * @rsp_link_info: pointer to mlo link info 195 * @rsp: Connection manager connect response for the candidate 196 * 197 * The API is used to get chan bss from kernel. 198 * 199 * Context: Any context. 200 * Return: QDF_STATUS 201 */ 202 struct cfg80211_bss * 203 osif_get_chan_bss_from_kernel(struct wlan_objmgr_vdev *vdev, 204 struct mlo_link_info *rsp_link_info, 205 struct wlan_cm_connect_resp *rsp); 206 #endif 207 #endif /* __OSIF_CM_RSP_H */ 208