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