bgscan.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * WPA Supplicant - background scan and roaming interface
  3. * Copyright (c) 2009-2010, Jouni Malinen <j@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. #ifndef BGSCAN_H
  15. #define BGSCAN_H
  16. struct wpa_supplicant;
  17. struct wpa_ssid;
  18. struct bgscan_ops {
  19. const char *name;
  20. void * (*init)(struct wpa_supplicant *wpa_s, const char *params,
  21. const struct wpa_ssid *ssid);
  22. void (*deinit)(void *priv);
  23. int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
  24. void (*notify_beacon_loss)(void *priv);
  25. void (*notify_signal_change)(void *priv, int above);
  26. };
  27. #ifdef CONFIG_BGSCAN
  28. int bgscan_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  29. void bgscan_deinit(struct wpa_supplicant *wpa_s);
  30. int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
  31. struct wpa_scan_results *scan_res);
  32. void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
  33. void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above);
  34. #else /* CONFIG_BGSCAN */
  35. static inline int bgscan_init(struct wpa_supplicant *wpa_s,
  36. struct wpa_ssid *ssid)
  37. {
  38. return 0;
  39. }
  40. static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
  41. {
  42. }
  43. static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
  44. struct wpa_scan_results *scan_res)
  45. {
  46. return 0;
  47. }
  48. static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
  49. {
  50. }
  51. static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
  52. int above)
  53. {
  54. }
  55. #endif /* CONFIG_BGSCAN */
  56. #endif /* BGSCAN_H */