xref: /wlan-driver/qca-wifi-host-cmn/umac/twt/dispatcher/src/wlan_twt_ucfg_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc) !
1 /*
2  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  *  DOC: wlan_twt_ucfg_api.c
19  *  This file contains twt ucfg APIs
20  */
21 #include <wlan_twt_ucfg_api.h>
22 #include "twt/core/src/wlan_twt_common.h"
23 
ucfg_twt_get_responder(struct wlan_objmgr_psoc * psoc,bool * val)24 QDF_STATUS ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val)
25 {
26 	return wlan_twt_tgt_caps_get_responder(psoc, val);
27 }
28 
ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc * psoc,bool * val)29 QDF_STATUS ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc,
30 					bool *val)
31 {
32 	return wlan_twt_tgt_caps_get_nudge_enabled(psoc, val);
33 }
34 
ucfg_twt_get_all_twt_enabled(struct wlan_objmgr_psoc * psoc,bool * val)35 QDF_STATUS ucfg_twt_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc,
36 					bool *val)
37 {
38 	return wlan_twt_tgt_caps_get_all_twt_enabled(psoc, val);
39 }
40 
ucfg_twt_check_all_twt_support(struct wlan_objmgr_psoc * psoc,uint32_t dialog_id)41 QDF_STATUS ucfg_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
42 					  uint32_t dialog_id)
43 {
44 	return wlan_twt_check_all_twt_support(psoc, dialog_id);
45 }
46 
ucfg_twt_get_twt_stats_enabled(struct wlan_objmgr_psoc * psoc,bool * val)47 QDF_STATUS ucfg_twt_get_twt_stats_enabled(struct wlan_objmgr_psoc *psoc,
48 					bool *val)
49 {
50 	return wlan_twt_tgt_caps_get_stats_enabled(psoc, val);
51 }
52 
ucfg_twt_get_twt_ack_supported(struct wlan_objmgr_psoc * psoc,bool * val)53 QDF_STATUS ucfg_twt_get_twt_ack_supported(struct wlan_objmgr_psoc *psoc,
54 					bool *val)
55 {
56 	return wlan_twt_tgt_caps_get_ack_supported(psoc, val);
57 }
58 
ucfg_twt_requestor_disable(struct wlan_objmgr_psoc * psoc,struct twt_disable_param * req,void * context)59 QDF_STATUS ucfg_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
60 				      struct twt_disable_param *req,
61 				      void *context)
62 {
63 	return wlan_twt_requestor_disable(psoc, req, context);
64 }
65 
ucfg_twt_responder_disable(struct wlan_objmgr_psoc * psoc,struct twt_disable_param * req,void * context)66 QDF_STATUS ucfg_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
67 				      struct twt_disable_param *req,
68 				      void *context)
69 {
70 	return wlan_twt_responder_disable(psoc, req, context);
71 }
72 
ucfg_twt_requestor_enable(struct wlan_objmgr_psoc * psoc,struct twt_enable_param * req,void * context)73 QDF_STATUS ucfg_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
74 				     struct twt_enable_param *req,
75 				     void *context)
76 {
77 	return wlan_twt_requestor_enable(psoc, req, context);
78 }
79 
ucfg_twt_responder_enable(struct wlan_objmgr_psoc * psoc,struct twt_enable_param * req,void * context)80 QDF_STATUS ucfg_twt_responder_enable(struct wlan_objmgr_psoc *psoc,
81 				     struct twt_enable_param *req,
82 				     void *context)
83 {
84 	return wlan_twt_responder_enable(psoc, req, context);
85 }
86 
87 QDF_STATUS
ucfg_twt_set_peer_capabilities(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr * peer_mac,uint8_t peer_cap)88 ucfg_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc,
89 			       struct qdf_mac_addr *peer_mac,
90 			       uint8_t peer_cap)
91 {
92 	return wlan_twt_set_peer_capabilities(psoc, peer_mac, peer_cap);
93 }
94 
95 QDF_STATUS
ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr * peer_mac,uint8_t * peer_cap)96 ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
97 			       struct qdf_mac_addr *peer_mac,
98 			       uint8_t *peer_cap)
99 {
100 	return wlan_twt_get_peer_capabilities(psoc, peer_mac, peer_cap);
101 }
102 
ucfg_twt_get_restricted_twt_supported(struct wlan_objmgr_psoc * psoc,bool * val)103 QDF_STATUS ucfg_twt_get_restricted_twt_supported(struct wlan_objmgr_psoc *psoc,
104 						 bool *val)
105 {
106 	return wlan_twt_tgt_caps_get_restricted_support(psoc, val);
107 }
108