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_legacy_api.h
20  * This file provides prototypes of the routines needed for the
21  * legacy mcl serialization to utilize the services provided by the
22  * serialization component.
23  */
24 #ifndef __WLAN_SERIALIZATION_LEGACY_API_H
25 #define __WLAN_SERIALIZATION_LEGACY_API_H
26 
27 #include "wlan_serialization_api.h"
28 
29 /**
30  * wlan_serialization_peek_head_pending_cmd_using_psoc() - Return command from
31  *				scan or non-scan pending queue based on flag
32  * @psoc: pointer to psoc
33  * @is_cmd_from_pending_scan_queue: flag to determine whether command needed
34  *				from scan or non-scan pending queue
35  *
36  * This API finds the first active pdev, and loops through scan or non-scan
37  * pending queue (based on is_cmd_from_pending_scan_queue flag) and fetches
38  * first pending command from queue
39  *
40  * Return: pointer to serialization command
41  */
42 struct wlan_serialization_command*
43 wlan_serialization_peek_head_pending_cmd_using_psoc(
44 		struct wlan_objmgr_psoc *psoc,
45 		uint8_t is_cmd_from_pending_scan_queue);
46 /**
47  * wlan_serialization_peek_head_active_cmd_using_psoc() - Return command from
48  *				scan or non-scan active queue based on flag
49  * @psoc: pointer to psoc
50  * @is_cmd_from_active_scan_queue: flag to determine whether command needed
51  *				from scan or non-scan active queue
52  *
53  * This API finds the first active pdev, and loops through scan or non-scan
54  * active queue (based on is_cmd_from_active_scan_queue flag) and fetches
55  * first active command from queue
56  *
57  * Return: pointer to serialization command
58  */
59 struct wlan_serialization_command*
60 wlan_serialization_peek_head_active_cmd_using_psoc(
61 		struct wlan_objmgr_psoc *psoc,
62 		uint8_t is_cmd_from_active_scan_queue);
63 
64 /**
65  * wlan_serialization_get_pending_list_next_node_using_psoc() - Return next
66  *				scan or non-scan pending command from queue
67  * @psoc: pointer to psoc
68  * @prev_cmd: previous command given by caller, find next command after this
69  * @is_cmd_for_pending_scan_queue: to find from scan or non-scan pending queue
70  *
71  * This API finds the first active pdev, and loops through scan or non-scan
72  * pending queue (based on is_cmd_from_pending_scan_queue flag) and fetches
73  * next pending command after prev_cmd
74  *
75  * Return: pointer to serialization command
76  */
77 struct wlan_serialization_command*
78 wlan_serialization_get_pending_list_next_node_using_psoc(
79 		struct wlan_objmgr_psoc *psoc,
80 		struct wlan_serialization_command *prev_cmd,
81 		uint8_t is_cmd_for_pending_scan_queue);
82 /**
83  * wlan_serialization_get_active_list_next_node_using_psoc() - Return next
84  *				scan or non-scan pending command from queue
85  * @psoc: pointer to psoc
86  * @prev_cmd: previous command given by caller, find next command after this
87  * @is_cmd_for_active_scan_queue: to find from active scan or non-scan queue
88  *
89  * This API finds the first active pdev, and loops through scan or non-scan
90  * pending queue (based on is_cmd_from_pending_scan_queue flag) and fetches
91  * next pending command after prev_cmd
92  *
93  * Return: pointer to serialization command
94  */
95 struct wlan_serialization_command*
96 wlan_serialization_get_active_list_next_node_using_psoc(
97 		struct wlan_objmgr_psoc *psoc,
98 		struct wlan_serialization_command *prev_cmd,
99 		uint8_t is_cmd_for_active_scan_queue);
100 /**
101  * wlan_serialization_get_active_list_count() - Return Active list count
102  * @psoc: pointer to soc
103  * @is_cmd_from_active_scan_queue: flag to determine whether command needed
104  *				from scan or non-scan active queue
105  *
106  * Get the number of nodes present in active list
107  *
108  * Return: count number of active commands in queue
109  */
110 
111 uint32_t wlan_serialization_get_active_list_count(struct wlan_objmgr_psoc *psoc,
112 		uint8_t is_cmd_from_active_scan_queue);
113 /**
114  * wlan_serialization_get_pending_list_count() - Return pending list count
115  * @psoc: pointer to soc
116  * @is_cmd_from_pending_scan_queue: flag to determine whether command needed
117  *				from scan or non-scan pending queue
118  *
119  * Get the number of nodes present in pending list
120  *
121  * Return: count number of pending commands in queue
122  */
123 uint32_t wlan_serialization_get_pending_list_count(
124 		struct wlan_objmgr_psoc *psoc,
125 		uint8_t is_cmd_from_pending_scan_queue);
126 #endif
127