bgscan.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * WPA Supplicant - background scan and roaming interface
  3. * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef BGSCAN_H
  9. #define BGSCAN_H
  10. struct wpa_supplicant;
  11. struct wpa_ssid;
  12. struct bgscan_ops {
  13. const char *name;
  14. void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
  15. const struct wpa_ssid *ssid);
  16. void (*deinit)(void *priv);
  17. int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
  18. void (*notify_beacon_loss)(void *priv);
  19. void (*notify_signal_change)(void *priv, int above,
  20. int current_signal,
  21. int current_noise,
  22. int current_txrate);
  23. };
  24. #ifdef CONFIG_BGSCAN
  25. int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  26. void bgscan_deinit(struct wpa_supplicant *wpa_s);
  27. int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
  28. struct wpa_scan_results *scan_res);
  29. void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
  30. void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
  31. int current_signal, int current_noise,
  32. int current_txrate);
  33. #else /* CONFIG_BGSCAN */
  34. static inline int bgscan_init(struct wpa_supplicant *wpa_s,
  35. struct wpa_ssid *ssid)
  36. {
  37. return 0;
  38. }
  39. static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
  40. {
  41. }
  42. static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
  43. struct wpa_scan_results *scan_res)
  44. {
  45. return 0;
  46. }
  47. static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
  48. {
  49. }
  50. static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
  51. int above, int current_signal,
  52. int current_noise,
  53. int current_txrate)
  54. {
  55. }
  56. #endif /* CONFIG_BGSCAN */
  57. #endif /* BGSCAN_H */