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_rsp.h 19 * 20 * This header file maintains declarations of connect, disconnect, roam 21 * response apis. 22 */ 23 24 #ifndef __OSIF_CM_RSP_H 25 #define __OSIF_CM_RSP_H 26 27 #include "wlan_objmgr_vdev_obj.h" 28 #include "wlan_cm_public_struct.h" 29 30 /** 31 * osif_disconnect_handler() - Indicate disconnnect to userspace 32 * @vdev: vdev pointer 33 * @rsp: Disconnect response from connection manager 34 * 35 * This function indicates disconnect to the kernel which thus indicates 36 * to the userspace. 37 * 38 * Context: Any context 39 * Return: QDF_STATUS_SUCCESS on successful indication to kernel, 40 * else QDF_STATUS with failure reason 41 */ 42 QDF_STATUS osif_disconnect_handler(struct wlan_objmgr_vdev *vdev, 43 struct wlan_cm_discon_rsp *rsp); 44 45 /** 46 * osif_cm_get_assoc_req_ie_data() - Get the assoc req IE offset and length 47 * if valid assoc req is present 48 * @assoc_req: assoc req info 49 * @ie_data_len: IE date length to be calculated 50 * @ie_data_ptr: IE data pointer to be calculated 51 * 52 * Return: void 53 */ 54 void osif_cm_get_assoc_req_ie_data(struct element_info *assoc_req, 55 size_t *ie_data_len, 56 const uint8_t **ie_data_ptr); 57 58 /** 59 * osif_cm_get_assoc_rsp_ie_data() - Get the assoc resp IE offset and length 60 * if valid assoc req is present 61 * @assoc_req: assoc req info 62 * @ie_data_len: IE date length to be calculated 63 * @ie_data_ptr: IE data pointer to be calculated 64 * 65 * Return: void 66 */ 67 void osif_cm_get_assoc_rsp_ie_data(struct element_info *assoc_rsp, 68 size_t *ie_data_len, 69 const uint8_t **ie_data_ptr); 70 71 /** 72 * osif_connect_handler() - API to send connect response to kernel 73 * @vdev: vdev pointer 74 * @rsp: Connection manager connect response 75 * 76 * The API is used to send connection response to kernel 77 * 78 * Context: Any context. 79 * Return: QDF_STATUS 80 */ 81 QDF_STATUS osif_connect_handler(struct wlan_objmgr_vdev *vdev, 82 struct wlan_cm_connect_resp *rsp); 83 84 #ifdef CONN_MGR_ADV_FEATURE 85 /** 86 * osif_indicate_reassoc_results() - API to send reassoc response to kernel 87 * @vdev: vdev pointer 88 * @osif_priv: OS private structure of vdev 89 * @rsp: Connection manager response 90 * 91 * The API is used to send reassoc response to kernel 92 * 93 * Context: Any context. 94 * Return: QDF_STATUS 95 */ 96 void osif_indicate_reassoc_results(struct wlan_objmgr_vdev *vdev, 97 struct vdev_osif_priv *osif_priv, 98 struct wlan_cm_connect_resp *rsp); 99 100 /** 101 * @osif_pmksa_candidate_notify_cb: Roam pmksa candidate notify callback 102 * @vdev: vdev pointer 103 * @bssid: bssid 104 * @index: index 105 * @preauth: preauth flag 106 * 107 * Return: QDF_STATUS 108 */ 109 QDF_STATUS 110 osif_pmksa_candidate_notify(struct wlan_objmgr_vdev *vdev, 111 struct qdf_mac_addr *bssid, 112 int index, bool preauth); 113 #else 114 static inline void 115 osif_indicate_reassoc_results(struct wlan_objmgr_vdev *vdev, 116 struct vdev_osif_priv *osif_priv, 117 struct wlan_cm_connect_resp *rsp) 118 {} 119 #endif 120 121 /** 122 * osif_failed_candidate_handler() - API to indicate individual candidate 123 * connect failure resp 124 * @vdev: vdev pointer 125 * @rsp: Connection manager connect response for the candidate 126 * 127 * The API is is used indicate individual candidate connect failure resp for 128 * for tried all but last tried candidate. The last candidate will be sent in 129 * osif_connect_handler. 130 * 131 * Context: Any context. 132 * Return: QDF_STATUS 133 */ 134 QDF_STATUS osif_failed_candidate_handler(struct wlan_objmgr_vdev *vdev, 135 struct wlan_cm_connect_resp *rsp); 136 137 #endif /* __OSIF_CM_RSP_H */ 138