xref: /wlan-dirver/qca-wifi-host-cmn/umac/twt/dispatcher/src/wlan_twt_ucfg_api.c (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
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 
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 
29 QDF_STATUS ucfg_twt_get_legacy_bcast_twt_support(struct wlan_objmgr_psoc *psoc,
30 						bool *val)
31 {
32 	return wlan_twt_tgt_caps_get_legacy_bcast_support(psoc, val);
33 }
34 
35 QDF_STATUS ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc,
36 					bool *val)
37 {
38 	return wlan_twt_tgt_caps_get_nudge_enabled(psoc, val);
39 }
40 
41 QDF_STATUS ucfg_twt_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc,
42 					bool *val)
43 {
44 	return wlan_twt_tgt_caps_get_all_twt_enabled(psoc, val);
45 }
46 
47 QDF_STATUS ucfg_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
48 					  uint32_t dialog_id)
49 {
50 	return wlan_twt_check_all_twt_support(psoc, dialog_id);
51 }
52 
53 QDF_STATUS ucfg_twt_get_twt_stats_enabled(struct wlan_objmgr_psoc *psoc,
54 					bool *val)
55 {
56 	return wlan_twt_tgt_caps_get_stats_enabled(psoc, val);
57 }
58 
59 QDF_STATUS ucfg_twt_get_twt_ack_supported(struct wlan_objmgr_psoc *psoc,
60 					bool *val)
61 {
62 	return wlan_twt_tgt_caps_get_ack_supported(psoc, val);
63 }
64 
65 QDF_STATUS ucfg_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
66 				      struct twt_disable_param *req,
67 				      void *context)
68 {
69 	return wlan_twt_requestor_disable(psoc, req, context);
70 }
71 
72 QDF_STATUS ucfg_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
73 				      struct twt_disable_param *req,
74 				      void *context)
75 {
76 	return wlan_twt_responder_disable(psoc, req, context);
77 }
78 
79 QDF_STATUS ucfg_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
80 				     struct twt_enable_param *req,
81 				     void *context)
82 {
83 	return wlan_twt_requestor_enable(psoc, req, context);
84 }
85 
86 QDF_STATUS ucfg_twt_responder_enable(struct wlan_objmgr_psoc *psoc,
87 				     struct twt_enable_param *req,
88 				     void *context)
89 {
90 	return wlan_twt_responder_enable(psoc, req, context);
91 }
92 
93 QDF_STATUS
94 ucfg_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc,
95 			       struct qdf_mac_addr *peer_mac,
96 			       uint8_t peer_cap)
97 {
98 	return wlan_twt_set_peer_capabilities(psoc, peer_mac, peer_cap);
99 }
100 
101 QDF_STATUS
102 ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
103 			       struct qdf_mac_addr *peer_mac,
104 			       uint8_t *peer_cap)
105 {
106 	return wlan_twt_get_peer_capabilities(psoc, peer_mac, peer_cap);
107 }
108