1 /*
2 * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2021-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 * DOC: wlan_cm_roam_i.h
22 *
23 * Implementation for the common roaming api interfaces.
24 */
25
26 #ifndef _WLAN_CM_ROAM_I_H_
27 #define _WLAN_CM_ROAM_I_H_
28
29 #include "qdf_types.h"
30 #include "wlan_objmgr_psoc_obj.h"
31 #include "wlan_objmgr_pdev_obj.h"
32 #include "wlan_objmgr_vdev_obj.h"
33 #include "connection_mgr/core/src/wlan_cm_main.h"
34 #include "wlan_cm_roam_public_struct.h"
35
36 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
37 /**
38 * cm_add_fw_roam_dummy_ser_cb() - Add dummy blocking command
39 * @pdev: pdev pointer
40 * @cm_ctx: connection mgr context
41 * @cm_req: connect req
42 *
43 * This function adds dummy blocking command with high priority to avoid
44 * any other vdev command till roam is completed.Any NB operations will be
45 * blocked in serialization until roam logic completes execution.
46 *
47 * Return: QDF_STATUS
48 */
49 QDF_STATUS
50 cm_add_fw_roam_dummy_ser_cb(struct wlan_objmgr_pdev *pdev,
51 struct cnx_mgr *cm_ctx,
52 struct cm_req *cm_req);
53 /**
54 * cm_fw_roam_start_req() - Post roam start req to CM SM
55 * @psoc: psoc pointer
56 * @vdev_id: vdev id
57 *
58 * This function posts roam start event change to connection manager
59 * state machine
60 *
61 * Return: QDF_STATUS
62 */
63 QDF_STATUS cm_fw_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
64 /**
65 * cm_fw_roam_abort_req() - Post roam abort req to CM SM
66 * @psoc: psoc pointer
67 * @vdev_id: vdev id
68 *
69 * This function posts roam abort event change to connection manager
70 * state machine
71 *
72 * Return: QDF_STATUS
73 */
74 QDF_STATUS cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
75
76 /**
77 * cm_update_scan_mlme_on_roam() - update the scan mlme info
78 * on roam sync ind
79 * @vdev: Object manager vdev
80 * @connected_bssid: Bssid addr
81 * @state: scan entry state
82 *
83 * Return: void
84 */
85 void
86 cm_update_scan_mlme_on_roam(struct wlan_objmgr_vdev *vdev,
87 struct qdf_mac_addr *connected_bssid,
88 enum scan_entry_connection_state state);
89
90 /**
91 * cm_abort_fw_roam() - abort fw roaming
92 *
93 * @cm_ctx: Connection mgr context
94 * @cm_id: CM command id
95 *
96 * Return: qdf status
97 */
98 QDF_STATUS cm_abort_fw_roam(struct cnx_mgr *cm_ctx,
99 wlan_cm_id cm_id);
100
101 /**
102 * cm_fw_roam_sync_req() - Post roam sync to CM SM
103 * @psoc: psoc pointer
104 * @vdev_id: vdev id
105 * @event: Vdev mgr event
106 * @event_data_len: data size
107 *
108 * This function posts roam sync event change to connection manager
109 * state machine
110 *
111 * Return: QDF_STATUS
112 */
113 QDF_STATUS cm_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
114 void *event, uint32_t event_data_len);
115
116 /**
117 * cm_fw_roam_sync_start_ind() - Handle roam sync req
118 * @vdev: Vdev objmgr
119 * @sync_ind: Roam sync ind
120 *
121 * This function handles roam sync event to connection manager
122 * state machine
123 *
124 * Return: QDF_STATUS
125 */
126 QDF_STATUS
127 cm_fw_roam_sync_start_ind(struct wlan_objmgr_vdev *vdev,
128 struct roam_offload_synch_ind *sync_ind);
129
130 /**
131 * cm_fw_roam_sync_propagation() - Post roam sync propagation to CM SM
132 * @psoc: psoc pointer
133 * @vdev_id: vdev id
134 * @roam_synch_data: Roam sync data ptr
135 *
136 * This function posts roam sync propagation event change to connection manager
137 * state machine
138 *
139 * Return: QDF_STATUS
140 */
141 QDF_STATUS
142 cm_fw_roam_sync_propagation(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
143 struct roam_offload_synch_ind *roam_synch_data);
144
145 /**
146 * cm_fw_ho_fail_req() - Post roam ho fail req to CM SM
147 * @psoc: psoc pointer
148 * @vdev_id: vdev id
149 * @bssid: bssid mac addr
150 *
151 * This function posts roam ho fail event change to
152 * connection manager state machine
153 *
154 * Return: void
155 */
156 void cm_fw_ho_fail_req(struct wlan_objmgr_psoc *psoc,
157 uint8_t vdev_id, struct qdf_mac_addr bssid);
158
159 /**
160 * cm_fw_roam_invoke_fail() - Post roam invoke fail to CM SM
161 * @psoc: psoc pointer
162 * @vdev_id: vdev id
163 *
164 * This function posts roam invoke fail event change to
165 * connection manager state machine
166 *
167 * Return: QDF_STATUS
168 */
169 QDF_STATUS cm_fw_roam_invoke_fail(struct wlan_objmgr_psoc *psoc,
170 uint8_t vdev_id);
171 #else /*WLAN_FEATURE_ROAM_OFFLOAD */
172 static inline
cm_fw_roam_invoke_fail(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)173 QDF_STATUS cm_fw_roam_invoke_fail(struct wlan_objmgr_psoc *psoc,
174 uint8_t vdev_id)
175 {
176 return QDF_STATUS_E_NOSUPPORT;
177 }
178 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
179 #endif /* _WLAN_CM_ROAM_I_H_ */
180