xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/serialization/inc/wlan_serialization_api.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
1 /*
2  * Copyright (c) 2017-2019 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: wlan_serialization_api.h
21  * This file provides prototypes of the routines needed for the
22  * external components to utilize the services provided by the
23  * serialization component.
24  */
25 
26 /* Include files */
27 #ifndef __WLAN_SERIALIZATION_API_H
28 #define __WLAN_SERIALIZATION_API_H
29 
30 #include <qdf_status.h>
31 #include <wlan_objmgr_cmn.h>
32 
33 /* Preprocessor Definitions and Constants */
34 
35 /**
36  * enum ser_queue_reason- reason for changes to serialization queue
37  * @: SER_REQUEST: queue updated for serialization request
38  * @: SER_REMOVE : queue updated for serialization remove request
39  * @: SER_CANCEL : queue updated for serialization cancel request
40  * @: SER_TIMEOUT : queue updated for command timeout
41  * @: SER_ACTIVATION_FAILED : queue updated since command activation failed
42  * @: SER_PENDING_TO_ACTIVE : queue updated for pending to active movement
43  */
44 enum ser_queue_reason {
45 	SER_REQUEST,
46 	SER_REMOVE,
47 	SER_CANCEL,
48 	SER_TIMEOUT,
49 	SER_ACTIVATION_FAILED,
50 	SER_PENDING_TO_ACTIVE,
51 	SER_QUEUE_ACTION_MAX,
52 };
53 
54 /*
55  * struct wlan_serialization_queued_cmd_info member queue_type specifies the
56  * below values to cancel the commands in these queues. Setting both the
57  * bits will cancel the commands in both the queues.
58  */
59 #define WLAN_SERIALIZATION_ACTIVE_QUEUE  0x1
60 #define WLAN_SERIALIZATION_PENDING_QUEUE 0x2
61 
62 /**
63  * enum wlan_serialization_cb_reason - reason for calling the callback
64  * @WLAN_SERIALIZATION_REASON_ACTIVATE_CMD: activate the cmd by sending it to FW
65  * @WLAN_SERIALIZATION_REASON_CANCEL_CMD: Cancel the cmd in the pending list
66  * @WLAN_SERIALIZATION_REASON_RELEASE_MEM_CMD:cmd execution complete. Release
67  *                                           the memory allocated while
68  *                                           building the command
69  * @WLAN_SER_CB_ACTIVE_CMD_TIMEOUT: active cmd has been timeout.
70  */
71 enum wlan_serialization_cb_reason {
72 	WLAN_SER_CB_ACTIVATE_CMD,
73 	WLAN_SER_CB_CANCEL_CMD,
74 	WLAN_SER_CB_RELEASE_MEM_CMD,
75 	WLAN_SER_CB_ACTIVE_CMD_TIMEOUT,
76 };
77 
78 /**
79  * struct wlan_serialization_scan_info - Information needed for scan cmd
80  * @is_cac_in_progress: boolean to check the cac status
81  * @is_tdls_in_progress: boolean to check the tdls status
82  * @is_mlme_op_in_progress: boolean to check the mlme op status
83  *
84  * This information is needed for scan command from other components
85  * to apply the rules and check whether the cmd is allowed or not
86  */
87 struct wlan_serialization_scan_info {
88 	bool is_cac_in_progress;
89 	bool is_tdls_in_progress;
90 	bool is_mlme_op_in_progress;
91 };
92 
93 /**
94  * union wlan_serialization_rules_info - union of all rules info structures
95  * @scan_info: information needed to apply rules on scan command
96  */
97 union wlan_serialization_rules_info {
98 	struct wlan_serialization_scan_info scan_info;
99 };
100 
101 struct wlan_serialization_command;
102 
103 /**
104  * wlan_serialization_cmd_callback() - Callback registered by the component
105  * @wlan_cmd: Command passed by the component for serialization
106  * @reason: Reason code for which the callback is being called
107  *
108  * Reason specifies the reason for which the callback is being called. callback
109  * should return success or failure based up on overall success of callback.
110  * if callback returns failure then serialization will remove the command from
111  * active queue and proceed for next pending command.
112  *
113  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE
114  */
115 typedef QDF_STATUS
116 (*wlan_serialization_cmd_callback)(struct wlan_serialization_command *wlan_cmd,
117 				   enum wlan_serialization_cb_reason reason);
118 
119 /**
120  * wlan_serialization_comp_info_cb() - callback to fill the rules information
121  * @vdev: VDEV object for which the command has been received
122  * @comp_info: Information filled by the component
123  *
124  * This callback is registered dynamically by the component with the
125  * serialization component. Serialization component invokes the callback
126  * while applying the rules for a particular command and the component
127  * fills in the required information to apply the rules
128  *
129  * Return: None
130  */
131 typedef void (*wlan_serialization_comp_info_cb)(struct wlan_objmgr_vdev *vdev,
132 		union wlan_serialization_rules_info *comp_info);
133 
134 /**
135  * wlan_serialization_apply_rules_cb() - callback per command to apply rules
136  * @comp_info: information needed to apply the rules
137  *
138  * The rules are applied using this callback and decided whether to
139  * allow or deny the command
140  *
141  * Return: true, if rules are successful and cmd can be queued
142  *         false, if rules failed and cmd should not be queued
143  */
144 typedef bool (*wlan_serialization_apply_rules_cb)(
145 		union wlan_serialization_rules_info *comp_info,
146 		uint8_t comp_id);
147 
148 /**
149  * wlan_ser_umac_cmd_cb() - callback to validate umac_cmd
150  * @umac_cmd: umac data associated with the serialization cmd
151  *
152  * This callback can be called at run time for a command in active queue to
153  * fetch the required information from the umac cmd data stored in serialization
154  * command buffer.
155  *
156  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE
157  */
158 typedef QDF_STATUS (*wlan_ser_umac_cmd_cb)(void *umac_cmd);
159 
160 /**
161  * enum wlan_umac_cmd_id - Command Type
162  * @WLAN_SER_CMD_SCAN:     Scan command
163  */
164 enum wlan_serialization_cmd_type {
165 	/* all scan command before non-scan */
166 	WLAN_SER_CMD_SCAN,
167 	/* all non-scan command below */
168 	WLAN_SER_CMD_NONSCAN,
169 	WLAN_SER_CMD_HDD_ISSUE_REASSOC_SAME_AP,
170 	WLAN_SER_CMD_SME_ISSUE_REASSOC_SAME_AP,
171 	WLAN_SER_CMD_SME_ISSUE_DISASSOC_FOR_HANDOFF,
172 	WLAN_SER_CMD_SME_ISSUE_ASSOC_TO_SIMILAR_AP,
173 	WLAN_SER_CMD_FORCE_IBSS_LEAVE,
174 	WLAN_SER_CMD_SME_ISSUE_FT_REASSOC,
175 	WLAN_SER_CMD_FORCE_DISASSOC_STA,
176 	WLAN_SER_CMD_FORCE_DEAUTH_STA,
177 	WLAN_SER_CMD_PERFORM_PRE_AUTH,
178 	WLAN_SER_CMD_WM_STATUS_CHANGE,
179 	WLAN_SER_CMD_NDP_INIT_REQ,
180 	WLAN_SER_CMD_NDP_RESP_REQ,
181 	WLAN_SER_CMD_NDP_DATA_END_INIT_REQ,
182 	WLAN_SER_CMD_NDP_END_ALL_REQ,
183 	WLAN_SER_CMD_ADDTS,
184 	WLAN_SER_CMD_DELTS,
185 	WLAN_SER_CMD_TDLS_SEND_MGMT,
186 	WLAN_SER_CMD_TDLS_ADD_PEER,
187 	WLAN_SER_CMD_TDLS_DEL_PEER,
188 	WLAN_SER_CMD_SET_HW_MODE,
189 	WLAN_SER_CMD_NSS_UPDATE,
190 	WLAN_SER_CMD_SET_DUAL_MAC_CONFIG,
191 	WLAN_SER_CMD_SET_ANTENNA_MODE,
192 	WLAN_SER_CMD_DEL_STA_SESSION,
193 	WLAN_SER_CMD_VDEV_START_BSS,
194 	WLAN_SER_CMD_VDEV_STOP_BSS,
195 	WLAN_SER_CMD_VDEV_CONNECT,
196 	WLAN_SER_CMD_VDEV_DISCONNECT,
197 	WLAN_SER_CMD_VDEV_RESTART,
198 	WLAN_SER_CMD_MAX
199 };
200 
201 /**
202  * enum wlan_serialization_cancel_type - Type of commands to be cancelled
203  * @WLAN_SER_CANCEL_SINGLE_SCAN: Cancel a single scan with a given ID
204  * @WLAN_SER_CANCEL_PDEV_SCANS: Cancel all the scans on a given pdev
205  * @WLAN_SER_CANCEL_VDEV_SCANS: Cancel all the scans on given vdev
206  * @WLAN_SER_CANCEL_PDEV_NON_SCAN_CMD: Cancel all non scans on a given pdev
207  * @WLAN_SER_CANCEL_VDEV_NON_SCAN_CMD: Cancel all non scans on a given vdev
208  * @WLAN_SER_CANCEL_VDEV_NON_SCAN_CMD_TYPE: Cancel all non scans on a given vdev
209  * and matching cmd type
210  * @WLAN_SER_CANCEL_NON_SCAN_CMD: Cancel the given non scan command
211  */
212 enum wlan_serialization_cancel_type {
213 	WLAN_SER_CANCEL_SINGLE_SCAN,
214 	WLAN_SER_CANCEL_PDEV_SCANS,
215 	WLAN_SER_CANCEL_VDEV_SCANS,
216 	WLAN_SER_CANCEL_PDEV_NON_SCAN_CMD,
217 	WLAN_SER_CANCEL_VDEV_NON_SCAN_CMD,
218 	WLAN_SER_CANCEL_VDEV_NON_SCAN_CMD_TYPE,
219 	WLAN_SER_CANCEL_NON_SCAN_CMD,
220 	WLAN_SER_CANCEL_MAX,
221 };
222 
223 /**
224  * enum wlan_serialization_status - Return status of cmd serialization request
225  * @WLAN_SER_CMD_PENDING: Command is put into the pending queue
226  * @WLAN_SER_CMD_ACTIVE: Command is activated and put in active queue
227  * @WLAN_SER_CMD_DENIED_RULES_FAILED: Command denied as the rules fail
228  * @WLAN_SER_CMD_DENIED_LIST_FULL: Command denied as the pending list is full
229  * @WLAN_SER_CMD_QUEUE_DISABLED: Command denied as the queue is disabled
230  * @WLAN_SER_CMD_ALREADY_EXISTS: Command already exists in the queue
231  * @WLAN_SER_CMD_DENIED_UNSPECIFIED: Command denied due to unknown reason
232  */
233 enum wlan_serialization_status {
234 	WLAN_SER_CMD_PENDING,
235 	WLAN_SER_CMD_ACTIVE,
236 	WLAN_SER_CMD_DENIED_RULES_FAILED,
237 	WLAN_SER_CMD_DENIED_LIST_FULL,
238 	WLAN_SER_CMD_QUEUE_DISABLED,
239 	WLAN_SER_CMD_ALREADY_EXISTS,
240 	WLAN_SER_CMD_DENIED_UNSPECIFIED,
241 };
242 
243 /**
244  * enum wlan_serialization_cmd_status - Return status for a cancel request
245  * @WLAN_SER_CMD_IN_PENDING_LIST: Command cancelled from pending list
246  * @WLAN_SER_CMD_IN_ACTIVE_LIST: Command cancelled from active list
247  * @WLAN_SER_CMDS_IN_ALL_LISTS: Command cancelled from all lists
248  * @WLAN_SER_CMD_NOT_FOUND: Specified command to be cancelled
249  *                                    not found in the lists
250  */
251 enum wlan_serialization_cmd_status {
252 	WLAN_SER_CMD_IN_PENDING_LIST,
253 	WLAN_SER_CMD_IN_ACTIVE_LIST,
254 	WLAN_SER_CMDS_IN_ALL_LISTS,
255 	WLAN_SER_CMD_MARKED_FOR_ACTIVATION,
256 	WLAN_SER_CMD_NOT_FOUND,
257 };
258 
259 /**
260  * struct wlan_serialization_command - Command to be serialized
261  * @wlan_serialization_cmd_type: Type of command
262  * @cmd_id: Command Identifier
263  * @cmd_cb: Command callback
264  * @source: component ID of the source of the command
265  * @is_high_priority: Normal/High Priority at which the cmd has to be queued
266  * @is_blocking: Is the command blocking
267  * @queue_disable: Should the command disable the queues
268  * @activation_reason: reason the activation cb was called
269  * @cmd_timeout_cb: Command timeout callback
270  * @cmd_timeout_duration: Timeout duration in milliseconds
271  * @vdev: VDEV object associated to the command
272  * @umac_cmd: Actual command that needs to be sent to WMI/firmware
273  *
274  * Note: Unnamed union has been used in this structure, so that in future if
275  * somebody wants to add pdev or psoc structure then that person can add without
276  * modifying existing code.
277  */
278 struct wlan_serialization_command {
279 	enum wlan_serialization_cmd_type cmd_type;
280 	uint32_t cmd_id;
281 	wlan_serialization_cmd_callback cmd_cb;
282 	enum wlan_umac_comp_id source;
283 	uint8_t is_high_priority:1,
284 		is_blocking:1,
285 		queue_disable:1,
286 		activation_reason:3;
287 	uint32_t cmd_timeout_duration;
288 	union {
289 		struct wlan_objmgr_vdev *vdev;
290 	};
291 	void *umac_cmd;
292 };
293 
294 /**
295  * struct wlan_serialization_queued_cmd_info  - cmd that has to be cancelled
296  * @requestor: component ID of the source requesting this action
297  * @cmd_type: Command type
298  * @cmd_id: Command ID
299  * @req_type: Commands that need to be cancelled
300  * @vdev: VDEV object associated to the command
301  * @queue_type: Queues from which the command to be cancelled
302  */
303 struct wlan_serialization_queued_cmd_info {
304 	enum wlan_umac_comp_id requestor;
305 	enum wlan_serialization_cmd_type cmd_type;
306 	uint32_t cmd_id;
307 	enum wlan_serialization_cancel_type req_type;
308 	union {
309 		struct wlan_objmgr_vdev *vdev;
310 	};
311 	uint8_t queue_type;
312 };
313 
314 /**
315  * wlan_serialization_cancel_request() - Request to cancel a command
316  * @req: Request information
317  *
318  * This API is used by external components to cancel a command
319  * that is either in the pending or active queue. Based on the
320  * req_type, it is decided whether to use pdev or vdev
321  * object. For all non-scan commands, it will be pdev.
322  *
323  * Return: Status specifying the removal of a command from a certain queue
324  */
325 enum wlan_serialization_cmd_status
326 wlan_serialization_cancel_request(
327 		struct wlan_serialization_queued_cmd_info *req);
328 
329 /**
330  * wlan_serialization_remove_cmd() - Request to release a command
331  * @cmd: Command information
332  *
333  * This API is used to release a command sitting in the active
334  * queue upon successful completion of the command
335  *
336  * Return: None
337  */
338 void wlan_serialization_remove_cmd(
339 		struct wlan_serialization_queued_cmd_info *cmd);
340 
341 /**
342  * wlan_serialization_flush_cmd() - Request to flush command
343  * @cmd: Command information
344  *
345  * This API is used to flush a cmd sitting in the queue. It
346  * simply flushes the cmd from the queue and does not call
347  * any callbacks in between. If the request is for active
348  * queue, and if the active queue becomes empty upon flush,
349  * then it will pick the next pending cmd and put in the active
350  * queue before returning.
351  *
352  * Return: None
353  */
354 void wlan_serialization_flush_cmd(
355 		struct wlan_serialization_queued_cmd_info *cmd);
356 
357 /**
358  * wlan_serialization_update_timer() -Update timer for an active command
359  * @cmd: Command information
360  *
361  * Return: Status of the timer update
362  */
363 QDF_STATUS
364 wlan_serialization_update_timer(struct wlan_serialization_command *cmd);
365 
366 /**
367  * wlan_serialization_request() - Request to serialize a command
368  * @cmd: Command information
369  *
370  * Return: Status of the serialization request
371  */
372 enum wlan_serialization_status
373 wlan_serialization_request(struct wlan_serialization_command *cmd);
374 
375 /**
376  * wlan_serialization_register_comp_info_cb() - Register component's info cb
377  * @psoc: PSOC object information
378  * @comp_id: Component ID
379  * @cmd_type: Command Type
380  * @cb: Callback
381  *
382  * This is called from component during its initialization.It initializes
383  * callback handler for given comp_id/cmd_id in a 2-D array.
384  *
385  * Return: QDF Status
386  */
387 QDF_STATUS
388 wlan_serialization_register_comp_info_cb(
389 		struct wlan_objmgr_psoc *psoc,
390 		enum wlan_umac_comp_id comp_id,
391 		enum wlan_serialization_cmd_type cmd_type,
392 		wlan_serialization_comp_info_cb cb);
393 
394 /**
395  * wlan_serialization_deregister_comp_info_cb() - Deregister component's info
396  *						callback
397  * @psoc: PSOC object information
398  * @comp_id: Component ID
399  * @cmd_type: Command Type
400  *
401  * This routine is called from other component during its de-initialization.
402  *
403  * Return: QDF Status
404  */
405 QDF_STATUS
406 wlan_serialization_deregister_comp_info_cb(
407 		struct wlan_objmgr_psoc *psoc,
408 		enum wlan_umac_comp_id comp_id,
409 		enum wlan_serialization_cmd_type cmd_type);
410 
411 /**
412  * wlan_serialization_register_apply_rules_cb() - Register component's rules
413  *						callback
414  * @psoc: PSOC object information
415  * @cmd_type: Command Type
416  * @cb: Callback
417  *
418  * This is called from component during its initialization.It initializes
419  * callback handler for given cmd_type in a 1-D array.
420  *
421  * Return: QDF Status
422  */
423 QDF_STATUS
424 wlan_serialization_register_apply_rules_cb(
425 		struct wlan_objmgr_psoc *psoc,
426 		enum wlan_serialization_cmd_type cmd_type,
427 		wlan_serialization_apply_rules_cb apply_rules_cb);
428 
429 /**
430  * wlan_serialization_deregister_apply_rules_cb() - Deregister component's rules
431  *						callback
432  * @psoc: PSOC object information
433  * @cmd_type: Command Type
434  *
435  * This routine is called from other component during its de-initialization.
436  *
437  * Return: QDF Status
438  */
439 QDF_STATUS
440 wlan_serialization_deregister_apply_rules_cb(
441 		struct wlan_objmgr_psoc *psoc,
442 		enum wlan_serialization_cmd_type cmd_type);
443 
444 /**
445  * @wlan_serialization_init() - Serialization component initialization routine
446  *
447  * Return - QDF Status
448  */
449 QDF_STATUS wlan_serialization_init(void);
450 
451 /**
452  * @wlan_serialization_deinit() - Serialization component de-init routine
453  *
454  * Return - QDF Status
455  */
456 QDF_STATUS wlan_serialization_deinit(void);
457 
458 /**
459  * @wlan_serialization_psoc_enable() - Serialization component enable routine
460  *
461  * Return - QDF Status
462  */
463 QDF_STATUS wlan_serialization_psoc_enable(struct wlan_objmgr_psoc *psoc);
464 
465 /**
466  * @wlan_serialization_psoc_disable() - Serialization component disable routine
467  *
468  * Return - QDF Status
469  */
470 QDF_STATUS wlan_serialization_psoc_disable(struct wlan_objmgr_psoc *psoc);
471 
472 /**
473  * wlan_serialization_vdev_scan_status() - Return the status of the vdev scan
474  * @vdev: VDEV Object
475  *
476  * Return: Status of the scans for the corresponding vdev
477  */
478 enum wlan_serialization_cmd_status
479 wlan_serialization_vdev_scan_status(struct wlan_objmgr_vdev *vdev);
480 
481 /**
482  * wlan_serialization_pdev_scan_status() - Return the status of the pdev scan
483  * @pdev: PDEV Object
484  *
485  * Return: Status of the scans for the corresponding pdev
486  */
487 enum wlan_serialization_cmd_status
488 wlan_serialization_pdev_scan_status(struct wlan_objmgr_pdev *pdev);
489 
490 /**
491  * wlan_serialization_non_scan_cmd_status() - Return status of pdev non-scan cmd
492  * @pdev: PDEV Object
493  * @cmd_id: ID of the command for which the status has to be checked
494  *
495  * Return: Status of the command for the corresponding pdev
496  */
497 enum wlan_serialization_cmd_status
498 wlan_serialization_non_scan_cmd_status(struct wlan_objmgr_pdev *pdev,
499 				       enum wlan_serialization_cmd_type cmd_id);
500 
501 /**
502  * wlan_serialization_is_cmd_present_in_pending_queue() - Return if the command
503  *				is already present in pending queue
504  * @cmd: pointer to serialization command to check
505  *
506  * This API will check if command is present in pending queue. If present
507  * then return true, so use know that it is duplicated command
508  *
509  * Return: true or false
510  */
511 bool wlan_serialization_is_cmd_present_in_pending_queue(
512 		struct wlan_objmgr_psoc *psoc,
513 		struct wlan_serialization_command *cmd);
514 /**
515  * wlan_serialization_is_cmd_present_in_active_queue() - Return if the command
516  *			is already present in active queue
517  * @cmd: pointer to serialization command to check
518  *
519  * This API will check if command is present in active queue. If present
520  * then return true, so use know that it is duplicated command
521  *
522  * Return: true or false
523  */
524 bool wlan_serialization_is_cmd_present_in_active_queue(
525 		struct wlan_objmgr_psoc *psoc,
526 		struct wlan_serialization_command *cmd);
527 
528 /**
529  * wlan_serialization_get_scan_cmd_using_scan_id() - Return command which
530  *					matches vdev_id and scan_id
531  * @psoc: pointer to soc
532  * @vdev_id: vdev id to pull vdev object
533  * @scan_id: scan id to match
534  * @is_scan_cmd_from_active_queue: to indicate active or pending queue
535  *
536  * This API fetches vdev/pdev object based on vdev_id, loops through scan
537  * command queue and find the command which matches scan id as well as vdev
538  * object.
539  *
540  * Return: pointer to serialization command
541  */
542 struct wlan_serialization_command*
543 wlan_serialization_get_scan_cmd_using_scan_id(
544 		struct wlan_objmgr_psoc *psoc,
545 		uint8_t vdev_id, uint16_t scan_id,
546 		uint8_t is_scan_cmd_from_active_queue);
547 /**
548  * wlan_serialization_get_active_cmd() - Return active umac command which
549  *  matches vdev and cmd type
550  * @psoc: pointer to soc
551  * @vdev_id: vdev id to pull vdev object
552  * @cmd_type: cmd type to match
553  *
554  * This API fetches vdev/pdev object based on vdev_id, loops through active
555  * command queue and find the active command which matches cmd_type as well
556  * as vdev object.
557  *
558  * Return: Pointer to umac command. NULL is returned if active command of given
559  *  type is not found.
560  */
561 void *wlan_serialization_get_active_cmd(
562 		struct wlan_objmgr_psoc *psoc,
563 		uint8_t vdev_id,
564 		enum wlan_serialization_cmd_type cmd_type);
565 
566 /**
567  * wlan_serialization_get_vdev_active_cmd_type() - Return cmd type of the
568  *  active command for the given vdev
569  * @vdev: vdev object
570  *
571  * This API fetches command type of the command in the vdev active queue
572  *
573  * Return: command type of the command in the vdev active queue
574  */
575 
576 enum wlan_serialization_cmd_type
577 wlan_serialization_get_vdev_active_cmd_type(struct wlan_objmgr_vdev *vdev);
578 
579 /**
580  * wlan_ser_get_cmd_activation_status() - Return active command status
581  * @vdev: vdev object
582  *
583  * This API fetches active command state in the vdev active queue
584  *
585  * Return: success if CMD_MARKED_FOR_ACTIVATION bit is set, else fail
586  */
587 
588 QDF_STATUS
589 wlan_ser_get_cmd_activation_status(struct wlan_objmgr_vdev *vdev);
590 
591 /**
592  * wlan_ser_validate_umac_cmd() - validate umac cmd data
593  * @vdev: objmgr vdev pointer
594  * @cmd_type: cmd type to match
595  * @umac_cmd_cb: Callback to be called to validate the data
596  *
597  * This API returns the validation status of the umac cmd cb.
598  * The umac_cmd_cb callback is called with serialization lock held, and hence
599  * only atomic operations are allowed in the callback.
600  *
601  * Return: QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE
602  */
603 QDF_STATUS
604 wlan_ser_validate_umac_cmd(struct wlan_objmgr_vdev *vdev,
605 			   enum wlan_serialization_cmd_type cmd_type,
606 			   wlan_ser_umac_cmd_cb umac_cmd_cb);
607 
608 /**
609  * wlan_serialization_purge_all_pdev_cmd() - purge all command for given pdev
610  * @pdev: objmgr pdev pointer
611  *
612  * Return: void
613  */
614 void wlan_serialization_purge_all_pdev_cmd(struct wlan_objmgr_pdev *pdev);
615 
616 /**
617  * wlan_serialization_purge_all_cmd() - purge all command for psoc
618  * @psoc: objmgr psoc pointer
619  *
620  * Return: void
621  */
622 void wlan_serialization_purge_all_cmd(struct wlan_objmgr_psoc *psoc);
623 
624 /**
625  * wlan_serialization_purge_all_pending_cmd_by_vdev_id() - Purge all pending
626  * scan and non scan commands for vdev id
627  * @pdev: pointer to pdev
628  * @vdev_id: vdev_id variable
629  *
630  * Return: none
631  */
632 void wlan_serialization_purge_all_pending_cmd_by_vdev_id(
633 					struct wlan_objmgr_pdev *pdev,
634 					uint8_t vdev_id);
635 
636 /**
637  * wlan_serialization_purge_all_scan_cmd_by_vdev_id() - Purge all pending/active
638  * scan commands for vdev id
639  * @pdev: pointer to pdev
640  * @vdev_id: vdev_id variable
641  *
642  * Return: none
643  */
644 void wlan_serialization_purge_all_scan_cmd_by_vdev_id(
645 					struct wlan_objmgr_pdev *pdev,
646 					uint8_t vdev_id);
647 #endif
648