• Home
  • Raw
  • Download

Lines Matching refs:data

35 	struct bgscan_simple_data *data = eloop_ctx;  in bgscan_simple_timeout()  local
36 struct wpa_supplicant *wpa_s = data->wpa_s; in bgscan_simple_timeout()
41 params.ssids[0].ssid = data->ssid->ssid; in bgscan_simple_timeout()
42 params.ssids[0].ssid_len = data->ssid->ssid_len; in bgscan_simple_timeout()
43 params.freqs = data->ssid->scan_freq; in bgscan_simple_timeout()
54 eloop_register_timeout(data->scan_interval, 0, in bgscan_simple_timeout()
55 bgscan_simple_timeout, data, NULL); in bgscan_simple_timeout()
57 if (data->scan_interval == data->short_interval) { in bgscan_simple_timeout()
58 data->short_scan_count++; in bgscan_simple_timeout()
59 if (data->short_scan_count >= data->max_short_scans) { in bgscan_simple_timeout()
60 data->scan_interval = data->long_interval; in bgscan_simple_timeout()
64 } else if (data->short_scan_count > 0) { in bgscan_simple_timeout()
71 data->short_scan_count--; in bgscan_simple_timeout()
73 os_get_reltime(&data->last_bgscan); in bgscan_simple_timeout()
78 static int bgscan_simple_get_params(struct bgscan_simple_data *data, in bgscan_simple_get_params() argument
83 data->short_interval = atoi(params); in bgscan_simple_get_params()
89 data->signal_threshold = atoi(pos); in bgscan_simple_get_params()
97 data->long_interval = atoi(pos); in bgscan_simple_get_params()
107 struct bgscan_simple_data *data; in bgscan_simple_init() local
109 data = os_zalloc(sizeof(*data)); in bgscan_simple_init()
110 if (data == NULL) in bgscan_simple_init()
112 data->wpa_s = wpa_s; in bgscan_simple_init()
113 data->ssid = ssid; in bgscan_simple_init()
114 if (bgscan_simple_get_params(data, params) < 0) { in bgscan_simple_init()
115 os_free(data); in bgscan_simple_init()
118 if (data->short_interval <= 0) in bgscan_simple_init()
119 data->short_interval = 30; in bgscan_simple_init()
120 if (data->long_interval <= 0) in bgscan_simple_init()
121 data->long_interval = 30; in bgscan_simple_init()
125 data->signal_threshold, data->short_interval, in bgscan_simple_init()
126 data->long_interval); in bgscan_simple_init()
128 if (data->signal_threshold && in bgscan_simple_init()
129 wpa_drv_signal_monitor(wpa_s, data->signal_threshold, 4) < 0) { in bgscan_simple_init()
134 data->scan_interval = data->short_interval; in bgscan_simple_init()
135 data->max_short_scans = data->long_interval / data->short_interval + 1; in bgscan_simple_init()
136 if (data->signal_threshold) { in bgscan_simple_init()
140 siginfo.current_signal >= data->signal_threshold) in bgscan_simple_init()
141 data->scan_interval = data->long_interval; in bgscan_simple_init()
144 data->scan_interval); in bgscan_simple_init()
145 eloop_register_timeout(data->scan_interval, 0, bgscan_simple_timeout, in bgscan_simple_init()
146 data, NULL); in bgscan_simple_init()
154 os_get_reltime(&data->last_bgscan); in bgscan_simple_init()
156 return data; in bgscan_simple_init()
162 struct bgscan_simple_data *data = priv; in bgscan_simple_deinit() local
163 eloop_cancel_timeout(bgscan_simple_timeout, data, NULL); in bgscan_simple_deinit()
164 if (data->signal_threshold) in bgscan_simple_deinit()
165 wpa_drv_signal_monitor(data->wpa_s, 0, 0); in bgscan_simple_deinit()
166 os_free(data); in bgscan_simple_deinit()
173 struct bgscan_simple_data *data = priv; in bgscan_simple_notify_scan() local
177 eloop_cancel_timeout(bgscan_simple_timeout, data, NULL); in bgscan_simple_notify_scan()
178 eloop_register_timeout(data->scan_interval, 0, bgscan_simple_timeout, in bgscan_simple_notify_scan()
179 data, NULL); in bgscan_simple_notify_scan()
204 struct bgscan_simple_data *data = priv; in bgscan_simple_notify_signal_change() local
208 if (data->short_interval == data->long_interval || in bgscan_simple_notify_signal_change()
209 data->signal_threshold == 0) in bgscan_simple_notify_signal_change()
216 if (data->scan_interval == data->long_interval && !above) { in bgscan_simple_notify_signal_change()
219 data->scan_interval = data->short_interval; in bgscan_simple_notify_signal_change()
221 if (now.sec > data->last_bgscan.sec + 1 && in bgscan_simple_notify_signal_change()
222 data->short_scan_count <= data->max_short_scans) in bgscan_simple_notify_signal_change()
230 else if (data->last_bgscan.sec + data->long_interval > in bgscan_simple_notify_signal_change()
231 now.sec + data->scan_interval) { in bgscan_simple_notify_signal_change()
236 eloop_cancel_timeout(bgscan_simple_timeout, data, in bgscan_simple_notify_signal_change()
238 eloop_register_timeout(data->scan_interval, 0, in bgscan_simple_notify_signal_change()
239 bgscan_simple_timeout, data, in bgscan_simple_notify_signal_change()
242 } else if (data->scan_interval == data->short_interval && above) { in bgscan_simple_notify_signal_change()
245 data->scan_interval = data->long_interval; in bgscan_simple_notify_signal_change()
246 eloop_cancel_timeout(bgscan_simple_timeout, data, NULL); in bgscan_simple_notify_signal_change()
247 eloop_register_timeout(data->scan_interval, 0, in bgscan_simple_notify_signal_change()
248 bgscan_simple_timeout, data, NULL); in bgscan_simple_notify_signal_change()
255 if (now.sec > data->last_bgscan.sec + 10) in bgscan_simple_notify_signal_change()
261 eloop_cancel_timeout(bgscan_simple_timeout, data, NULL); in bgscan_simple_notify_signal_change()
262 eloop_register_timeout(0, 0, bgscan_simple_timeout, data, in bgscan_simple_notify_signal_change()