xref: /wlan-dirver/qca-wifi-host-cmn/target_if/scan/inc/target_if_scan.h (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
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: offload lmac interface APIs for scan
21  */
22 #ifndef __TARGET_SCAN_IF_H__
23 #define __TARGET_SCAN_IF_H__
24 
25 #include <wmi_unified_api.h>
26 
27 struct scan_req_params;
28 struct scan_cancel_param;
29 struct wlan_objmgr_psoc;
30 
31 #define WLAN_MAX_ACTIVE_SCANS_ALLOWED   8
32 
33 #ifdef FEATURE_WLAN_SCAN_PNO
34 /**
35  * target_if_nlo_match_event_handler() - nlo match event handler
36  * @scn: scn handle
37  * @event: event data
38  * @len: data length
39  *
40  * Record NLO match event comes from FW. It's a indication that
41  * one of the profile is matched.
42  *
43  * Return: 0 for success or error code.
44  */
45 int target_if_nlo_match_event_handler(ol_scn_t scn, uint8_t *data,
46 	uint32_t len);
47 
48 /**
49  * target_if_nlo_complete_handler() - nlo complete event handler
50  * @scn: scn handle
51  * @event: event data
52  * @len: data length
53  *
54  * Record NLO match event comes from FW. It's a indication that
55  * one of the profile is matched.
56  *
57  * Return: 0 for success or error code.
58  */
59 int target_if_nlo_complete_handler(ol_scn_t scn, uint8_t *data,
60 	uint32_t len);
61 #endif
62 
63 /**
64  * target_if_scan_register_event_handler() - lmac handler API
65  * to register for scan events
66  * @psoc: psoc object
67  * @arg: argument to lmac
68  *
69  * Return: QDF_STATUS
70  */
71 QDF_STATUS
72 target_if_scan_register_event_handler(struct wlan_objmgr_psoc *psoc,
73 		void *arg);
74 
75 /**
76  * target_if_scan_unregister_event_handler() - lmac handler API
77  * to unregister for scan events
78  * @psoc: psoc object
79  * @arg: argument to lmac
80  *
81  * Return: QDF_STATUS
82  */
83 QDF_STATUS
84 target_if_scan_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
85 		void *arg);
86 
87 /**
88  * target_if_scan_start() - lmac handler API to start scan
89  * @pdev: pdev object
90  * @req: scan_req_params object
91  *
92  * Return: QDF_STATUS
93  */
94 
95 QDF_STATUS
96 target_if_scan_start(struct wlan_objmgr_pdev *pdev,
97 		struct scan_start_request *req);
98 
99 /**
100  * target_if_scan_cancel() - lmac handler API to cancel a previous active scan
101  * @pdev: pdev object
102  * @req: scan_cancel_param object
103  *
104  * Return: QDF_STATUS
105  */
106 QDF_STATUS
107 target_if_scan_cancel(struct wlan_objmgr_pdev *pdev,
108 		struct scan_cancel_param *req);
109 
110 /**
111  * target_if_scan_tx_ops_register() - lmac handler to register scan tx_ops
112  * callback functions
113  * @tx_ops: wlan_lmac_if_tx_ops object
114  *
115  * Return: QDF_STATUS
116  */
117 
118 QDF_STATUS
119 target_if_scan_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops);
120 
121 /**
122  * target_if_scan_set_max_active_scans() - lmac handler to set max active scans
123  * @psoc: psoc object
124  * @max_active_scans: maximum active scans allowed on underlying psoc
125  *
126  * Return: QDF_STATUS
127  */
128 QDF_STATUS
129 target_if_scan_set_max_active_scans(struct wlan_objmgr_psoc *psoc,
130 		uint32_t max_active_scans);
131 
132 #endif
133