xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/serialization/src/wlan_serialization_utils_i.h (revision 901120c066e139c7f8a2c8e4820561fdd83c67ef)
1 /*
2  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 /**
20  * DOC: wlan_serialization_utils_i.h
21  * This file defines the prototypes for the utility helper functions
22  * for the serialization component.
23  */
24 #ifndef __WLAN_SERIALIZATION_UTILS_I_H
25 #define __WLAN_SERIALIZATION_UTILS_I_H
26 
27 #include <qdf_status.h>
28 #include <qdf_list.h>
29 #include <qdf_mc_timer.h>
30 #include <wlan_objmgr_cmn.h>
31 #include <wlan_objmgr_global_obj.h>
32 #include <wlan_objmgr_psoc_obj.h>
33 #include <wlan_scan_ucfg_api.h>
34 #include "wlan_serialization_rules_i.h"
35 #ifdef WLAN_SER_DEBUG
36 #include "wlan_serialization_debug_i.h"
37 #endif
38 
39 /*
40  * Below bit positions are used to identify if a
41  * serialization command is in use or marked for
42  * deletion.
43  * CMD_MARKED_FOR_ACTIVATION - The command is about to be activated
44  * CMD_IS_ACTIVE - The command is active and currently in use
45  */
46 #define CMD_MARKED_FOR_ACTIVATION     1
47 #define CMD_IS_ACTIVE                 2
48 #define CMD_ACTIVE_MARKED_FOR_CANCEL  3
49 #define CMD_ACTIVE_MARKED_FOR_REMOVAL 4
50 #define CMD_MARKED_FOR_MOVEMENT       5
51 /**
52  * struct wlan_serialization_timer - Timer used for serialization
53  * @cmd:      Cmd to which the timer is linked
54  * @timer:    Timer associated with the command
55  *
56  * Timers are allocated statically during init, one each for the
57  * maximum active commands permitted in the system. Once a cmd is
58  * moved from pending list to active list, the timer is activated
59  * and once the cmd is completed, the timer is cancelled. Timer is
60  * also cancelled if the command is aborted
61  *
62  * The timers are maintained per psoc. A timer is associated to
63  * unique combination of pdev, cmd_type and cmd_id.
64  */
65 struct wlan_serialization_timer {
66 	struct wlan_serialization_command *cmd;
67 	qdf_timer_t timer;
68 };
69 
70 /**
71  * enum wlan_serialization_node - Types of available nodes in serialization list
72  * @WLAN_SER_PDEV_NODE: pdev node from the pdev queue
73  * @WLAN_SER_VDEV_NODE: vdev node from the vdev queue
74  */
75 enum wlan_serialization_node {
76 	WLAN_SER_PDEV_NODE,
77 	WLAN_SER_VDEV_NODE,
78 };
79 
80 /**
81  * struct wlan_serialization_command_list - List of commands to be serialized
82  * @pdev_node: PDEV node identifier in the list
83  * @vdev_node: VDEV node identifier in the list
84  * @cmd: Command to be serialized
85  * @cmd_in_use: flag to check if the node/entry is logically active
86  */
87 struct wlan_serialization_command_list {
88 	qdf_list_node_t pdev_node;
89 	qdf_list_node_t vdev_node;
90 	struct wlan_serialization_command cmd;
91 	unsigned long cmd_in_use;
92 };
93 
94 /**
95  * struct wlan_serialization_pdev_queue - queue data related to pdev
96  * @active_list: list to hold the commands currently being executed
97  * @pending_list: list to hold the commands currently pending
98  * @cmd_pool_list: list to hold the global command pool
99  * @vdev_active_cmd_bitmap: Active cmd bitmap of vdev for the given pdev
100  * @blocking_cmd_active: Indicate if a blocking cmd is in active execution
101  * @blocking_cmd_waiting: Indicate if a blocking cmd is in pending queue
102  * @pdev_queue_lock: pdev lock to protect concurrent operations on the queues
103  */
104 struct wlan_serialization_pdev_queue {
105 	qdf_list_t active_list;
106 	qdf_list_t pending_list;
107 	qdf_list_t cmd_pool_list;
108 	qdf_bitmap(vdev_active_cmd_bitmap, WLAN_UMAC_PSOC_MAX_VDEVS);
109 	bool blocking_cmd_active;
110 	uint16_t blocking_cmd_waiting;
111 	qdf_spinlock_t pdev_queue_lock;
112 #ifdef WLAN_SER_DEBUG
113 	struct ser_history history;
114 #endif
115 };
116 
117 /**
118  * struct wlan_serialization_vdev_queue - queue data related to vdev
119  * @active_list: list to hold the commands currently being executed
120  * @pending_list list: to hold the commands currently pending
121  * @queue_disable: is the queue disabled
122  */
123 struct wlan_serialization_vdev_queue {
124 	qdf_list_t active_list;
125 	qdf_list_t pending_list;
126 	bool queue_disable;
127 };
128 
129 /**
130  * enum wlan_serialization_pdev_queue_type - Types of available pdev queues
131  * @QUEUE_COMP_SCAN: Scan queue
132  * @QUEUE_COMP_NON_SCAN: Non Scan queue
133  */
134 enum serialization_pdev_queue_type {
135 	SER_PDEV_QUEUE_COMP_SCAN,
136 	SER_PDEV_QUEUE_COMP_NON_SCAN,
137 	SER_PDEV_QUEUE_COMP_MAX,
138 };
139 
140 /**
141  * enum wlan_serialization_vdev_queue_type - Types of available vdev queues
142  * @QUEUE_COMP_NON_SCAN: Non Scan queue
143  */
144 enum serialization_vdev_queue_type {
145 	SER_VDEV_QUEUE_COMP_NON_SCAN,
146 	SER_VDEV_QUEUE_COMP_MAX,
147 };
148 
149 /**
150  * enum wlan_serialization_match_type - Comparison options for a command
151  * @WLAN_SER_MATCH_VDEV: Compare vdev
152  * @WLAN_SER_MATCH_PDEV: Compare pdev
153  * @WLAN_SER_MATCH_CMD_TYPE: Compare command type
154  * @WLAN_SER_MATCH_CMD_TYPE_VDEV: Compare command type and vdev
155  * @WLAN_SER_MATCH_CMD_ID: Compare command id
156  * @WLAN_SER_MATCH_CMD_ID_VDEV: Compare command id and vdev
157  */
158 enum wlan_serialization_match_type {
159 	WLAN_SER_MATCH_VDEV,
160 	WLAN_SER_MATCH_PDEV,
161 	WLAN_SER_MATCH_CMD_TYPE,
162 	WLAN_SER_MATCH_CMD_TYPE_VDEV,
163 	WLAN_SER_MATCH_CMD_ID,
164 	WLAN_SER_MATCH_CMD_ID_VDEV,
165 	WLAN_SER_MATCH_MAX,
166 };
167 
168 /**
169  * struct wlan_ser_pdev_obj - pdev obj data for serialization
170  * @pdev_q: Array of pdev queues
171  */
172 struct wlan_ser_pdev_obj {
173 	struct wlan_serialization_pdev_queue pdev_q[SER_PDEV_QUEUE_COMP_MAX];
174 };
175 
176 /**
177  * struct wlan_ser_vdev_priv_obj - Serialization private object of vdev
178  * @vdev_q: Array of vdev queues
179  */
180 struct wlan_ser_vdev_obj {
181 	struct wlan_serialization_vdev_queue vdev_q[SER_VDEV_QUEUE_COMP_MAX];
182 };
183 
184 /**
185  * struct wlan_ser_psoc_obj - psoc obj data for serialization
186  * @comp_info_cb - module level callback
187  * @apply_rules_cb - pointer to apply rules on the cmd
188  * @timers - Timers associated with the active commands
189  * @max_axtive_cmds - Maximum active commands allowed
190  *
191  * Serialization component takes a command as input and checks whether to
192  * allow/deny the command. It will use the module level callback registered
193  * by each component to fetch the information needed to apply the rules.
194  * Once the information is available, the rules callback registered for each
195  * command internally by serialization will be applied to determine the
196  * checkpoint for the command. If allowed, command will be put into active/
197  * pending list and each active command is associated with a timer.
198  */
199 struct wlan_ser_psoc_obj {
200 	wlan_serialization_comp_info_cb comp_info_cb[
201 		WLAN_SER_CMD_MAX][WLAN_UMAC_COMP_ID_MAX];
202 	wlan_serialization_apply_rules_cb apply_rules_cb[WLAN_SER_CMD_MAX];
203 	struct wlan_serialization_timer *timers;
204 	uint8_t max_active_cmds;
205 	qdf_spinlock_t timer_lock;
206 };
207 
208 /**
209  * wlan_serialization_remove_cmd_from_queue() - to remove command from
210  *							given queue
211  * @queue: queue from which command needs to be removed
212  * @cmd: command to match in the queue
213  * @pcmd_list: Pointer to command list containing the command
214  * @ser_pdev_obj: pointer to private pdev serialization object
215  * @node_type: Pdev node or vdev node
216  *
217  * This API takes the queue, it matches the provided command from this queue
218  * and removes it. Before removing the command, it will notify the caller
219  * that if it needs to remove any memory allocated by caller.
220  *
221  * Return: QDF_STATUS_SUCCESS on success, error code on failure
222  */
223 QDF_STATUS
224 wlan_serialization_remove_cmd_from_queue(
225 		qdf_list_t *queue,
226 		struct wlan_serialization_command *cmd,
227 		struct wlan_serialization_command_list **pcmd_list,
228 		struct wlan_ser_pdev_obj *ser_pdev_obj,
229 		enum wlan_serialization_node node_type);
230 
231 /**
232  * wlan_serialization_add_cmd_from_queue() - Add a cmd to
233  *							given queue
234  * @queue: queue from which command needs to be removed
235  * @cmd_list: Pointer to command list containing the command
236  * @ser_pdev_obj: pointer to private pdev serialization object
237  * @is_cmd_for_active_queue: Add cmd to active or pending queue
238  * @node_type: Pdev node or vdev node
239  *
240  * Return: Status of the serialization request
241  */
242 enum wlan_serialization_status
243 wlan_serialization_add_cmd_to_queue(
244 		qdf_list_t *queue,
245 		struct wlan_serialization_command_list *cmd_list,
246 		struct wlan_ser_pdev_obj *ser_pdev_obj,
247 		uint8_t is_cmd_for_active_queue,
248 		enum wlan_serialization_node node_type);
249 
250 /**
251  * wlan_serialization_get_psoc_from_cmd() - get psoc from provided cmd
252  * @cmd: pointer to actual command
253  *
254  * This API will get the pointer to psoc through checking type of cmd
255  *
256  * Return: pointer to psoc
257  */
258 struct wlan_objmgr_psoc*
259 wlan_serialization_get_psoc_from_cmd(struct wlan_serialization_command *cmd);
260 
261 /**
262  * wlan_serialization_get_pdev_from_cmd() - get pdev from provided cmd
263  * @cmd: pointer to actual command
264  *
265  * This API will get the pointer to pdev through checking type of cmd
266  *
267  * Return: pointer to pdev
268  */
269 struct wlan_objmgr_pdev*
270 wlan_serialization_get_pdev_from_cmd(struct wlan_serialization_command *cmd);
271 
272 /**
273  * wlan_serialization_get_vdev_from_cmd() - get vdev from provided cmd
274  * @cmd: pointer to actual command
275  *
276  * This API will get the pointer to vdev through checking type of cmd
277  *
278  * Return: pointer to vdev
279  */
280 struct wlan_objmgr_vdev*
281 wlan_serialization_get_vdev_from_cmd(struct wlan_serialization_command *cmd);
282 
283 /**
284  * wlan_serialization_get_cmd_from_queue() - to extract command from given queue
285  * @queue: pointer to queue
286  * @nnode: next node to extract
287  *
288  * This API will try to extract node from queue which is next to prev node. If
289  * no previous node is given then take out the front node of the queue.
290  *
291  * Return: QDF_STATUS
292  */
293 QDF_STATUS wlan_serialization_get_cmd_from_queue(
294 		qdf_list_t *queue, qdf_list_node_t **nnode);
295 
296 /**
297  * wlan_serialization_stop_timer() - to stop particular timer
298  * @ser_timer: pointer to serialization timer
299  *
300  * This API stops the particular timer
301  *
302  * Return: QDF_STATUS
303  */
304 QDF_STATUS
305 wlan_serialization_stop_timer(struct wlan_serialization_timer *ser_timer);
306 /**
307  * wlan_serialization_cleanup_vdev_timers() - clean-up all timers for a vdev
308  *
309  * @vdev: pointer to vdev object
310  *
311  * This API is to cleanup all the timers for a vdev.
312  * It can be used when serialization vdev destroy is called.
313  * It will make sure that if timer is running then it will
314  * stop and destroys the timer
315  *
316  * Return: QDF_STATUS
317  */
318 
319 QDF_STATUS wlan_serialization_cleanup_vdev_timers(
320 			struct wlan_objmgr_vdev *vdev);
321 
322 /**
323  * wlan_serialization_cleanup_all_timers() - to clean-up all timers
324  *
325  * @psoc_ser_ob: pointer to serialization psoc private object
326  *
327  * This API is to cleanup all the timers. it can be used when serialization
328  * module is exiting. it will make sure that if timer is running then it will
329  * stop and destroys the timer
330  *
331  * Return: QDF_STATUS
332  */
333 QDF_STATUS wlan_serialization_cleanup_all_timers(
334 	struct wlan_ser_psoc_obj *psoc_ser_ob);
335 
336 /**
337  * wlan_serialization_validate_cmd() - Validate the command
338  * @comp_id: Component ID
339  * @cmd_type: Command Type
340  *
341  * Return: QDF_STATUS
342  */
343 QDF_STATUS wlan_serialization_validate_cmd(
344 		 enum wlan_umac_comp_id comp_id,
345 		 enum wlan_serialization_cmd_type cmd_type);
346 
347 /**
348  * wlan_serialization_validate_cmd_list() - Validate the command list
349  * @cmd_list: Serialization command list
350  *
351  * Return: QDF_STATUS
352  */
353 QDF_STATUS wlan_serialization_validate_cmd_list(
354 		struct wlan_serialization_command_list *cmd_list);
355 
356 /**
357  * wlan_serialization_validate_cmdtype() - Validate the command type
358  * @cmd_type: Command Type
359  *
360  * Return: QDF_STATUS
361  */
362 QDF_STATUS wlan_serialization_validate_cmdtype(
363 		 enum wlan_serialization_cmd_type cmd_type);
364 
365 /**
366  * wlan_serialization_destroy_pdev_list() - Release the pdev cmds and
367  * destroy list
368  * @pdev_queue: Pointer to the pdev queue
369  *
370  * Return: None
371  */
372 void wlan_serialization_destroy_pdev_list(
373 		struct wlan_serialization_pdev_queue *pdev_queue);
374 
375 /**
376  * wlan_serialization_destroy_vdev_list() - Release the vdev cmds and
377  * destroy list
378  * @list: List to be destroyed
379  *
380  * Return: None
381  */
382 void wlan_serialization_destroy_vdev_list(qdf_list_t *list);
383 
384 /**
385  * wlan_serialization_get_psoc_obj() - Return the component private obj
386  * @psoc: Pointer to the PSOC object
387  *
388  * Return: Serialization component's PSOC level private data object
389  */
390 struct wlan_ser_psoc_obj *wlan_serialization_get_psoc_obj(
391 		struct wlan_objmgr_psoc *psoc);
392 
393 /**
394  * wlan_serialization_get_pdev_obj() - Return the component private obj
395  * @psoc: Pointer to the PDEV object
396  *
397  * Return: Serialization component's PDEV level private data object
398  */
399 struct wlan_ser_pdev_obj *wlan_serialization_get_pdev_obj(
400 		struct wlan_objmgr_pdev *pdev);
401 
402 /**
403  * wlan_serialization_get_vdev_obj() - Return the component private obj
404  * @vdev: Pointer to the VDEV object
405  *
406  * Return: Serialization component's VDEV level private data object
407  */
408 struct wlan_ser_vdev_obj *wlan_serialization_get_vdev_obj(
409 		struct wlan_objmgr_vdev *vdev);
410 
411 /**
412  * wlan_serialization_is_cmd_in_vdev_list() - Check Node present in VDEV list
413  * @vdev: Pointer to the VDEV object
414  * @queue: Pointer to the qdf_list_t
415  * @node_type: Pdev node or vdev node
416  *
417  * Return: Boolean true or false
418  */
419 bool
420 wlan_serialization_is_cmd_in_vdev_list(
421 		struct wlan_objmgr_vdev *vdev, qdf_list_t *queue,
422 		enum wlan_serialization_node node_type);
423 
424 /**
425  * wlan_serialization_is_cmd_in_pdev_list() - Check Node present in PDEV list
426  * @pdev: Pointer to the PDEV object
427  * @queue: Pointer to the qdf_list_t
428  *
429  * Return: Boolean true or false
430  */
431 bool
432 wlan_serialization_is_cmd_in_pdev_list(
433 		struct wlan_objmgr_pdev *pdev, qdf_list_t *queue);
434 
435 /**
436  * wlan_serialization_is_cmd_in_active_pending() - return cmd status
437  *						active/pending queue
438  * @cmd_in_active: CMD in active list
439  * @cmd_in_pending: CMD in pending list
440  *
441  * Return: enum wlan_serialization_cmd_status
442  */
443 enum wlan_serialization_cmd_status
444 wlan_serialization_is_cmd_in_active_pending(
445 		bool cmd_in_active, bool cmd_in_pending);
446 
447 /**
448  * wlan_serialization_is_cmd_present_in_given_queue() - Check if the cmd is
449  * present in the given queue
450  * @queue: List of commands which has to be searched
451  * @cmd: Serialization command information
452  * @node_type: Pdev node or vdev node
453  *
454  * Return: Boolean true or false
455  */
456 bool wlan_serialization_is_cmd_present_in_given_queue(
457 		qdf_list_t *queue,
458 		struct wlan_serialization_command *cmd,
459 		enum wlan_serialization_node node_type);
460 
461 /**
462  * wlan_serialization_timer_destroy() - destroys the timer
463  * @ser_timer: pointer to particular timer
464  *
465  * This API destroys the memory allocated by timer and assigns cmd member of
466  * that timer structure to NULL
467  *
468  * Return: QDF_STATUS
469  */
470 QDF_STATUS wlan_serialization_timer_destroy(
471 		struct wlan_serialization_timer *ser_timer);
472 
473 /**
474  * wlan_serialization_list_empty() - check if the list is empty
475  * @queue: Queue/List that needs to be checked for emptiness
476  *
477  * Return: true if list is empty and false otherwise
478  */
479 bool wlan_serialization_list_empty(qdf_list_t *queue);
480 
481 /**
482  * wlan_serialization_list_size() - Find the size of the provided queue
483  * @queue: Queue/List for which the size/length is to be returned
484  *
485  * Return: size/length of the queue/list
486  */
487 uint32_t wlan_serialization_list_size(qdf_list_t *queue);
488 
489 /**
490  * wlan_serialization_match_cmd_type() - Check for a match on given nnode
491  * @nnode: The node on which the matching has to be done
492  * @cmd_type: Command type that needs to be matched
493  * @node_type: Pdev node or vdev node
494  *
495  * This API will check if the cmd ID and cmd type of the given nnode are
496  * matching with the one's that are being passed to this function.
497  *
498  * Return: True if matched,false otherwise.
499  */
500 bool wlan_serialization_match_cmd_type(
501 			qdf_list_node_t *nnode,
502 			enum wlan_serialization_cmd_type,
503 			enum wlan_serialization_node node_type);
504 
505 /**
506  * wlan_serialization_match_cmd_id_type() - Check for a match on given nnode
507  * @nnode: The node on which the matching has to be done
508  * @cmd: Command that needs to be matched
509  * @node_type: Pdev node or vdev node
510  *
511  * This API will check if the cmd ID and cmd type of the given nnode are
512  * matching with the one's that are being passed to this function.
513  *
514  * Return: True if matched,false otherwise.
515  */
516 bool wlan_serialization_match_cmd_id_type(
517 			qdf_list_node_t *nnode,
518 			struct wlan_serialization_command *cmd,
519 			enum wlan_serialization_node node_type);
520 
521 /**
522  * wlan_serialization_match_cmd_vdev() - Check for a match on given nnode
523  * @nnode: The node on which the matching has to be done
524  * @vdev: VDEV object that needs to be matched
525  * @node_type: Pdev node or vdev node
526  *
527  * This API will check if the VDEV object of the given nnode are
528  * matching with the one's that are being passed to this function.
529  *
530  * Return: True if matched,false otherwise.
531  */
532 bool wlan_serialization_match_cmd_vdev(qdf_list_node_t *nnode,
533 				       struct wlan_objmgr_vdev *vdev,
534 				       enum wlan_serialization_node node_type);
535 
536 /**
537  * wlan_serialization_match_cmd_pdev() - Check for a match on given nnode
538  * @nnode: The node on which the matching has to be done
539  * @pdev: pdev object that needs to be matched
540  * @node_type: Node type. Pdev node or vdev node
541  *
542  * This API will check if the PDEV object of the given nnode are
543  * matching with the one's that are being passed to this function.
544  *
545  * Return: True if matched,false otherwise.
546  */
547 bool wlan_serialization_match_cmd_pdev(qdf_list_node_t *nnode,
548 				       struct wlan_objmgr_pdev *pdev,
549 				       enum wlan_serialization_node node_type);
550 
551 /**
552  * wlan_serialization_match_cmd_blocking() - Check for a blocking cmd
553  * @nnode: The node on which the matching has to be done
554  * @node_type: Pdev node or vdev node
555  *
556  * This API will check if the give command of nnode is a blocking command.
557  *
558  * Return: True if blocking command, false otherwise.
559  */
560 bool wlan_serialization_match_cmd_blocking(
561 		qdf_list_node_t *nnode,
562 		enum wlan_serialization_node node_type);
563 
564 /**
565  * wlan_serialization_find_cmd() - Find the cmd matching the given criteria
566  * @cmd: Serialization command information
567  * @cmd_type: Command type to be matched
568  * @pdev: pdev object that needs to be matched
569  * @vdev: vdev object that needs to be matched
570  * @node_type: Node type. Pdev node or vdev node
571  *
572  * Return: Pointer to the node member in the list
573  */
574 qdf_list_node_t *
575 wlan_serialization_find_cmd(qdf_list_t *queue, uint32_t match_type,
576 			    struct wlan_serialization_command *cmd,
577 			    enum wlan_serialization_cmd_type cmd_type,
578 			    struct wlan_objmgr_pdev *pdev,
579 			    struct wlan_objmgr_vdev *vdev,
580 			    enum wlan_serialization_node node_type);
581 
582 /**
583  * wlan_serialization_remove_front() - Remove the front node of the list
584  * @list: List from which the node is to be removed
585  * @node: Pointer to store the node that is removed
586  *
587  * Return: QDF_STATUS Success or Failure
588  */
589 QDF_STATUS wlan_serialization_remove_front(
590 			qdf_list_t *list,
591 			qdf_list_node_t **node);
592 
593 /**
594  * wlan_serialization_remove_node() - Remove the given node from the list
595  * @list: List from which the node is to be removed
596  * @node: Pointer to the node that is to be removed
597  *
598  * Return: QDF_STATUS Success or Failure
599  */
600 QDF_STATUS wlan_serialization_remove_node(
601 			qdf_list_t *list,
602 			qdf_list_node_t *node);
603 
604 /**
605  * wlan_serialization_insert_front() - Insert a node into the front of the list
606  * @list: List to which the node is to be inserted
607  * @node: Pointer to the node that is to be inserted
608  *
609  * Return: QDF_STATUS Success or Failure
610  */
611 QDF_STATUS wlan_serialization_insert_front(
612 			qdf_list_t *list,
613 			qdf_list_node_t *node);
614 
615 /**
616  * wlan_serialization_insert_back() - Insert a node into the back of the list
617  * @list: List to which the node is to be inserted
618  * @node: Pointer to the node that is to be inserted
619  *
620  * Return: QDF_STATUS Success or Failure
621  */
622 QDF_STATUS wlan_serialization_insert_back(
623 			qdf_list_t *list,
624 			qdf_list_node_t *node);
625 
626 /**
627  * wlan_serialization_peek_front() - Peek the front node of the list
628  * @list: List on which the node is to be peeked
629  * @node: Pointer to the store the node that is being peeked
630  *
631  * Return: QDF_STATUS Success or Failure
632  */
633 QDF_STATUS wlan_serialization_peek_front(
634 			qdf_list_t *list,
635 			qdf_list_node_t **node);
636 
637 /**
638  * wlan_serialization_peek_next() - Peek the next node of the list
639  * @list: List on which the node is to be peeked
640  * @node1: Pointer to the node1 from where the next node has to be peeked
641  * @node2: Pointer to the store the node that is being peeked
642  *
643  * Return: QDF_STATUS Success or Failure
644  */
645 QDF_STATUS wlan_serialization_peek_next(
646 			qdf_list_t *list,
647 			qdf_list_node_t *node1,
648 			qdf_list_node_t **node2);
649 
650 /**
651  * wlan_serialization_acquire_lock() - Acquire lock to the given queue
652  * @lock: Pointer to the lock
653  *
654  * Return: QDF_STATUS success or failure
655  */
656 QDF_STATUS
657 wlan_serialization_acquire_lock(qdf_spinlock_t *lock);
658 
659 /**
660  * wlan_serialization_release_lock() - Release lock to the given queue
661  * @lock: Pointer to the lock
662  *
663  * Return: QDF_STATUS success or failure
664  */
665 QDF_STATUS
666 wlan_serialization_release_lock(qdf_spinlock_t *lock);
667 
668 /**
669  * wlan_serialization_create_lock() - Init the lock to the given queue
670  * @lock: Pointer to the lock
671  *
672  * Return: QDF_STATUS success or failure
673  */
674 QDF_STATUS
675 wlan_serialization_create_lock(qdf_spinlock_t *lock);
676 
677 /**
678  * wlan_serialization_destroy_lock() - Deinit the lock to the given queue
679  * @lock: Pointer to the lock
680  *
681  * Return: QDF_STATUS success or failure
682  */
683 QDF_STATUS
684 wlan_serialization_destroy_lock(qdf_spinlock_t *lock);
685 
686 /**
687  * wlan_serialization_any_vdev_cmd_active() - Check any vdev cmd active for pdev
688  * @pdev_queue: serialization pdev queue object
689  *
690  * Return: true or false
691  */
692 bool wlan_serialization_any_vdev_cmd_active(
693 		struct wlan_serialization_pdev_queue *pdev_queue);
694 
695 /**
696  * wlan_ser_update_cmd_history() - Update serialization queue history
697  * @pdev_queue:serialization pdev queue
698  * @cmd: cmd to be added/remeoved
699  * @ser_reason: serialization action that resulted in addition/removal
700  * @add_remove: added or removed from queue
701  * @active_queue:for active queue
702  *
703  * Return: QDF_STATUS success or failure
704  */
705 
706 void wlan_ser_update_cmd_history(
707 		struct wlan_serialization_pdev_queue *pdev_queue,
708 		struct wlan_serialization_command *cmd,
709 		enum ser_queue_reason ser_reason,
710 		bool add_remove,
711 		bool active_queue);
712 
713 #endif
714