1*03f9172cSAndroid Build Coastguard Worker /*
2*03f9172cSAndroid Build Coastguard Worker * WPA Supplicant - background scan and roaming interface
3*03f9172cSAndroid Build Coastguard Worker * Copyright (c) 2009-2010, Jouni Malinen <[email protected]>
4*03f9172cSAndroid Build Coastguard Worker *
5*03f9172cSAndroid Build Coastguard Worker * This software may be distributed under the terms of the BSD license.
6*03f9172cSAndroid Build Coastguard Worker * See README for more details.
7*03f9172cSAndroid Build Coastguard Worker */
8*03f9172cSAndroid Build Coastguard Worker
9*03f9172cSAndroid Build Coastguard Worker #ifndef BGSCAN_H
10*03f9172cSAndroid Build Coastguard Worker #define BGSCAN_H
11*03f9172cSAndroid Build Coastguard Worker
12*03f9172cSAndroid Build Coastguard Worker struct wpa_supplicant;
13*03f9172cSAndroid Build Coastguard Worker struct wpa_ssid;
14*03f9172cSAndroid Build Coastguard Worker
15*03f9172cSAndroid Build Coastguard Worker struct bgscan_ops {
16*03f9172cSAndroid Build Coastguard Worker const char *name;
17*03f9172cSAndroid Build Coastguard Worker
18*03f9172cSAndroid Build Coastguard Worker void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
19*03f9172cSAndroid Build Coastguard Worker const struct wpa_ssid *ssid);
20*03f9172cSAndroid Build Coastguard Worker void (*deinit)(void *priv);
21*03f9172cSAndroid Build Coastguard Worker
22*03f9172cSAndroid Build Coastguard Worker int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
23*03f9172cSAndroid Build Coastguard Worker void (*notify_beacon_loss)(void *priv);
24*03f9172cSAndroid Build Coastguard Worker void (*notify_signal_change)(void *priv, int above,
25*03f9172cSAndroid Build Coastguard Worker int current_signal,
26*03f9172cSAndroid Build Coastguard Worker int current_noise,
27*03f9172cSAndroid Build Coastguard Worker int current_txrate);
28*03f9172cSAndroid Build Coastguard Worker };
29*03f9172cSAndroid Build Coastguard Worker
30*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_BGSCAN
31*03f9172cSAndroid Build Coastguard Worker
32*03f9172cSAndroid Build Coastguard Worker int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
33*03f9172cSAndroid Build Coastguard Worker const char *name);
34*03f9172cSAndroid Build Coastguard Worker void bgscan_deinit(struct wpa_supplicant *wpa_s);
35*03f9172cSAndroid Build Coastguard Worker int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
36*03f9172cSAndroid Build Coastguard Worker struct wpa_scan_results *scan_res);
37*03f9172cSAndroid Build Coastguard Worker void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
38*03f9172cSAndroid Build Coastguard Worker void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
39*03f9172cSAndroid Build Coastguard Worker int current_signal, int current_noise,
40*03f9172cSAndroid Build Coastguard Worker int current_txrate);
41*03f9172cSAndroid Build Coastguard Worker
42*03f9172cSAndroid Build Coastguard Worker /* Available bgscan modules */
43*03f9172cSAndroid Build Coastguard Worker
44*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_BGSCAN_SIMPLE
45*03f9172cSAndroid Build Coastguard Worker extern const struct bgscan_ops bgscan_simple_ops;
46*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_BGSCAN_SIMPLE */
47*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_BGSCAN_LEARN
48*03f9172cSAndroid Build Coastguard Worker extern const struct bgscan_ops bgscan_learn_ops;
49*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_BGSCAN_LEARN */
50*03f9172cSAndroid Build Coastguard Worker
51*03f9172cSAndroid Build Coastguard Worker #else /* CONFIG_BGSCAN */
52*03f9172cSAndroid Build Coastguard Worker
bgscan_init(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,const char * name)53*03f9172cSAndroid Build Coastguard Worker static inline int bgscan_init(struct wpa_supplicant *wpa_s,
54*03f9172cSAndroid Build Coastguard Worker struct wpa_ssid *ssid, const char *name)
55*03f9172cSAndroid Build Coastguard Worker {
56*03f9172cSAndroid Build Coastguard Worker return 0;
57*03f9172cSAndroid Build Coastguard Worker }
58*03f9172cSAndroid Build Coastguard Worker
bgscan_deinit(struct wpa_supplicant * wpa_s)59*03f9172cSAndroid Build Coastguard Worker static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
60*03f9172cSAndroid Build Coastguard Worker {
61*03f9172cSAndroid Build Coastguard Worker }
62*03f9172cSAndroid Build Coastguard Worker
bgscan_notify_scan(struct wpa_supplicant * wpa_s,struct wpa_scan_results * scan_res)63*03f9172cSAndroid Build Coastguard Worker static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
64*03f9172cSAndroid Build Coastguard Worker struct wpa_scan_results *scan_res)
65*03f9172cSAndroid Build Coastguard Worker {
66*03f9172cSAndroid Build Coastguard Worker return 0;
67*03f9172cSAndroid Build Coastguard Worker }
68*03f9172cSAndroid Build Coastguard Worker
bgscan_notify_beacon_loss(struct wpa_supplicant * wpa_s)69*03f9172cSAndroid Build Coastguard Worker static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
70*03f9172cSAndroid Build Coastguard Worker {
71*03f9172cSAndroid Build Coastguard Worker }
72*03f9172cSAndroid Build Coastguard Worker
bgscan_notify_signal_change(struct wpa_supplicant * wpa_s,int above,int current_signal,int current_noise,int current_txrate)73*03f9172cSAndroid Build Coastguard Worker static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
74*03f9172cSAndroid Build Coastguard Worker int above, int current_signal,
75*03f9172cSAndroid Build Coastguard Worker int current_noise,
76*03f9172cSAndroid Build Coastguard Worker int current_txrate)
77*03f9172cSAndroid Build Coastguard Worker {
78*03f9172cSAndroid Build Coastguard Worker }
79*03f9172cSAndroid Build Coastguard Worker
80*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_BGSCAN */
81*03f9172cSAndroid Build Coastguard Worker
82*03f9172cSAndroid Build Coastguard Worker #endif /* BGSCAN_H */
83