2 * WPA Supplicant - auto scan periodic module
3 * Copyright (c) 2012, Intel Corporation. All rights reserved.
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
12 #include "wpa_supplicant_i.h"
16 struct autoscan_periodic_data {
17 int periodic_interval;
21 static int autoscan_periodic_get_params(struct autoscan_periodic_data *data,
29 interval = atoi(params);
34 data->periodic_interval = interval;
40 static void * autoscan_periodic_init(struct wpa_supplicant *wpa_s,
43 struct autoscan_periodic_data *data;
45 data = os_zalloc(sizeof(struct autoscan_periodic_data));
49 if (autoscan_periodic_get_params(data, params) < 0) {
54 wpa_printf(MSG_DEBUG, "autoscan periodic: interval is %d",
55 data->periodic_interval);
61 static void autoscan_periodic_deinit(void *priv)
63 struct autoscan_periodic_data *data = priv;
69 static int autoscan_periodic_notify_scan(void *priv,
70 struct wpa_scan_results *scan_res)
72 struct autoscan_periodic_data *data = priv;
74 wpa_printf(MSG_DEBUG, "autoscan periodic: scan result notification");
76 return data->periodic_interval;
80 const struct autoscan_ops autoscan_periodic_ops = {
82 .init = autoscan_periodic_init,
83 .deinit = autoscan_periodic_deinit,
84 .notify_scan = autoscan_periodic_notify_scan,