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_ser_pdev_obj *ser_pdev_obj,
77 		struct wlan_objmgr_vdev *vdev,
78 		bool blocking_cmd_removed);
79 
80 /**
81  * wlan_ser_remove_non_scan_cmd() - Remove a non-scan cmd from the given queue
82  * @ser_pdev_obj: Serialization private pdev object
83  * @pcmd_list: Pointer to command list containing the command
84  * @cmd: Serialization command information
85  * @is_active_cmd: If the cmd has to be removed from active queue or pending
86  *			queue
87  *
88  * Return: QDF_STATUS_SUCCESS on successfully removing the cmd else
89  *			QDF_STATUS_E_FAILURE
90  */
91 QDF_STATUS
92 wlan_ser_remove_non_scan_cmd(struct wlan_ser_pdev_obj *ser_pdev_obj,
93 			     struct wlan_serialization_command_list **pcmd_list,
94 			     struct wlan_serialization_command *cmd,
95 			     uint8_t is_active_cmd);
96 /**
97  * wlan_ser_cancel_non_scan_cmd() - Cancel a non-scan cmd from the given queue
98  * @ser_obj: Serialization private pdev object
99  * @pdev: Pointer to object manager pdev
100  * @vdev: Pointer to object manager vdev
101  * @cmd: Serialization command information
102  * @cmd_type: Serialization command type to be cancelled
103  * @is_active_queue: If the cmd has to be removed from active queue or pending
104  *			queue
105  *
106  * Return: Status specifying the cancel of a command from the given queue
107  */
108 enum wlan_serialization_cmd_status
109 wlan_ser_cancel_non_scan_cmd(struct wlan_ser_pdev_obj *ser_obj,
110 			     struct wlan_objmgr_pdev *pdev,
111 			     struct wlan_objmgr_vdev *vdev,
112 			     struct wlan_serialization_command *cmd,
113 			     enum wlan_serialization_cmd_type cmd_type,
114 			     uint8_t is_active_queue);
115 #endif
116