xref: /wlan-driver/qcacld-3.0/components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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: Contains p2p south bound interface definitions
21  */
22 
23 #ifndef _WLAN_P2P_TGT_API_H_
24 #define _WLAN_P2P_TGT_API_H_
25 
26 #include <qdf_types.h>
27 #include <qdf_nbuf.h>
28 
29 struct scan_event;
30 struct wlan_objmgr_psoc;
31 struct wlan_objmgr_peer;
32 struct p2p_noa_info;
33 struct p2p_lo_event;
34 struct mgmt_rx_event_params;
35 enum mgmt_frame_type;
36 struct p2p_set_mac_filter_evt;
37 
38 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
39 
40 /**
41  * tgt_p2p_lo_event_cb() - Listen offload stop request
42  * @psoc: soc object
43  * @event_info: lo stop event buffer
44  *
45  * This function gets called from target interface.
46  *
47  * Return: QDF_STATUS_SUCCESS - in case of success
48  */
49 QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
50 			       struct p2p_lo_event *event_info);
51 
52 /**
53  * tgt_p2p_register_lo_ev_handler() - register lo event
54  * @psoc: soc object
55  *
56  * p2p tgt api to register listen offload event handler.
57  *
58  * Return: QDF_STATUS_SUCCESS - in case of success
59  */
60 QDF_STATUS tgt_p2p_register_lo_ev_handler(
61 	struct wlan_objmgr_psoc *psoc);
62 
63 /**
64  * tgt_p2p_unregister_lo_ev_handler() - unregister lo event
65  * @psoc: soc object
66  *
67  * p2p tgt api to unregister listen offload event handler.
68  *
69  * Return: QDF_STATUS_SUCCESS - in case of success
70  */
71 QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
72 	struct wlan_objmgr_psoc *psoc);
73 #else
tgt_p2p_register_lo_ev_handler(struct wlan_objmgr_psoc * psoc)74 static inline QDF_STATUS tgt_p2p_register_lo_ev_handler(
75 	struct wlan_objmgr_psoc *psoc)
76 {
77 	return QDF_STATUS_SUCCESS;
78 }
79 
tgt_p2p_unregister_lo_ev_handler(struct wlan_objmgr_psoc * psoc)80 static inline QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
81 	struct wlan_objmgr_psoc *psoc)
82 {
83 	return QDF_STATUS_SUCCESS;
84 }
85 #endif
86 
87 /**
88  * tgt_p2p_register_macaddr_rx_filter_evt_handler() - register add mac rx
89  *    filter status event
90  * @psoc: soc object
91  * @register: register or unregister
92  *
93  * p2p tgt api to register add mac rx filter status event
94  *
95  * Return: QDF_STATUS_SUCCESS - in case of success
96  */
97 QDF_STATUS tgt_p2p_register_macaddr_rx_filter_evt_handler(
98 	struct wlan_objmgr_psoc *psoc, bool register);
99 
100 /**
101  * tgt_p2p_register_noa_ev_handler() - register noa event
102  * @psoc: soc object
103  *
104  * p2p tgt api to register noa event handler.
105  *
106  * Return: QDF_STATUS_SUCCESS - in case of success
107  */
108 QDF_STATUS tgt_p2p_register_noa_ev_handler(
109 	struct wlan_objmgr_psoc *psoc);
110 
111 /**
112  * tgt_p2p_unregister_noa_ev_handler() - unregister noa event
113  * @psoc: soc object
114  *
115  * p2p tgt api to unregister noa event handler.
116  *
117  * Return: QDF_STATUS_SUCCESS - in case of success
118  */
119 QDF_STATUS tgt_p2p_unregister_noa_ev_handler(
120 	struct wlan_objmgr_psoc *psoc);
121 
122 /**
123  * tgt_p2p_scan_event_cb() - Callback for scan event
124  * @vdev: vdev object
125  * @event: event information
126  * @arg: registered arguments
127  *
128  * This function gets called from scan component when getting P2P
129  * scan event.
130  *
131  * Return: None
132  */
133 void tgt_p2p_scan_event_cb(struct wlan_objmgr_vdev *vdev,
134 	struct scan_event *event, void *arg);
135 
136 /**
137  * tgt_p2p_mgmt_download_comp_cb() - Callback for mgmt frame tx
138  * complete
139  * @context: tx context
140  * @buf: buffer address
141  * @free: need to free or not
142  *
143  * This function gets called from mgmt tx/rx component when mgmt
144  * frame tx complete.
145  *
146  * Return: QDF_STATUS_SUCCESS - in case of success
147  */
148 QDF_STATUS tgt_p2p_mgmt_download_comp_cb(void *context,
149 	qdf_nbuf_t buf, bool free);
150 
151 /**
152  * tgt_p2p_mgmt_ota_comp_cb() - Callback for mgmt frame tx ack
153  * @context: tx context
154  * @buf: buffer address
155  * @status: tx status
156  * @tx_compl_params: tx complete parameters
157  *
158  * This function gets called from mgmt tx/rx component when getting
159  * mgmt frame tx ack.
160  *
161  * Return: QDF_STATUS_SUCCESS - in case of success
162  */
163 QDF_STATUS tgt_p2p_mgmt_ota_comp_cb(void *context, qdf_nbuf_t buf,
164 	uint32_t status, void *tx_compl_params);
165 
166 /**
167  * tgt_p2p_mgmt_frame_rx_cb() - Callback for rx mgmt frame
168  * @psoc: soc context
169  * @peer: peer context
170  * @buf: rx buffer
171  * @mgmt_rx_params: mgmt rx parameters
172  * @frm_type: frame type
173  *
174  * This function gets called from mgmt tx/rx component when rx mgmt
175  * frame.
176  *
177  * Return: QDF_STATUS_SUCCESS - in case of success
178  */
179 QDF_STATUS tgt_p2p_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
180 	struct wlan_objmgr_peer *peer, qdf_nbuf_t buf,
181 	struct mgmt_rx_event_params *mgmt_rx_params,
182 	enum mgmt_frame_type frm_type);
183 /**
184  * tgt_p2p_noa_event_cb() - Callback for noa event
185  * @psoc: soc object
186  * @event_info: noa event information
187  *
188  * This function gets called from target interface.
189  *
190  * Return: QDF_STATUS_SUCCESS - in case of success
191  */
192 QDF_STATUS tgt_p2p_noa_event_cb(struct wlan_objmgr_psoc *psoc,
193 		struct p2p_noa_info *event_info);
194 
195 /**
196  * tgt_p2p_add_mac_addr_status_event_cb() - Callback for set mac addr filter evt
197  * @psoc: soc object
198  * @event_info: event information type of p2p_set_mac_filter_evt
199  *
200  * This function gets called from target interface.
201  *
202  * Return: QDF_STATUS_SUCCESS - in case of success
203  */
204 QDF_STATUS
205 tgt_p2p_add_mac_addr_status_event_cb(
206 	struct wlan_objmgr_psoc *psoc,
207 	struct p2p_set_mac_filter_evt *event_info);
208 
209 #endif /* _WLAN_P2P_TGT_API_H_ */
210