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_non_scan_i.h
21  * This file defines the prototypes for functions which deals with
22  * serialization non scan commands.
23  */
24 
25 #ifndef __WLAN_SERIALIZATION_NON_SCAN_I_H
26 #define __WLAN_SERIALIZATION_NON_SCAN_I_H
27 
28 #include <wlan_objmgr_vdev_obj.h>
29 #include <wlan_objmgr_pdev_obj.h>
30 #include <qdf_mc_timer.h>
31 #include <wlan_utility.h>
32 #include "wlan_serialization_utils_i.h"
33 #include "wlan_serialization_main_i.h"
34 #include "wlan_serialization_api.h"
35 #include "wlan_serialization_internal_i.h"
36 #include "wlan_serialization_queue_i.h"
37 
38 /**
39  * wlan_serialization_is_active_nonscan_cmd_allowed() - find if cmd allowed
40  *			to be enqueued in active queue
41  * @cmd: Serialization command information
42  *
43  * This API will be called to find out if non scan cmd is allowed.
44  *
45  * Return: true or false
46  */
47 bool
48 wlan_serialization_is_active_non_scan_cmd_allowed(
49 		struct wlan_serialization_command *cmd);
50 
51 /**
52  * wlan_ser_add_non_scan_cmd() - Add a non-scan cmd to serialization queue
53  * @ser_pdev_obj: Serialization private pdev object
54  * @cmd_list: Command list with command info that is to be queued
55  * @is_cmd_for_active_queue: If the cmd to be enqueued in active queue or
56  *			pending queue
57  *
58  * Return: Status of the cmd's serialization request
59  */
60 enum wlan_serialization_status
61 wlan_ser_add_non_scan_cmd(
62 		struct wlan_ser_pdev_obj *ser_pdev_obj,
63 		struct wlan_serialization_command_list *cmd_list,
64 		uint8_t is_cmd_for_active_queue);
65 /**
66  * wlan_ser_move_non_scan_pending_to_active() - Move a non-scan cmd from pending
67  *			queue to active queue
68  * @pcmd_list: Pointer to command list containing the command
69  * @ser_pdev_obj: Serialization private pdev object
70  * @vdev: Pointer to object manager vdev
71  *
72  * Return: Status of the cmd's serialization request
73  */
74 enum wlan_serialization_status
75 wlan_ser_move_non_scan_pending_to_active(
76 		struct wlan_serialization_command_list **pcmd_list,
77 		struct wlan_ser_pdev_obj *ser_pdev_obj,
78 		struct wlan_objmgr_vdev *vdev);
79 
80 /**
81  * wlan_ser_move_multiple_non_scan_pending_to_active() - Move multiple non-scan
82  *			cmd from pending queue to active queue
83  * @ser_pdev_obj: Serialization private pdev object
84  *
85  * Return: Status of the cmd's serialization request
86  */
87 enum wlan_serialization_status
88 wlan_ser_move_multiple_non_scan_pending_to_active(
89 		struct wlan_ser_pdev_obj *ser_pdev_obj);
90 
91 /**
92  * wlan_ser_remove_non_scan_cmd() - Remove a non-scan cmd from the given queue
93  * @ser_pdev_obj: Serialization private pdev object
94  * @pcmd_list: Pointer to command list containing the command
95  * @cmd: Serialization command information
96  * @is_active_cmd: If the cmd has to be removed from active queue or pending
97  *			queue
98  *
99  * Return: QDF_STATUS_SUCCESS on successfully removing the cmd else
100  *			QDF_STATUS_E_FAILURE
101  */
102 QDF_STATUS
103 wlan_ser_remove_non_scan_cmd(struct wlan_ser_pdev_obj *ser_pdev_obj,
104 			     struct wlan_serialization_command_list **pcmd_list,
105 			     struct wlan_serialization_command *cmd,
106 			     uint8_t is_active_cmd);
107 /**
108  * wlan_ser_cancel_non_scan_cmd() - Cancel a non-scan cmd from the given queue
109  * @ser_obj: Serialization private pdev object
110  * @pdev: Pointer to object manager pdev
111  * @vdev: Pointer to object manager vdev
112  * @cmd: Serialization command information
113  * @cmd_type: Serialization command type to be cancelled
114  * @is_active_queue: If the cmd has to be removed from active queue or pending
115  *			queue
116  *
117  * Return: Status specifying the cancel of a command from the given queue
118  */
119 enum wlan_serialization_cmd_status
120 wlan_ser_cancel_non_scan_cmd(struct wlan_ser_pdev_obj *ser_obj,
121 			     struct wlan_objmgr_pdev *pdev,
122 			     struct wlan_objmgr_vdev *vdev,
123 			     struct wlan_serialization_command *cmd,
124 			     enum wlan_serialization_cmd_type cmd_type,
125 			     uint8_t is_active_queue);
126 #endif
127