xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mlme_api.h (revision dae10a5fbc53d54c53c4ba24fa018ad8b1e7c008)
1 /*
2  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: Define VDEV MLME public APIs
21  */
22 
23 #ifndef _WLAN_VDEV_MLME_API_H_
24 #define _WLAN_VDEV_MLME_API_H_
25 
26 /**
27  * wlan_vdev_mlme_get_cmpt_obj - Returns MLME component object
28  *
29  * Retrieves MLME component object from VDEV object
30  *
31  * Return: comp handle on SUCCESS
32  *         NULL, if it fails to retrieve
33  */
34 struct vdev_mlme_obj *wlan_vdev_mlme_get_cmpt_obj(
35 						struct wlan_objmgr_vdev *vdev);
36 /**
37  * wlan_vdev_mlme_get_legacy_hdl - Returns legacy handle
38  *
39  * Retrieves legacy handle from vdev mlme component object
40  *
41  * Return: legacy handle on SUCCESS
42  *         NULL, if it fails to retrieve
43  */
44 void *wlan_vdev_mlme_get_legacy_hdl(struct wlan_objmgr_vdev *vdev);
45 
46 #ifdef CMN_VDEV_MLME_SM_ENABLE
47 /**
48  * wlan_vdev_mlme_sm_deliver_evt() - Delivers event to VDEV MLME SM
49  * @vdev: Object manager VDEV object
50  * @event: MLME event
51  * @event_data_len: data size
52  * @event_data: event data
53  *
54  * API to dispatch event to VDEV MLME SM with lock acquired
55  *
56  * Return: SUCCESS: on handling event
57  *         FAILURE: on ignoring the event
58  */
59 QDF_STATUS wlan_vdev_mlme_sm_deliver_evt(struct wlan_objmgr_vdev *vdev,
60 					 enum wlan_vdev_sm_evt event,
61 					 uint16_t event_data_len,
62 					 void *event_data);
63 
64 /**
65  * wlan_vdev_mlme_sm_deliver_evt_sync() - Delivers event to VDEV MLME SM sync
66  * @vdev: Object manager VDEV object
67  * @event: MLME event
68  * @event_data_len: data size
69  * @event_data: event data
70  *
71  * API to dispatch event to VDEV MLME SM with lock acquired
72  *
73  * Return: SUCCESS: on handling event
74  *         FAILURE: on ignoring the event
75  */
76 QDF_STATUS wlan_vdev_mlme_sm_deliver_evt_sync(struct wlan_objmgr_vdev *vdev,
77 					      enum wlan_vdev_sm_evt event,
78 					      uint16_t event_data_len,
79 					      void *event_data);
80 
81 #ifdef SM_ENG_HIST_ENABLE
82 /**
83  * wlan_vdev_mlme_sm_history_print() - Prints SM history
84  * @vdev: Object manager VDEV object
85  *
86  * API to print SM history
87  *
88  * Return: void
89  */
90 void wlan_vdev_mlme_sm_history_print(struct wlan_objmgr_vdev *vdev);
91 
92 #endif
93 
94 /**
95  * wlan_vdev_allow_connect_n_tx() - Checks whether VDEV is in operational state
96  * @vdev: Object manager VDEV object
97  *
98  * API to checks the VDEV MLME SM state to allow tx or connections
99  *
100  * Return: SUCCESS: to allow tx or connection
101  *         FAILURE: otherwise failure
102  */
103 QDF_STATUS wlan_vdev_allow_connect_n_tx(struct wlan_objmgr_vdev *vdev);
104 
105 /**
106  * wlan_vdev_mlme_is_active() - Checks whether VDEV is in active state
107  * @vdev: Object manager VDEV object
108  *
109  * API to checks the VDEV MLME SM state to check channel is configured in FW
110  *
111  * Return: SUCCESS: valid channel is configured
112  *         FAILURE: otherwise failure
113  */
114 QDF_STATUS wlan_vdev_mlme_is_active(struct wlan_objmgr_vdev *vdev);
115 
116 /**
117  * wlan_vdev_chan_config_valid() - Checks whether VDEV chan config valid
118  * @vdev: Object manager VDEV object
119  *
120  * API to checks the VDEV MLME SM state to check channel is configured in Host
121  *
122  * Return: SUCCESS: valid channel is configured
123  *         FAILURE: otherwise failure
124  */
125 QDF_STATUS wlan_vdev_chan_config_valid(struct wlan_objmgr_vdev *vdev);
126 
127 /**
128  * wlan_vdev_is_going_down() - Checks whether VDEV is being brought down
129  * @vdev: Object manager VDEV object
130  *
131  * API to checks the VDEV MLME SM state to check VDEV is being brought down
132  *
133  * Return: SUCCESS: valid channel is configured
134  *         FAILURE: otherwise failure
135  */
136 QDF_STATUS wlan_vdev_is_going_down(struct wlan_objmgr_vdev *vdev);
137 #endif
138 #endif
139