xref: /wlan-driver/qcacld-3.0/os_if/twt/inc/osif_twt_internal.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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: osif_twt_internal.h
21  *
22  * WLAN Host Device Driver file for TWT (Target Wake Time) support.
23  *
24  */
25 
26 #ifndef _OSIF_TWT_INTERNAL_H_
27 #define _OSIF_TWT_INTERNAL_H_
28 
29 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
30 /**
31  * struct twt_conc_context: TWT concurrency args
32  * @psoc: pointer to psoc
33  */
34 struct twt_conc_context {
35 	struct wlan_objmgr_psoc *psoc;
36 };
37 
38 /**
39  * osif_twt_send_requestor_enable_cmd() - Send TWT requestor enable command to
40  * target
41  * @psoc: pointer to global psoc structure
42  * @pdev_id: pdev id
43  *
44  * Return: errno
45  */
46 int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
47 				       uint8_t pdev_id);
48 
49 /**
50  * osif_twt_send_responder_enable_cmd() - Send TWT responder enable command to
51  * target
52  * @psoc: pointer to global psoc structure
53  * @pdev_id: pdev id
54  *
55  * Return: errno
56  */
57 int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
58 				       uint8_t pdev_id);
59 
60 /**
61  * osif_twt_send_requestor_disable_cmd() - Send TWT requestor disable command
62  * to target
63  * @psoc: pointer to global psoc structure
64  * @pdev_id: pdev id
65  * @reason: disable reason code
66  *
67  * Return: errno
68  */
69 int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
70 					uint8_t pdev_id, uint32_t reason);
71 
72 /**
73  * osif_twt_send_responder_disable_cmd() - Send TWT responder disable command
74  * to target
75  * @psoc: pointer to global psoc structure
76  * @pdev_id: pdev id
77  * @reason: disable reason code
78  *
79  * Return: errno
80  */
81 int osif_twt_send_responder_disable_cmd(struct wlan_objmgr_psoc *psoc,
82 					uint8_t pdev_id, uint32_t reason);
83 
84 /**
85  * osif_twt_concurrency_update_handler() - Handle TWT concurrency scenario
86  * @psoc: pointer to global psoc structure
87  * @pdev: pointer to pdev
88  *
89  * Return: none
90  */
91 void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
92 					 struct wlan_objmgr_pdev *pdev);
93 
94 /**
95  * osif_twt_teardown_in_ps_disable() - Send TWT teardown if power save
96  * mode is disabled
97  *
98  * @psoc: pointer to global psoc structure
99  * @mac_addr: Peer MAC Address
100  * @vdev_id: vdev_id
101  */
102 void osif_twt_teardown_in_ps_disable(struct wlan_objmgr_psoc *psoc,
103 				     struct qdf_mac_addr *mac_addr,
104 				     uint8_t vdev_id);
105 #else
106 static inline
osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc * psoc,uint8_t pdev_id,uint32_t reason)107 int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
108 					uint8_t pdev_id, uint32_t reason)
109 {
110 	return 0;
111 }
112 
113 static inline
osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc * psoc,uint8_t pdev_id)114 int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
115 				       uint8_t pdev_id)
116 {
117 	return 0;
118 }
119 
120 static inline
osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc * psoc,uint8_t pdev_id)121 int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
122 				       uint8_t pdev_id)
123 {
124 	return 0;
125 }
126 
127 static inline
osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_pdev * pdev)128 void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
129 					 struct wlan_objmgr_pdev *pdev)
130 {
131 }
132 static inline
osif_twt_teardown_in_ps_disable(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr * mac_addr,uint8_t vdev_id)133 void osif_twt_teardown_in_ps_disable(struct wlan_objmgr_psoc *psoc,
134 				     struct qdf_mac_addr *mac_addr,
135 				     uint8_t vdev_id)
136 {
137 }
138 #endif
139 #endif /* _OSIF_TWT_INTERNAL_H_ */
140 
141