xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_ucfg_api.h (revision 97f44cd39e4ff816eaa1710279d28cf6b9e65ad9)
1 /*
2  * Copyright (c) 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_ucfg_api.h
19  *
20  * This file maintains declarations of public ucfg apis
21  */
22 
23 #ifndef __WLAN_CM_UCFG_API_H
24 #define __WLAN_CM_UCFG_API_H
25 
26 #ifdef FEATURE_CM_ENABLE
27 
28 #include <wlan_cm_api.h>
29 
30 /**
31  * ucfg_cm_start_connect() - connect start request
32  * @vdev: vdev pointer
33  * @req: connect req
34  *
35  * Return: QDF_STATUS
36  */
37 QDF_STATUS ucfg_cm_start_connect(struct wlan_objmgr_vdev *vdev,
38 				 struct wlan_cm_connect_req *req);
39 
40 /**
41  * ucfg_cm_start_disconnect() - disconnect start request
42  * @vdev: vdev pointer
43  * @req: disconnect req
44  *
45  * Return: QDF_STATUS
46  */
47 QDF_STATUS ucfg_cm_start_disconnect(struct wlan_objmgr_vdev *vdev,
48 				    struct wlan_cm_disconnect_req *req);
49 
50 /**
51  * ucfg_cm_disconnect_sync() - disconnect request with wait till
52  * completed
53  * @vdev: vdev pointer
54  * @source: disconnect source
55  * @reason_code: disconnect reason
56  *
57  * Context: Only call for north bound disconnect req, if wait till complete
58  * is required, e.g. during vdev delete. Do not call from scheduler context.
59  *
60  * Return: QDF_STATUS
61  */
62 QDF_STATUS ucfg_cm_disconnect_sync(struct wlan_objmgr_vdev *vdev,
63 				   enum wlan_cm_source source,
64 				   enum wlan_reason_code reason_code);
65 
66 /**
67  * ucfg_cm_is_vdev_connecting() - check if vdev is in conneting state
68  * @vdev: vdev pointer
69  *
70  * Return: bool
71  */
72 bool ucfg_cm_is_vdev_connecting(struct wlan_objmgr_vdev *vdev);
73 
74 /**
75  * ucfg_cm_is_vdev_connected() - check if vdev is in conneted state
76  * @vdev: vdev pointer
77  *
78  * Return: bool
79  */
80 bool ucfg_cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev);
81 
82 /**
83  * ucfg_cm_is_vdev_disconnecting() - check if vdev is in disconneting state
84  * @vdev: vdev pointer
85  *
86  * Return: bool
87  */
88 bool ucfg_cm_is_vdev_disconnecting(struct wlan_objmgr_vdev *vdev);
89 
90 /**
91  * ucfg_cm_is_vdev_disconnected() - check if vdev is disconnected/init state
92  * @vdev: vdev pointer
93  *
94  * Return: bool
95  */
96 bool ucfg_cm_is_vdev_disconnected(struct wlan_objmgr_vdev *vdev);
97 
98 /**
99  * ucfg_cm_is_vdev_roaming() - check if vdev is in roaming state
100  * @vdev: vdev pointer
101  *
102  * Return: bool
103  */
104 bool ucfg_cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev);
105 
106 /**
107  * ucfg_cm_reason_code_to_str() - return string conversion of reason code
108  * @reason: reason code.
109  *
110  * This utility function helps log string conversion of reason code.
111  *
112  * Return: string conversion of reason code, if match found;
113  *         "Unknown" otherwise.
114  */
115 static inline
116 const char *ucfg_cm_reason_code_to_str(enum wlan_reason_code reason)
117 {
118 	return wlan_cm_reason_code_to_str(reason);
119 }
120 
121 #endif
122 #endif /* __WLAN_CM_UCFG_API_H */
123 
124