blob: 4388b4e062452f6c41f01fcd97dad8c51ad4807d [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * WPA Supplicant - background scan and roaming interface
3 * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
4 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef BGSCAN_H
10#define BGSCAN_H
11
12struct wpa_supplicant;
13struct wpa_ssid;
14
15struct bgscan_ops {
16 const char *name;
17
18 void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
19 const struct wpa_ssid *ssid);
20 void (*deinit)(void *priv);
21
22 int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
23 void (*notify_beacon_loss)(void *priv);
24 void (*notify_signal_change)(void *priv, int above,
25 int current_signal,
26 int current_noise,
27 int current_txrate);
28};
29
30#ifdef CONFIG_BGSCAN
31
Dmitry Shmidtb96dad42013-11-05 10:07:29 -080032int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
33 const char *name);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070034void bgscan_deinit(struct wpa_supplicant *wpa_s);
35int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
36 struct wpa_scan_results *scan_res);
37void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
38void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
39 int current_signal, int current_noise,
40 int current_txrate);
41
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -070042/* Available bgscan modules */
43
44#ifdef CONFIG_BGSCAN_SIMPLE
45extern const struct bgscan_ops bgscan_simple_ops;
46#endif /* CONFIG_BGSCAN_SIMPLE */
47#ifdef CONFIG_BGSCAN_LEARN
48extern const struct bgscan_ops bgscan_learn_ops;
49#endif /* CONFIG_BGSCAN_LEARN */
50
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070051#else /* CONFIG_BGSCAN */
52
53static inline int bgscan_init(struct wpa_supplicant *wpa_s,
Sunil Ravib0ac25f2024-07-12 01:42:03 +000054 struct wpa_ssid *ssid, const char *name)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070055{
56 return 0;
57}
58
59static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
60{
61}
62
63static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
64 struct wpa_scan_results *scan_res)
65{
66 return 0;
67}
68
69static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
70{
71}
72
73static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
74 int above, int current_signal,
75 int current_noise,
76 int current_txrate)
77{
78}
79
80#endif /* CONFIG_BGSCAN */
81
82#endif /* BGSCAN_H */