xref: /wlan-driver/qca-wifi-host-cmn/target_if/green_ap/inc/target_if_green_ap.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: offload lmac interface APIs for green ap
22  */
23 #ifndef __TARGET_IF_GREEN_AP_H__
24 #define __TARGET_IF_GREEN_AP_H__
25 
26 #include <wlan_objmgr_cmn.h>
27 #include <wlan_objmgr_pdev_obj.h>
28 #include <qdf_status.h>
29 #include <wlan_lmac_if_def.h>
30 
31 struct wlan_green_ap_egap_params;
32 
33 /**
34  * target_if_register_green_ap_tx_ops() - lmac handler to register
35  *   green ap tx_ops callback functions
36  * @tx_ops: wlan_lmac_if_tx_ops object
37  *
38  * Return: QDF_STATUS in case of success
39  */
40 QDF_STATUS target_if_register_green_ap_tx_ops(
41 		struct wlan_lmac_if_tx_ops *tx_ops);
42 
43 #if defined(WLAN_SUPPORT_GAP_LL_PS_MODE)
44 /**
45  * target_if_green_ap_register_ll_ps_event_handler() - register green ap low
46  * latency power save mode event handler
47  * @pdev: objmgr pdev
48  *
49  * Return: QDF_STATUS in case of success
50  */
51 
52 QDF_STATUS target_if_green_ap_register_ll_ps_event_handler(
53 						struct wlan_objmgr_pdev *pdev);
54 #else
target_if_green_ap_register_ll_ps_event_handler(struct wlan_objmgr_pdev * pdev)55 static inline QDF_STATUS target_if_green_ap_register_ll_ps_event_handler(
56 						struct wlan_objmgr_pdev *pdev)
57 {
58 	return QDF_STATUS_SUCCESS;
59 }
60 #endif
61 /**
62  * target_if_green_ap_register_egap_event_handler() - registers enhanced
63  *                                  green ap event handler
64  * @pdev: objmgr pdev
65  *
66  * Return: QDF_STATUS in case of success
67  */
68 QDF_STATUS target_if_green_ap_register_egap_event_handler(
69 			struct wlan_objmgr_pdev *pdev);
70 
71 /**
72  * target_if_green_ap_enable_egap() - enable enhanced green ap
73  * @pdev: pdev pointer
74  * @egap_params: enhanced green ap params
75  *
76  * Return: QDF_STATUS_SUCCESS in case of success
77  */
78 QDF_STATUS target_if_green_ap_enable_egap(
79 		struct wlan_objmgr_pdev *pdev,
80 		struct wlan_green_ap_egap_params *egap_params);
81 
82 /**
83  * target_if_green_ap_set_ps_on_off() - Green AP PS toggle
84  * @pdev: pdev pointer
85  * @value: Value to send PS on/off to FW
86  * @pdev_id: pdev id
87  *
88  * Return: QDF_STATUS_SUCCESS in case of success
89  */
90 QDF_STATUS target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
91 					    bool value, uint8_t pdev_id);
92 
93 /**
94  * target_if_green_ap_get_current_channel() - Get current channel
95  * @pdev: pdev pointer
96  *
97  * Return: current channel freq
98  */
99 uint16_t target_if_green_ap_get_current_channel(struct wlan_objmgr_pdev *pdev);
100 
101 /**
102  * target_if_green_ap_get_current_channel_flags() - Get current channel flags
103  * @pdev: pdev pointer
104  *
105  * Return: current channel flags
106  */
107 uint64_t target_if_green_ap_get_current_channel_flags(
108 				struct wlan_objmgr_pdev *pdev);
109 
110 /**
111  * target_if_green_ap_reset_dev() - Reset dev
112  * @pdev: pdev pointer
113  *
114  * Return:  QDF_STATUS_SUCCESS if device reset
115  */
116 QDF_STATUS target_if_green_ap_reset_dev(struct wlan_objmgr_pdev *pdev);
117 
118 #endif
119