autoscan.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * WPA Supplicant - auto scan
  3. * Copyright (c) 2012, Intel Corporation. All rights reserved.
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef AUTOSCAN_H
  9. #define AUTOSCAN_H
  10. struct wpa_supplicant;
  11. struct autoscan_ops {
  12. const char *name;
  13. void * (*init)(struct wpa_supplicant *wpa_s, const char *params);
  14. void (*deinit)(void *priv);
  15. int (*notify_scan)(void *priv, struct wpa_scan_results *scan_res);
  16. };
  17. #ifdef CONFIG_AUTOSCAN
  18. int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan);
  19. void autoscan_deinit(struct wpa_supplicant *wpa_s);
  20. int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
  21. struct wpa_scan_results *scan_res);
  22. /* Available autoscan modules */
  23. #ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  24. extern const struct autoscan_ops autoscan_exponential_ops;
  25. #endif /* CONFIG_AUTOSCAN_EXPONENTIAL */
  26. #ifdef CONFIG_AUTOSCAN_PERIODIC
  27. extern const struct autoscan_ops autoscan_periodic_ops;
  28. #endif /* CONFIG_AUTOSCAN_PERIODIC */
  29. #else /* CONFIG_AUTOSCAN */
  30. static inline int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan)
  31. {
  32. return 0;
  33. }
  34. static inline void autoscan_deinit(struct wpa_supplicant *wpa_s)
  35. {
  36. }
  37. static inline int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
  38. struct wpa_scan_results *scan_res)
  39. {
  40. return 0;
  41. }
  42. #endif /* CONFIG_AUTOSCAN */
  43. #endif /* AUTOSCAN_H */