xref: /freebsd/contrib/wpa/wpa_supplicant/autoscan.h (revision 780fb4a2fa9a9aee5ac48a60b790f567c0dc13e9)
1f05cddf9SRui Paulo /*
2f05cddf9SRui Paulo  * WPA Supplicant - auto scan
3f05cddf9SRui Paulo  * Copyright (c) 2012, Intel Corporation. All rights reserved.
4f05cddf9SRui Paulo  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
7f05cddf9SRui Paulo  */
8f05cddf9SRui Paulo 
9f05cddf9SRui Paulo #ifndef AUTOSCAN_H
10f05cddf9SRui Paulo #define AUTOSCAN_H
11f05cddf9SRui Paulo 
12f05cddf9SRui Paulo struct wpa_supplicant;
13f05cddf9SRui Paulo 
14f05cddf9SRui Paulo struct autoscan_ops {
15f05cddf9SRui Paulo 	const char *name;
16f05cddf9SRui Paulo 
17f05cddf9SRui Paulo 	void * (*init)(struct wpa_supplicant *wpa_s, const char *params);
18f05cddf9SRui Paulo 	void (*deinit)(void *priv);
19f05cddf9SRui Paulo 
20f05cddf9SRui Paulo 	int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
21f05cddf9SRui Paulo };
22f05cddf9SRui Paulo 
23f05cddf9SRui Paulo #ifdef CONFIG_AUTOSCAN
24f05cddf9SRui Paulo 
25f05cddf9SRui Paulo int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan);
26f05cddf9SRui Paulo void autoscan_deinit(struct wpa_supplicant *wpa_s);
27f05cddf9SRui Paulo int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
28f05cddf9SRui Paulo 			 struct wpa_scan_results *scan_res);
29f05cddf9SRui Paulo 
30*780fb4a2SCy Schubert /* Available autoscan modules */
31*780fb4a2SCy Schubert 
32*780fb4a2SCy Schubert #ifdef CONFIG_AUTOSCAN_EXPONENTIAL
33*780fb4a2SCy Schubert extern const struct autoscan_ops autoscan_exponential_ops;
34*780fb4a2SCy Schubert #endif /* CONFIG_AUTOSCAN_EXPONENTIAL */
35*780fb4a2SCy Schubert 
36*780fb4a2SCy Schubert #ifdef CONFIG_AUTOSCAN_PERIODIC
37*780fb4a2SCy Schubert extern const struct autoscan_ops autoscan_periodic_ops;
38*780fb4a2SCy Schubert #endif /* CONFIG_AUTOSCAN_PERIODIC */
39*780fb4a2SCy Schubert 
40f05cddf9SRui Paulo #else /* CONFIG_AUTOSCAN */
41f05cddf9SRui Paulo 
autoscan_init(struct wpa_supplicant * wpa_s,int req_scan)42f05cddf9SRui Paulo static inline int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan)
43f05cddf9SRui Paulo {
44f05cddf9SRui Paulo 	return 0;
45f05cddf9SRui Paulo }
46f05cddf9SRui Paulo 
autoscan_deinit(struct wpa_supplicant * wpa_s)47f05cddf9SRui Paulo static inline void autoscan_deinit(struct wpa_supplicant *wpa_s)
48f05cddf9SRui Paulo {
49f05cddf9SRui Paulo }
50f05cddf9SRui Paulo 
autoscan_notify_scan(struct wpa_supplicant * wpa_s,struct wpa_scan_results * scan_res)51f05cddf9SRui Paulo static inline int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
52f05cddf9SRui Paulo 				       struct wpa_scan_results *scan_res)
53f05cddf9SRui Paulo {
54f05cddf9SRui Paulo 	return 0;
55f05cddf9SRui Paulo }
56f05cddf9SRui Paulo 
57f05cddf9SRui Paulo #endif /* CONFIG_AUTOSCAN */
58f05cddf9SRui Paulo 
59f05cddf9SRui Paulo #endif /* AUTOSCAN_H */
60