xref: /wlan-driver/qca-wifi-host-cmn/umac/cmn_services/serialization/src/wlan_serialization_queue_i.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-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: wlan_serialization_queue_i.h
21  * This file defines the prototpye for functions which deals with the
22  * serialization queue objects.
23  */
24 #ifndef __WLAN_SERIALIZATION_QUEUE_I_H
25 #define __WLAN_SERIALIZATION_QUEUE_I_H
26 
27 #include <wlan_serialization_api.h>
28 #include "wlan_serialization_main_i.h"
29 #include "wlan_serialization_utils_i.h"
30 #include <wlan_objmgr_vdev_obj.h>
31 #include <wlan_objmgr_pdev_obj.h>
32 #include <wlan_objmgr_psoc_obj.h>
33 #include <qdf_list.h>
34 #include <qdf_status.h>
35 
36 /**
37  * wlan_serialization_get_pdev_queue_obj() - Get serialization pdev queue for
38  *			the given cmd_type
39  * @pdev_obj: Serialization private pdev object
40  * @cmd_type: Serialization command type i.e scan or non-scan
41  *
42  * Return: Pointer to serialization pdev queue
43  */
44 struct wlan_serialization_pdev_queue *wlan_serialization_get_pdev_queue_obj(
45 		struct wlan_ser_pdev_obj *pdev_obj,
46 		enum wlan_serialization_cmd_type cmd_type);
47 
48 /**
49  * wlan_serialization_get_vdev_queue_obj() - Get serialization vdev queue for
50  *			the given cmd_type
51  * @vdev_obj: Serialization private vdev object
52  * @cmd_type: Serialization command type i.e scan or non-scan
53  *
54  * Return: Pointer to serialization vdev queue
55  */
56 struct wlan_serialization_vdev_queue *wlan_serialization_get_vdev_queue_obj(
57 		struct wlan_ser_vdev_obj *vdev_obj,
58 		enum wlan_serialization_cmd_type cmd_type);
59 
60 /**
61  * wlan_serialization_get_list_from_pdev_queue() - Get list member from the pdev
62  *			queue for the given cmd type
63  * @pdev_obj: Serialization private pdev object
64  * @cmd_type: Serialization command type i.e scan or non-scan
65  * @is_active_cmd: Get list from active queue or pending queue
66  *
67  * Return: Pointer to the obtained list member
68  */
69 qdf_list_t *wlan_serialization_get_list_from_pdev_queue(
70 		struct wlan_ser_pdev_obj *pdev_obj,
71 		enum wlan_serialization_cmd_type cmd_type,
72 		uint8_t is_active_cmd);
73 
74 /**
75  * wlan_serialization_get_list_from_vdev_queue() - Get list member from the vdev
76  *			queue for the given cmd type
77  * @vdev_obj: Serialization private vdev object
78  * @cmd_type: Serialization command type i.e scan or non-scan
79  * @is_active_cmd: Get list from active queue or pending queue
80  *
81  * Return: Pointer to the obtained list member
82  */
83 qdf_list_t *wlan_serialization_get_list_from_vdev_queue(
84 		struct wlan_ser_vdev_obj *vdev_obj,
85 		enum wlan_serialization_cmd_type cmd_type,
86 		uint8_t is_active_cmd);
87 
88 /**
89  * wlan_serialization_add_cmd_to_pdev_queue() - Add given cmd to the pdev
90  *			queue for the given cmd type
91  * @pdev_obj: Serialization private pdev object
92  * @cmd_list: Pointer to command list containing the command
93  * @is_cmd_for_active_queue: Add to active queue or pending queue
94  *
95  * Return: Status of the cmd's serialization request
96  */
97 enum wlan_serialization_status wlan_serialization_add_cmd_to_pdev_queue(
98 		struct wlan_ser_pdev_obj *pdev_obj,
99 		struct wlan_serialization_command_list *cmd_list,
100 		uint8_t is_cmd_for_active_queue);
101 
102 /**
103  * wlan_serialization_add_cmd_to_vdev_queue() - Add given cmd to the vdev
104  *			queue for the given cmd type
105  * @pdev_obj: Serialization private pdev object
106  * @cmd_list: Pointer to command list containing the command
107  * @is_cmd_for_active_queue: Add to active queue or pending queue
108  *
109  * Return: Status of the cmd's serialization request
110  */
111 enum wlan_serialization_status wlan_serialization_add_cmd_to_vdev_queue(
112 		struct wlan_ser_pdev_obj *pdev_obj,
113 		struct wlan_serialization_command_list *cmd_list,
114 		uint8_t is_cmd_for_active_queue);
115 
116 /**
117  * wlan_serialization_remove_cmd_from_pdev_queue() - Remove given cmd from
118  *			the pdev queue for the given cmd type
119  * @pdev_obj: Serialization private pdev object
120  * @pcmd_list: Pointer to command list containing the command
121  * @cmd: Serialization command information
122  * @is_active_queue: Remove from active queue or pending queue
123  *
124  * Return: QDF_STATUS_SUCCESS on success, error code on failure
125  */
126 QDF_STATUS wlan_serialization_remove_cmd_from_pdev_queue(
127 		struct wlan_ser_pdev_obj *pdev_obj,
128 		struct wlan_serialization_command_list **pcmd_list,
129 		struct wlan_serialization_command *cmd,
130 		uint8_t is_active_queue);
131 
132 /**
133  * wlan_serialization_remove_cmd_from_vdev_queue() - Remove given cmd from
134  *			the vdev queue for the given cmd type
135  * @pdev_obj: Serialization private pdev object
136  * @pcmd_list: Pointer to command list containing the command
137  * @cmd: Serialization command information
138  * @is_active_queue: Remove from active queue or pending queue
139  *
140  * Return: QDF_STATUS_SUCCESS on success, error code on failure
141  */
142 QDF_STATUS wlan_serialization_remove_cmd_from_vdev_queue(
143 		struct wlan_ser_pdev_obj *pdev_obj,
144 		struct wlan_serialization_command_list **pcmd_list,
145 		struct wlan_serialization_command *cmd,
146 		uint8_t is_active_queue);
147 
148 #endif
149