Home | History | Annotate | Line # | Download | only in wpa_supplicant
bgscan.h revision 1.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  christos 	int (*notify_scan)(void *priv);
     29  1.1  christos 	void (*notify_beacon_loss)(void *priv);
     30  1.1  christos 	void (*notify_signal_change)(void *priv, int above);
     31  1.1  christos };
     32  1.1  christos 
     33  1.1  christos #ifdef CONFIG_BGSCAN
     34  1.1  christos 
     35  1.1  christos int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
     36  1.1  christos void bgscan_deinit(struct wpa_supplicant *wpa_s);
     37  1.1  christos int bgscan_notify_scan(struct wpa_supplicant *wpa_s);
     38  1.1  christos void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
     39  1.1  christos void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above);
     40  1.1  christos 
     41  1.1  christos #else /* CONFIG_BGSCAN */
     42  1.1  christos 
     43  1.1  christos static inline int bgscan_init(struct wpa_supplicant *wpa_s,
     44  1.1  christos 			      struct wpa_ssid *ssid)
     45  1.1  christos {
     46  1.1  christos 	return 0;
     47  1.1  christos }
     48  1.1  christos 
     49  1.1  christos static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
     50  1.1  christos {
     51  1.1  christos }
     52  1.1  christos 
     53  1.1  christos static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s)
     54  1.1  christos {
     55  1.1  christos 	return 0;
     56  1.1  christos }
     57  1.1  christos 
     58  1.1  christos static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
     59  1.1  christos {
     60  1.1  christos }
     61  1.1  christos 
     62  1.1  christos static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
     63  1.1  christos 					       int above)
     64  1.1  christos {
     65  1.1  christos }
     66  1.1  christos 
     67  1.1  christos #endif /* CONFIG_BGSCAN */
     68  1.1  christos 
     69  1.1  christos #endif /* BGSCAN_H */
     70