Home | History | Annotate | Line # | Download | only in wpa_supplicant
bgscan.h revision 1.1.1.1.6.2
      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.1.1.6.2      yamt  * This software may be distributed under the terms of the BSD license.
      6  1.1.1.1.6.2      yamt  * See README for more details.
      7          1.1  christos  */
      8          1.1  christos 
      9          1.1  christos #ifndef BGSCAN_H
     10          1.1  christos #define BGSCAN_H
     11          1.1  christos 
     12          1.1  christos struct wpa_supplicant;
     13          1.1  christos struct wpa_ssid;
     14          1.1  christos 
     15          1.1  christos struct bgscan_ops {
     16          1.1  christos 	const char *name;
     17          1.1  christos 
     18          1.1  christos 	void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
     19          1.1  christos 		       const struct wpa_ssid *ssid);
     20          1.1  christos 	void (*deinit)(void *priv);
     21          1.1  christos 
     22  1.1.1.1.6.1      yamt 	int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
     23          1.1  christos 	void (*notify_beacon_loss)(void *priv);
     24  1.1.1.1.6.1      yamt 	void (*notify_signal_change)(void *priv, int above,
     25  1.1.1.1.6.1      yamt 				     int current_signal,
     26  1.1.1.1.6.1      yamt 				     int current_noise,
     27  1.1.1.1.6.1      yamt 				     int current_txrate);
     28          1.1  christos };
     29          1.1  christos 
     30          1.1  christos #ifdef CONFIG_BGSCAN
     31          1.1  christos 
     32          1.1  christos int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
     33          1.1  christos void bgscan_deinit(struct wpa_supplicant *wpa_s);
     34  1.1.1.1.6.1      yamt int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
     35  1.1.1.1.6.1      yamt 		       struct wpa_scan_results *scan_res);
     36          1.1  christos void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
     37  1.1.1.1.6.1      yamt void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
     38  1.1.1.1.6.1      yamt 				 int current_signal, int current_noise,
     39  1.1.1.1.6.1      yamt 				 int current_txrate);
     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.1.1.6.1      yamt static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
     54  1.1.1.1.6.1      yamt 				     struct wpa_scan_results *scan_res)
     55          1.1  christos {
     56          1.1  christos 	return 0;
     57          1.1  christos }
     58          1.1  christos 
     59          1.1  christos static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
     60          1.1  christos {
     61          1.1  christos }
     62          1.1  christos 
     63          1.1  christos static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
     64  1.1.1.1.6.1      yamt 					       int above, int current_signal,
     65  1.1.1.1.6.1      yamt 					       int current_noise,
     66  1.1.1.1.6.1      yamt 					       int current_txrate)
     67          1.1  christos {
     68          1.1  christos }
     69          1.1  christos 
     70          1.1  christos #endif /* CONFIG_BGSCAN */
     71          1.1  christos 
     72          1.1  christos #endif /* BGSCAN_H */
     73