xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.h (revision 1397a33f48ea6455be40871470b286e535820eb8)
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  * @WLAN_VDEV_SM_EV_ROAM:                Notifiction on ROAMING
106  */
107 enum wlan_vdev_sm_evt {
108 	WLAN_VDEV_SM_EV_START = 0,
109 	WLAN_VDEV_SM_EV_START_REQ = 1,
110 	WLAN_VDEV_SM_EV_RESTART_REQ = 2,
111 	WLAN_VDEV_SM_EV_START_RESP = 3,
112 	WLAN_VDEV_SM_EV_RESTART_RESP = 4,
113 	WLAN_VDEV_SM_EV_START_REQ_FAIL = 5,
114 	WLAN_VDEV_SM_EV_RESTART_REQ_FAIL = 6,
115 	WLAN_VDEV_SM_EV_START_SUCCESS = 7,
116 	WLAN_VDEV_SM_EV_CONN_PROGRESS = 8,
117 	WLAN_VDEV_SM_EV_STA_CONN_START = 9,
118 	WLAN_VDEV_SM_EV_DFS_CAC_WAIT = 10,
119 	WLAN_VDEV_SM_EV_DFS_CAC_COMPLETED = 11,
120 	WLAN_VDEV_SM_EV_DOWN = 12,
121 	WLAN_VDEV_SM_EV_CONNECTION_FAIL = 13,
122 	WLAN_VDEV_SM_EV_STOP_RESP = 14,
123 	WLAN_VDEV_SM_EV_STOP_FAIL = 15,
124 	WLAN_VDEV_SM_EV_DOWN_FAIL = 16,
125 	WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE = 17,
126 	WLAN_VDEV_SM_EV_SUPSEND_RESTART = 18,
127 	WLAN_VDEV_SM_EV_HOST_RESTART = 19,
128 	WLAN_VDEV_SM_EV_UP_HOST_RESTART = 20,
129 	WLAN_VDEV_SM_EV_FW_VDEV_RESTART = 21,
130 	WLAN_VDEV_SM_EV_UP_FAIL = 22,
131 	WLAN_VDEV_SM_EV_RADAR_DETECTED = 23,
132 	WLAN_VDEV_SM_EV_CSA_RESTART = 24,
133 	WLAN_VDEV_SM_EV_CSA_COMPLETE = 25,
134 	WLAN_VDEV_SM_EV_MLME_DOWN_REQ = 26,
135 	WLAN_VDEV_SM_EV_DOWN_COMPLETE = 27,
136 	WLAN_VDEV_SM_EV_ROAM = 28,
137 };
138 
139 #else
140 
141 /**
142  * enum wlan_vdev_state - VDEV state
143  * @WLAN_VDEV_S_INIT:    Default state, IDLE state
144  * @WLAN_VDEV_S_SCAN:    SCAN state
145  * @WLAN_VDEV_S_JOIN:    Join state
146  * @WLAN_VDEV_S_DFS_WAIT:CAC period
147  * @WLAN_VDEV_S_RUN:     RUN state
148  * @WLAN_VDEV_S_STOP:    STOP state
149  * @WLAN_VDEV_S_RESET:   RESET state, STOP+INIT+JOIN
150  * @WLAN_VDEV_S_MAX:     MAX state
151  */
152 enum wlan_vdev_state {
153 	WLAN_VDEV_S_INIT     = 0,
154 	WLAN_VDEV_S_SCAN     = 1,
155 	WLAN_VDEV_S_JOIN     = 2,
156 	WLAN_VDEV_S_DFS_WAIT = 3,
157 	WLAN_VDEV_S_RUN      = 4,
158 	WLAN_VDEV_S_STOP     = 5,
159 	WLAN_VDEV_S_RESET    = 6,
160 	WLAN_VDEV_S_MAX,
161 };
162 #endif
163 
164 #ifdef CMN_VDEV_MLME_CMPT_ENABLE
165 
166 /**
167  * wlan_vdev_mlme_init - Initializes MLME component
168  *
169  * Registers callbacks with object manager for create/destroy
170  *
171  * Return: SUCCESS on successful registration
172  *         FAILURE, if registration fails
173  */
174 QDF_STATUS wlan_vdev_mlme_init(void);
175 
176 /**
177  * wlan_vdev_mlme_deinit - Uninitializes MLME component
178  *
179  * Unregisters callbacks with object manager for create/destroy
180  *
181  * Return: SUCCESS on successful registration
182  *         FAILURE, if registration fails
183  */
184 QDF_STATUS wlan_vdev_mlme_deinit(void);
185 
186 #else
187 
188 /**
189  * wlan_vdev_mlme_init - Initializes MLME component
190  *
191  * Registers callbacks with object manager for create/destroy
192  *
193  * Return: SUCCESS on successful registration
194  *         FAILURE, if registration fails
195  */
196 static inline QDF_STATUS wlan_vdev_mlme_init(void)
197 {
198 	return QDF_STATUS_SUCCESS;
199 }
200 
201 /**
202  * wlan_vdev_mlme_deinit - Uninitializes MLME component
203  *
204  * Unregisters callbacks with object manager for create/destroy
205  *
206  * Return: SUCCESS on successful registration
207  *         FAILURE, if registration fails
208  */
209 static inline QDF_STATUS wlan_vdev_mlme_deinit(void)
210 {
211 	return QDF_STATUS_SUCCESS;
212 }
213 #endif
214 #endif
215