Home | History | Annotate | Line # | Download | only in wpa_supplicant
bgscan.h revision 1.1.1.1.8.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.1.1.8.1       snj  * This software may be distributed under the terms of the BSD license.
      6  1.1.1.1.8.1       snj  * 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.8.1       snj 	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.8.1       snj 	void (*notify_signal_change)(void *priv, int above,
     25  1.1.1.1.8.1       snj 				     int current_signal,
     26  1.1.1.1.8.1       snj 				     int current_noise,
     27  1.1.1.1.8.1       snj 				     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.1.1.8.1       snj int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
     33  1.1.1.1.8.1       snj 		const char *name);
     34          1.1  christos void bgscan_deinit(struct wpa_supplicant *wpa_s);
     35  1.1.1.1.8.1       snj int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
     36  1.1.1.1.8.1       snj 		       struct wpa_scan_results *scan_res);
     37          1.1  christos void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
     38  1.1.1.1.8.1       snj void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
     39  1.1.1.1.8.1       snj 				 int current_signal, int current_noise,
     40  1.1.1.1.8.1       snj 				 int current_txrate);
     41  1.1.1.1.8.1       snj 
     42  1.1.1.1.8.1       snj /* Available bgscan modules */
     43  1.1.1.1.8.1       snj 
     44  1.1.1.1.8.1       snj #ifdef CONFIG_BGSCAN_SIMPLE
     45  1.1.1.1.8.1       snj extern const struct bgscan_ops bgscan_simple_ops;
     46  1.1.1.1.8.1       snj #endif /* CONFIG_BGSCAN_SIMPLE */
     47  1.1.1.1.8.1       snj #ifdef CONFIG_BGSCAN_LEARN
     48  1.1.1.1.8.1       snj extern const struct bgscan_ops bgscan_learn_ops;
     49  1.1.1.1.8.1       snj #endif /* CONFIG_BGSCAN_LEARN */
     50          1.1  christos 
     51          1.1  christos #else /* CONFIG_BGSCAN */
     52          1.1  christos 
     53          1.1  christos static inline int bgscan_init(struct wpa_supplicant *wpa_s,
     54  1.1.1.1.8.1       snj 			      struct wpa_ssid *ssid, const char name)
     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_deinit(struct wpa_supplicant *wpa_s)
     60          1.1  christos {
     61          1.1  christos }
     62          1.1  christos 
     63  1.1.1.1.8.1       snj static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
     64  1.1.1.1.8.1       snj 				     struct wpa_scan_results *scan_res)
     65          1.1  christos {
     66          1.1  christos 	return 0;
     67          1.1  christos }
     68          1.1  christos 
     69          1.1  christos static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
     70          1.1  christos {
     71          1.1  christos }
     72          1.1  christos 
     73          1.1  christos static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
     74  1.1.1.1.8.1       snj 					       int above, int current_signal,
     75  1.1.1.1.8.1       snj 					       int current_noise,
     76  1.1.1.1.8.1       snj 					       int current_txrate)
     77          1.1  christos {
     78          1.1  christos }
     79          1.1  christos 
     80          1.1  christos #endif /* CONFIG_BGSCAN */
     81          1.1  christos 
     82          1.1  christos #endif /* BGSCAN_H */
     83