xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.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 init/deinit APIs
21  */
22 
23 #ifndef _WLAN_VDEV_MLME_MAIN_H_
24 #define _WLAN_VDEV_MLME_MAIN_H_
25 
26 #ifdef CMN_VDEV_MLME_SM_ENABLE
27 /**
28  * enum wlan_vdev_state - VDEV state
29  * @WLAN_VDEV_S_INIT:                     Default state, IDLE state
30  * @WLAN_VDEV_S_START:                    START  state
31  * @WLAN_VDEV_S_DFS_CAC_WAIT:             CAC period
32  * @WLAN_VDEV_S_UP:                       UP state
33  * @WLAN_VDEV_S_SUSPEND:                  Suspend state
34  * @WLAN_VDEV_S_STOP:                     STOP state
35  * @WLAN_VDEV_S_MAX:                      MAX state
36  * @WLAN_VDEV_SS_START_START_PROGRESS:    Start progress sub state
37  * @WLAN_VDEV_SS_START_RESTART_PROGRESS:  Restart progress sub state
38  * @WLAN_VDEV_SS_START_CONN_PROGRESS:     Start connection progress sub state
39  * @WLAN_VDEV_SS_START_DISCONN_PROGRESS:  Start Disconnection progress sub state
40  * @WLAN_VDEV_SS_SUSPEND_SUSPEND_DOWN:    Suspend down sub state
41  * @WLAN_VDEV_SS_SUSPEND_SUSPEND_RESTART: Suspend restart sub state
42  * @WLAN_VDEV_SS_SUSPEND_HOST_RESTART:    Suspend host restart sub state
43  * @WLAN_VDEV_SS_SUSPEND_CSA_RESTART:     Suspend CSA restart sub state
44  * @WLAN_VDEV_SS_STOP_STOP_PROGRESS:      Stop progress sub state
45  * @WLAN_VDEV_SS_STOP_DOWN_PROGRESS:      Stop down progress sub state
46  * @WLAN_VDEV_SS_IDLE:                    Idle sub state (used, only if a state
47  *                                        does not have substate)
48  * @WLAN_VDEV_SS_MAX:                     Max substate
49  */
50 enum wlan_vdev_state {
51 	WLAN_VDEV_S_INIT = 0,
52 	WLAN_VDEV_S_START = 1,
53 	WLAN_VDEV_S_DFS_CAC_WAIT = 2,
54 	WLAN_VDEV_S_UP = 3,
55 	WLAN_VDEV_S_SUSPEND = 4,
56 	WLAN_VDEV_S_STOP = 5,
57 	WLAN_VDEV_S_MAX = 6,
58 	WLAN_VDEV_SS_START_START_PROGRESS = 7,
59 	WLAN_VDEV_SS_START_RESTART_PROGRESS = 8,
60 	WLAN_VDEV_SS_START_CONN_PROGRESS = 9,
61 	WLAN_VDEV_SS_START_DISCONN_PROGRESS = 10,
62 	WLAN_VDEV_SS_SUSPEND_SUSPEND_DOWN = 11,
63 	WLAN_VDEV_SS_SUSPEND_SUSPEND_RESTART = 12,
64 	WLAN_VDEV_SS_SUSPEND_HOST_RESTART = 13,
65 	WLAN_VDEV_SS_SUSPEND_CSA_RESTART = 14,
66 	WLAN_VDEV_SS_STOP_STOP_PROGRESS = 15,
67 	WLAN_VDEV_SS_STOP_DOWN_PROGRESS = 16,
68 	WLAN_VDEV_SS_IDLE = 17,
69 	WLAN_VDEV_SS_MAX = 18,
70 };
71 
72 /**
73  * enum wlan_vdev_sm_evt - VDEV SM event
74  * @WLAN_VDEV_SM_EV_START:               Start VDEV UP operation
75  * @WLAN_VDEV_SM_EV_START_REQ:           Invokes VDEV START handshake
76  * @WLAN_VDEV_SM_EV_RESTART_REQ:         Invokes VDEV RESTART handshake
77  * @WLAN_VDEV_SM_EV_START_RESP:          Notification on START resp
78  * @WLAN_VDEV_SM_EV_RESTART_RESP:        Notification on RESTART resp
79  * @WLAN_VDEV_SM_EV_START_REQ_FAIL:      Notification on START req failure
80  * @WLAN_VDEV_SM_EV_RESTART_REQ_FAIL:    Notification on RESTART req failure
81  * @WLAN_VDEV_SM_EV_START_SUCCESS:       Notification of Join Success
82  * @WLAN_VDEV_SM_EV_CONN_PROGRESS:       Invoke Connection/up process
83  * @WLAN_VDEV_SM_EV_STA_CONN_START:      Invoke Station Connection process
84  * @WLAN_VDEV_SM_EV_DFS_CAC_WAIT:        Invoke DFS CAC WAIT timer
85  * @WLAN_VDEV_SM_EV_DFS_CAC_COMPLETED:   Notifies on CAC completion
86  * @WLAN_VDEV_SM_EV_DOWN:                Invokes VDEV DOWN operation
87  * @WLAN_VDEV_SM_EV_CONNECTION_FAIL:     Notifications for UP/connection failure
88  * @WLAN_VDEV_SM_EV_STOP_RESP:           Notifcation of stop response
89  * @WLAN_VDEV_SM_EV_STOP_FAIL:           Notification of stop req failure
90  * @WLAN_VDEV_SM_EV_DOWN_FAIL:           Notification of down failure
91  * @WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE: Notification of Peer cleanup complete
92  * @WLAN_VDEV_SM_EV_SUPSEND_RESTART:     Invokes suspend restart operation
93  * @WLAN_VDEV_SM_EV_HOST_RESTART:        Invokes host only restart operation
94  * @WLAN_VDEV_SM_EV_UP_HOST_RESTART:     Moves to UP state without sending UP
95  *                                       command to lower layers
96  * @WLAN_VDEV_SM_EV_FW_VDEV_RESTART:     Invokes FW only restart
97  * @WLAN_VDEV_SM_EV_UP_FAIL:             Notification of up command failure
98  * @WLAN_VDEV_SM_EV_RADAR_DETECTED:      Notification of RADAR detected, Random
99  *                                       channel should be selected before
100  *                                       triggering this event
101  * @WLAN_VDEV_SM_EV_CSA_RESTART:         Invokes CSA IE operation
102  * @WLAN_VDEV_SM_EV_CSA_COMPLETE:        Notifiction of CSA process complete
103  * @WLAN_VDEV_SM_EV_MLME_DOWN_REQ:       Invoke DOWN command operation
104  * @WLAN_VDEV_SM_EV_DOWN_COMPLETE:       Notification of DOWN complete
105  */
106 enum wlan_vdev_sm_evt {
107 	WLAN_VDEV_SM_EV_START = 0,
108 	WLAN_VDEV_SM_EV_START_REQ,
109 	WLAN_VDEV_SM_EV_RESTART_REQ,
110 	WLAN_VDEV_SM_EV_START_RESP,
111 	WLAN_VDEV_SM_EV_RESTART_RESP,
112 	WLAN_VDEV_SM_EV_START_REQ_FAIL,
113 	WLAN_VDEV_SM_EV_RESTART_REQ_FAIL,
114 	WLAN_VDEV_SM_EV_START_SUCCESS,
115 	WLAN_VDEV_SM_EV_CONN_PROGRESS,
116 	WLAN_VDEV_SM_EV_STA_CONN_START,
117 	WLAN_VDEV_SM_EV_DFS_CAC_WAIT = 10,
118 	WLAN_VDEV_SM_EV_DFS_CAC_COMPLETED,
119 	WLAN_VDEV_SM_EV_DOWN,
120 	WLAN_VDEV_SM_EV_CONNECTION_FAIL,
121 	WLAN_VDEV_SM_EV_STOP_RESP,
122 	WLAN_VDEV_SM_EV_STOP_FAIL,
123 	WLAN_VDEV_SM_EV_DOWN_FAIL,
124 	WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE,
125 	WLAN_VDEV_SM_EV_SUPSEND_RESTART,
126 	WLAN_VDEV_SM_EV_HOST_RESTART,
127 	WLAN_VDEV_SM_EV_UP_HOST_RESTART = 20,
128 	WLAN_VDEV_SM_EV_FW_VDEV_RESTART,
129 	WLAN_VDEV_SM_EV_UP_FAIL,
130 	WLAN_VDEV_SM_EV_RADAR_DETECTED,
131 	WLAN_VDEV_SM_EV_CSA_RESTART,
132 	WLAN_VDEV_SM_EV_CSA_COMPLETE,
133 	WLAN_VDEV_SM_EV_MLME_DOWN_REQ,
134 	WLAN_VDEV_SM_EV_DOWN_COMPLETE,
135 };
136 
137 /**
138  * wlan_vdev_mlme_init - Initializes MLME component
139  *
140  * Registers callbacks with object manager for create/destroy
141  *
142  * Return: SUCCESS on successful registration
143  *         FAILURE, if registration fails
144  */
145 QDF_STATUS wlan_vdev_mlme_init(void);
146 
147 /**
148  * wlan_vdev_mlme_deinit - Uninitializes MLME component
149  *
150  * Unregisters callbacks with object manager for create/destroy
151  *
152  * Return: SUCCESS on successful registration
153  *         FAILURE, if registration fails
154  */
155 QDF_STATUS wlan_vdev_mlme_deinit(void);
156 
157 #else
158 
159 /**
160  * enum wlan_vdev_state - VDEV state
161  * @WLAN_VDEV_S_INIT:    Default state, IDLE state
162  * @WLAN_VDEV_S_SCAN:    SCAN state
163  * @WLAN_VDEV_S_JOIN:    Join state
164  * @WLAN_VDEV_S_DFS_WAIT:CAC period
165  * @WLAN_VDEV_S_RUN:     RUN state
166  * @WLAN_VDEV_S_STOP:    STOP state
167  * @WLAN_VDEV_S_RESET:   RESET state, STOP+INIT+JOIN
168  * @WLAN_VDEV_S_MAX:     MAX state
169  */
170 enum wlan_vdev_state {
171 	WLAN_VDEV_S_INIT     = 0,
172 	WLAN_VDEV_S_SCAN     = 1,
173 	WLAN_VDEV_S_JOIN     = 2,
174 	WLAN_VDEV_S_DFS_WAIT = 3,
175 	WLAN_VDEV_S_RUN      = 4,
176 	WLAN_VDEV_S_STOP     = 5,
177 	WLAN_VDEV_S_RESET    = 6,
178 	WLAN_VDEV_S_MAX,
179 };
180 
181 /**
182  * wlan_vdev_mlme_init - Initializes MLME component
183  *
184  * Registers callbacks with object manager for create/destroy
185  *
186  * Return: SUCCESS on successful registration
187  *         FAILURE, if registration fails
188  */
189 static inline QDF_STATUS wlan_vdev_mlme_init(void)
190 {
191 	return QDF_STATUS_SUCCESS;
192 }
193 
194 /**
195  * wlan_vdev_mlme_deinit - Uninitializes MLME component
196  *
197  * Unregisters callbacks with object manager for create/destroy
198  *
199  * Return: SUCCESS on successful registration
200  *         FAILURE, if registration fails
201  */
202 static inline QDF_STATUS wlan_vdev_mlme_deinit(void)
203 {
204 	return QDF_STATUS_SUCCESS;
205 }
206 #endif
207 #endif
208