aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/autoscan.h
blob: 560684fcbf770adc78026b983a9dc18b451baf69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * WPA Supplicant - auto scan
 * Copyright (c) 2012, Intel Corporation. All rights reserved.
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */

#ifndef AUTOSCAN_H
#define AUTOSCAN_H

struct wpa_supplicant;

struct autoscan_ops {
	const char *name;

	void * (*init)(struct wpa_supplicant *wpa_s, const char *params);
	void (*deinit)(void *priv);

	int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
};

#ifdef CONFIG_AUTOSCAN

int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan);
void autoscan_deinit(struct wpa_supplicant *wpa_s);
int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
			 struct wpa_scan_results *scan_res);

/* Available autoscan modules */

#ifdef CONFIG_AUTOSCAN_EXPONENTIAL
extern const struct autoscan_ops autoscan_exponential_ops;
#endif /* CONFIG_AUTOSCAN_EXPONENTIAL */

#ifdef CONFIG_AUTOSCAN_PERIODIC
extern const struct autoscan_ops autoscan_periodic_ops;
#endif /* CONFIG_AUTOSCAN_PERIODIC */

#else /* CONFIG_AUTOSCAN */

static inline int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan)
{
	return 0;
}

static inline void autoscan_deinit(struct wpa_supplicant *wpa_s)
{
}

static inline int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
				       struct wpa_scan_results *scan_res)
{
	return 0;
}

#endif /* CONFIG_AUTOSCAN */

#endif /* AUTOSCAN_H */