xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_main_api.h (revision 45a38684b07295822dc8eba39e293408f203eec8)
1 /*
2  * Copyright (c) 2012-2015, 2020, 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: wlan_cm_main_api.h
19  *
20  * This header file maintain connect, disconnect APIs of connection manager
21  */
22 
23 #ifndef __WLAN_CM_MAIN_API_H__
24 #define __WLAN_CM_MAIN_API_H__
25 
26 #include "wlan_cm_main.h"
27 
28 /*************** CONNECT APIs ****************/
29 /**
30  * cm_connect_start() - This API will be called to initiate the connect
31  * process
32  * @cm_ctx: connection manager context
33  * @req: Connect request.
34  *
35  * Return: QDF status
36  */
37 QDF_STATUS cm_connect_start(struct cnx_mgr *cm_ctx, struct cm_connect_req *req);
38 
39 /**
40  * cm_connect_scan_start() - This API will be called to initiate the connect
41  * scan if no candidate are found in scan db.
42  * @cm_ctx: connection manager context
43  * @req: Connect request.
44  *
45  * Return: QDF status
46  */
47 QDF_STATUS cm_connect_scan_start(struct cnx_mgr *cm_ctx,
48 				 struct cm_connect_req *req);
49 
50 /**
51  * cm_connect_scan_resp() - Handle the connect scan resp and next action
52  * scan if no candidate are found in scan db.
53  * @scan_id: scan id of the req
54  * @status: Connect scan status
55  *
56  * Return: QDF status
57  */
58 QDF_STATUS cm_connect_scan_resp(struct cnx_mgr *cm_ctx, wlan_scan_id *scan_id,
59 				QDF_STATUS status);
60 
61 /**
62  * cm_connect_active() - This API would be called after the connect
63  * request gets activated in serialization.
64  * @cm_ctx: connection manager context
65  * @cm_id: Connection mgr ID assigned to this connect request.
66  *
67  * Return: QDF status
68  */
69 QDF_STATUS cm_connect_active(struct cnx_mgr *cm_ctx, wlan_cm_id *cm_id);
70 
71 /**
72  * cm_try_next_candidate() - This API would try to connect to next valid
73  * candidate and fail if no candidate left
74  * request gets activated in serialization.
75  * @cm_ctx: connection manager context
76  * @connect_resp: connect resp.
77  *
78  * Return: QDF status
79  */
80 QDF_STATUS cm_try_next_candidate(struct cnx_mgr *cm_ctx,
81 				 struct wlan_cm_connect_rsp *connect_resp);
82 
83 /**
84  * cm_connect_cmd_timeout() - Called if active connect command timeout
85  * @cm_ctx: connection manager context
86  * @cm_id: Connection mgr ID assigned to this connect request.
87  *
88  * Return: QDF status
89  */
90 QDF_STATUS cm_connect_cmd_timeout(struct cnx_mgr *cm_ctx, wlan_cm_id cm_id);
91 
92 /**
93  * cm_connect_complete() - This API would be called after connect complete
94  * request from the serialization.
95  * @cm_ctx: connection manager context
96  * @resp: Connection complete resp.
97  *
98  * This API would be called after connection completion resp from VDEV mgr
99  *
100  * Return: QDF status
101  */
102 QDF_STATUS cm_connect_complete(struct cnx_mgr *cm_ctx,
103 			       struct wlan_cm_connect_rsp *resp);
104 
105 /**
106  * cm_connect_start_req() - Connect start req from the requester
107  * @vdev: vdev on which connect is received
108  * @req: Connection req provided
109  *
110  * Return: QDF status
111  */
112 QDF_STATUS cm_connect_start_req(struct wlan_objmgr_vdev *vdev,
113 				struct wlan_cm_connect_req *req);
114 
115 /*************** DISCONNECT APIs ****************/
116 
117 /**
118  * cm_disconnect_start() - Initiate the disconnect process
119  * @cm_ctx: connection manager context
120  * @req: Disconnect request.
121  *
122  * Return: QDF status
123  */
124 QDF_STATUS cm_disconnect_start(struct cnx_mgr *cm_ctx,
125 			       struct cm_disconnect_req *req);
126 
127 /**
128  * cm_disconnect_active() - This API would be called after the disconnect
129  * request gets activated in serialization.
130  * @cm_ctx: connection manager context
131  * @cm_id: Connection mgr ID assigned to this connect request.
132  *
133  * Return: QDF status
134  */
135 QDF_STATUS cm_disconnect_active(struct cnx_mgr *cm_ctx, wlan_cm_id *cm_id);
136 
137 /**
138  * cm_disconnect_complete() - This API would be called after disconnect complete
139  * request from the serialization.
140  * @cm_ctx: connection manager context
141  * @resp: disconnection complete resp.
142  *
143  * This API would be called after connection completion resp from VDEV mgr
144  *
145  * Return: QDF status
146  */
147 QDF_STATUS cm_disconnect_complete(struct cnx_mgr *cm_ctx,
148 				  struct wlan_cm_discon_rsp *resp);
149 
150 /**
151  * cm_disconnect_start_req() - Disconnect start req from the requester
152  * @vdev: vdev on which connect is received
153  * @req: disconnection req provided
154  *
155  * Return: QDF status
156  */
157 QDF_STATUS cm_disconnect_start_req(struct wlan_objmgr_vdev *vdev,
158 				   struct wlan_cm_disconnect_req *req);
159 
160 #endif /* __WLAN_CM_MAIN_API_H__ */
161