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