xref: /wlan-driver/qcacld-3.0/components/target_if/nan/inc/target_if_nan.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2018, 2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 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: contains nan target if declarations
22  */
23 
24 #ifndef _WLAN_NAN_TGT_IF_H_
25 #define _WLAN_NAN_TGT_IF_H_
26 
27 #include "qdf_types.h"
28 
29 #include <qdf_mem.h>
30 #include <qdf_status.h>
31 #include <wmi_unified_api.h>
32 #include <wmi_unified_priv.h>
33 #include <wmi_unified_param.h>
34 #include <wlan_objmgr_psoc_obj.h>
35 #include <wlan_scan_tgt_api.h>
36 #include <target_if.h>
37 #include "nan_public_structs.h"
38 
39 struct wlan_objmgr_psoc;
40 
41 /**
42  * target_if_nan_get_tx_ops() - retrieve the nan tx_ops
43  * @psoc: psoc context
44  *
45  * API to retrieve the nan tx_ops from the psoc context
46  *
47  * Return: nan tx_ops pointer
48  */
49 struct wlan_nan_tx_ops *target_if_nan_get_tx_ops(struct wlan_objmgr_psoc *psoc);
50 
51 /**
52  * target_if_nan_get_rx_ops() - retrieve the nan rx_ops
53  * @psoc: psoc context
54  *
55  * API to retrieve the nan rx_ops from the psoc context
56  *
57  * Return: nan rx_ops pointer
58  */
59 struct wlan_nan_rx_ops *target_if_nan_get_rx_ops(struct wlan_objmgr_psoc *psoc);
60 
61 /**
62  * target_if_nan_register_tx_ops() - registers nan tx ops
63  * @tx_ops: tx ops
64  *
65  * Return: none
66  */
67 void target_if_nan_register_tx_ops(struct wlan_nan_tx_ops *tx_ops);
68 
69 /**
70  * target_if_nan_register_rx_ops() - registers nan rx ops
71  * @rx_ops: rx ops
72  *
73  * Return: none
74  */
75 void target_if_nan_register_rx_ops(struct wlan_nan_rx_ops *rx_ops);
76 
77 /**
78  * target_if_nan_register_events() - registers with NDP events
79  * @psoc: pointer to psoc object
80  *
81  * Return: status of operation
82  */
83 QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc);
84 
85 /**
86  * target_if_nan_deregister_events() - registers nan rx ops
87  * @psoc: pointer to psoc object
88  *
89  * Return: status of operation
90  */
91 QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc);
92 
93 /**
94  * target_if_nan_rsp_handler() - Target IF handler for NAN Discovery events
95  * @scn: target handle
96  * @data: event buffer
97  * @len: event buffer length
98  *
99  * Return: 0 for success or error code
100  */
101 int target_if_nan_rsp_handler(ol_scn_t scn, uint8_t *data, uint32_t len);
102 
103 /**
104  * target_if_nan_set_vdev_feature_config() - Init NAN feature config params
105  * @psoc: Pointer to PSOC Object
106  * @vdev_id: vdev_id of the current vdev
107  *
108  * This function updates NAN feature config bitmap to firmware
109  */
110 void target_if_nan_set_vdev_feature_config(struct wlan_objmgr_psoc *psoc,
111 					   uint8_t vdev_id);
112 #endif /* _WIFI_POS_TGT_IF_H_ */
113