bgscan.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. const char *name);
  27. void bgscan_deinit(struct wpa_supplicant *wpa_s);
  28. int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
  29. struct wpa_scan_results *scan_res);
  30. void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s);
  31. void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above,
  32. int current_signal, int current_noise,
  33. int current_txrate);
  34. /* Available bgscan modules */
  35. #ifdef CONFIG_BGSCAN_SIMPLE
  36. extern const struct bgscan_ops bgscan_simple_ops;
  37. #endif /* CONFIG_BGSCAN_SIMPLE */
  38. #ifdef CONFIG_BGSCAN_LEARN
  39. extern const struct bgscan_ops bgscan_learn_ops;
  40. #endif /* CONFIG_BGSCAN_LEARN */
  41. #else /* CONFIG_BGSCAN */
  42. static inline int bgscan_init(struct wpa_supplicant *wpa_s,
  43. struct wpa_ssid *ssid, const char name)
  44. {
  45. return 0;
  46. }
  47. static inline void bgscan_deinit(struct wpa_supplicant *wpa_s)
  48. {
  49. }
  50. static inline int bgscan_notify_scan(struct wpa_supplicant *wpa_s,
  51. struct wpa_scan_results *scan_res)
  52. {
  53. return 0;
  54. }
  55. static inline void bgscan_notify_beacon_loss(struct wpa_supplicant *wpa_s)
  56. {
  57. }
  58. static inline void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s,
  59. int above, int current_signal,
  60. int current_noise,
  61. int current_txrate)
  62. {
  63. }
  64. #endif /* CONFIG_BGSCAN */
  65. #endif /* BGSCAN_H */