bgscan.h revision 1.1.1.2
1/*
2 * WPA Supplicant - background scan and roaming interface
3 * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
13 */
14
15#ifndef BGSCAN_H
16#define BGSCAN_H
17
18struct wpa_supplicant;
19struct wpa_ssid;
20
21struct bgscan_ops {
22	const char *name;
23
24	void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
25		       const struct wpa_ssid *ssid);
26	void (*deinit)(void *priv);
27
28	int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
29	void (*notify_beacon_loss)(void *priv);
30	void (*notify_signal_change)(void *priv, int above,
31				     int current_signal,
32				     int current_noise,
33				     int current_txrate);
34};
35
36#ifdef CONFIG_BGSCAN
37
38int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
39void bgscan_deinit(struct wpa_supplicant *wpa_s);
40int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
41		       struct wpa_scan_results *scan_res);
42void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
43void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
44				 int current_signal, int current_noise,
45				 int current_txrate);
46
47#else /* CONFIG_BGSCAN */
48
49static inline int bgscan_init(struct wpa_supplicant *wpa_s,
50			      struct wpa_ssid *ssid)
51{
52	return 0;
53}
54
55static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
56{
57}
58
59static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
60				     struct wpa_scan_results *scan_res)
61{
62	return 0;
63}
64
65static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
66{
67}
68
69static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
70					       int above, int current_signal,
71					       int current_noise,
72					       int current_txrate)
73{
74}
75
76#endif /* CONFIG_BGSCAN */
77
78#endif /* BGSCAN_H */
79