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