Lines Matching refs:wpa_s
22 wpas_get_tx_interface(struct wpa_supplicant *wpa_s, const u8 *src) in wpas_get_tx_interface() argument
26 if (os_memcmp(src, wpa_s->own_addr, ETH_ALEN) == 0) { in wpas_get_tx_interface()
28 if (wpa_s->p2p_mgmt && wpa_s != wpa_s->parent && in wpas_get_tx_interface()
29 wpa_s->parent->ap_iface && in wpas_get_tx_interface()
30 os_memcmp(wpa_s->parent->own_addr, in wpas_get_tx_interface()
31 wpa_s->own_addr, ETH_ALEN) == 0 && in wpas_get_tx_interface()
32 wpabuf_len(wpa_s->pending_action_tx) >= 2 && in wpas_get_tx_interface()
33 *wpabuf_head_u8(wpa_s->pending_action_tx) != in wpas_get_tx_interface()
43 wpa_s->parent->ifname, wpa_s->ifname); in wpas_get_tx_interface()
44 return wpa_s->parent; in wpas_get_tx_interface()
47 return wpa_s; in wpas_get_tx_interface()
53 iface = wpa_s->global->ifaces; in wpas_get_tx_interface()
62 iface->ifname, wpa_s->ifname); in wpas_get_tx_interface()
66 return wpa_s; in wpas_get_tx_interface()
72 struct wpa_supplicant *wpa_s = eloop_ctx; in wpas_send_action_cb() local
77 without_roc = wpa_s->pending_action_without_roc; in wpas_send_action_cb()
78 wpa_s->pending_action_without_roc = 0; in wpas_send_action_cb()
81 without_roc, wpa_s->pending_action_tx, in wpas_send_action_cb()
82 !!wpa_s->pending_action_tx_done); in wpas_send_action_cb()
84 if (wpa_s->pending_action_tx == NULL || wpa_s->pending_action_tx_done) in wpas_send_action_cb()
96 iface = wpas_get_tx_interface(wpa_s, wpa_s->pending_action_src); in wpas_send_action_cb()
98 if (wpa_s->off_channel_freq != wpa_s->pending_action_freq && in wpas_send_action_cb()
99 wpa_s->pending_action_freq != 0 && in wpas_send_action_cb()
100 wpa_s->pending_action_freq != iface->assoc_freq) { in wpas_send_action_cb()
104 wpa_s->pending_action_freq, in wpas_send_action_cb()
105 wpa_s->off_channel_freq, in wpas_send_action_cb()
107 if (without_roc && wpa_s->off_channel_freq == 0) { in wpas_send_action_cb()
117 if (wpa_s->extra_roc_dur) { in wpas_send_action_cb()
121 duration + wpa_s->extra_roc_dur); in wpas_send_action_cb()
122 duration += wpa_s->extra_roc_dur; in wpas_send_action_cb()
126 wpa_s, wpa_s->pending_action_freq, in wpas_send_action_cb()
131 "TX", wpa_s->pending_action_freq); in wpas_send_action_cb()
133 wpa_s->off_channel_freq = 0; in wpas_send_action_cb()
134 wpa_s->roc_waiting_drv_freq = in wpas_send_action_cb()
135 wpa_s->pending_action_freq; in wpas_send_action_cb()
143 MAC2STR(wpa_s->pending_action_dst), iface->ifname, in wpas_send_action_cb()
144 wpa_s->pending_action_tx); in wpas_send_action_cb()
145 res = wpa_drv_send_action(iface, wpa_s->pending_action_freq, 0, in wpas_send_action_cb()
146 wpa_s->pending_action_dst, in wpas_send_action_cb()
147 wpa_s->pending_action_src, in wpas_send_action_cb()
148 wpa_s->pending_action_bssid, in wpas_send_action_cb()
149 wpabuf_head(wpa_s->pending_action_tx), in wpas_send_action_cb()
150 wpabuf_len(wpa_s->pending_action_tx), in wpas_send_action_cb()
151 wpa_s->pending_action_no_cck); in wpas_send_action_cb()
160 wpa_s, wpa_s->pending_action_dst, in wpas_send_action_cb()
161 wpabuf_head(wpa_s->pending_action_tx), in wpas_send_action_cb()
162 wpabuf_len(wpa_s->pending_action_tx), in wpas_send_action_cb()
180 struct wpa_supplicant *wpa_s, const u8 *dst, const u8 *data, in offchannel_send_action_tx_status() argument
183 if (wpa_s->pending_action_tx == NULL) { in offchannel_send_action_tx_status()
189 if (os_memcmp(dst, wpa_s->pending_action_dst, ETH_ALEN) != 0) { in offchannel_send_action_tx_status()
196 if (data_len - wpabuf_len(wpa_s->pending_action_tx) != 24 || in offchannel_send_action_tx_status()
197 os_memcmp(data + 24, wpabuf_head(wpa_s->pending_action_tx), in offchannel_send_action_tx_status()
198 wpabuf_len(wpa_s->pending_action_tx)) != 0) { in offchannel_send_action_tx_status()
204 wpa_s->pending_action_tx); in offchannel_send_action_tx_status()
211 wpa_s->pending_action_tx); in offchannel_send_action_tx_status()
213 wpa_s->pending_action_tx); in offchannel_send_action_tx_status()
214 wpabuf_free(wpa_s->pending_action_tx); in offchannel_send_action_tx_status()
215 wpa_s->pending_action_tx = NULL; in offchannel_send_action_tx_status()
218 result, wpa_s->pending_action_tx_status_cb); in offchannel_send_action_tx_status()
220 if (wpa_s->pending_action_tx_status_cb) { in offchannel_send_action_tx_status()
221 wpa_s->pending_action_tx_status_cb( in offchannel_send_action_tx_status()
222 wpa_s, wpa_s->pending_action_freq, in offchannel_send_action_tx_status()
223 wpa_s->pending_action_dst, wpa_s->pending_action_src, in offchannel_send_action_tx_status()
224 wpa_s->pending_action_bssid, in offchannel_send_action_tx_status()
229 if (wpa_s->p2p_long_listen > 0) { in offchannel_send_action_tx_status()
232 wpas_p2p_listen_start(wpa_s, wpa_s->p2p_long_listen); in offchannel_send_action_tx_status()
259 int offchannel_send_action(struct wpa_supplicant *wpa_s, unsigned int freq, in offchannel_send_action() argument
262 void (*tx_cb)(struct wpa_supplicant *wpa_s, in offchannel_send_action() argument
275 wpa_s->pending_action_tx_status_cb = tx_cb; in offchannel_send_action()
277 if (wpa_s->pending_action_tx) { in offchannel_send_action()
280 MAC2STR(wpa_s->pending_action_dst), in offchannel_send_action()
281 wpa_s->pending_action_tx); in offchannel_send_action()
283 wpa_s->pending_action_tx); in offchannel_send_action()
284 wpabuf_free(wpa_s->pending_action_tx); in offchannel_send_action()
286 wpa_s->pending_action_tx_done = 0; in offchannel_send_action()
287 wpa_s->pending_action_tx = wpabuf_alloc(len); in offchannel_send_action()
288 if (wpa_s->pending_action_tx == NULL) { in offchannel_send_action()
294 wpabuf_put_data(wpa_s->pending_action_tx, buf, len); in offchannel_send_action()
295 os_memcpy(wpa_s->pending_action_src, src, ETH_ALEN); in offchannel_send_action()
296 os_memcpy(wpa_s->pending_action_dst, dst, ETH_ALEN); in offchannel_send_action()
297 os_memcpy(wpa_s->pending_action_bssid, bssid, ETH_ALEN); in offchannel_send_action()
298 wpa_s->pending_action_freq = freq; in offchannel_send_action()
299 wpa_s->pending_action_no_cck = no_cck; in offchannel_send_action()
303 MAC2STR(dst), wpa_s->pending_action_tx); in offchannel_send_action()
305 wpa_s->pending_action_tx); in offchannel_send_action()
307 if (freq != 0 && wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) { in offchannel_send_action()
311 iface = wpas_get_tx_interface(wpa_s, src); in offchannel_send_action()
312 wpa_s->action_tx_wait_time = wait_time; in offchannel_send_action()
314 wpa_s->action_tx_wait_time_used = 1; in offchannel_send_action()
317 iface, wpa_s->pending_action_freq, in offchannel_send_action()
318 wait_time, wpa_s->pending_action_dst, in offchannel_send_action()
319 wpa_s->pending_action_src, wpa_s->pending_action_bssid, in offchannel_send_action()
320 wpabuf_head(wpa_s->pending_action_tx), in offchannel_send_action()
321 wpabuf_len(wpa_s->pending_action_tx), in offchannel_send_action()
322 wpa_s->pending_action_no_cck); in offchannel_send_action()
324 wpa_s->pending_action_tx_done = 1; in offchannel_send_action()
330 tx_iface = wpas_get_tx_interface(wpa_s, src); in offchannel_send_action()
339 if (wpa_s->off_channel_freq == freq || freq == 0) { in offchannel_send_action()
344 wpa_s->pending_action_without_roc = 1; in offchannel_send_action()
345 eloop_cancel_timeout(wpas_send_action_cb, wpa_s, NULL); in offchannel_send_action()
346 eloop_register_timeout(0, 0, wpas_send_action_cb, wpa_s, NULL); in offchannel_send_action()
349 wpa_s->pending_action_without_roc = 0; in offchannel_send_action()
351 if (wpa_s->roc_waiting_drv_freq == freq) { in offchannel_send_action()
361 if (wait_time > wpa_s->max_remain_on_chan) in offchannel_send_action()
362 wait_time = wpa_s->max_remain_on_chan; in offchannel_send_action()
366 if (wpa_s->extra_roc_dur) { in offchannel_send_action()
368 wait_time, wait_time + wpa_s->extra_roc_dur); in offchannel_send_action()
369 wait_time += wpa_s->extra_roc_dur; in offchannel_send_action()
372 if (wpa_drv_remain_on_channel(wpa_s, freq, wait_time) < 0) { in offchannel_send_action()
378 wpa_s->off_channel_freq = 0; in offchannel_send_action()
379 wpa_s->roc_waiting_drv_freq = freq; in offchannel_send_action()
392 void offchannel_send_action_done(struct wpa_supplicant *wpa_s) in offchannel_send_action_done() argument
396 wpa_s->pending_action_tx, in offchannel_send_action_done()
397 !!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX), in offchannel_send_action_done()
398 wpa_s->action_tx_wait_time, wpa_s->off_channel_freq, in offchannel_send_action_done()
399 wpa_s->roc_waiting_drv_freq); in offchannel_send_action_done()
400 wpabuf_free(wpa_s->pending_action_tx); in offchannel_send_action_done()
401 wpa_s->pending_action_tx = NULL; in offchannel_send_action_done()
402 if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX && in offchannel_send_action_done()
403 (wpa_s->action_tx_wait_time || wpa_s->action_tx_wait_time_used)) in offchannel_send_action_done()
404 wpa_drv_send_action_cancel_wait(wpa_s); in offchannel_send_action_done()
405 else if (wpa_s->off_channel_freq || wpa_s->roc_waiting_drv_freq) { in offchannel_send_action_done()
406 wpa_drv_cancel_remain_on_channel(wpa_s); in offchannel_send_action_done()
407 wpa_s->off_channel_freq = 0; in offchannel_send_action_done()
408 wpa_s->roc_waiting_drv_freq = 0; in offchannel_send_action_done()
410 wpa_s->action_tx_wait_time_used = 0; in offchannel_send_action_done()
423 void offchannel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, in offchannel_remain_on_channel_cb() argument
426 wpa_s->roc_waiting_drv_freq = 0; in offchannel_remain_on_channel_cb()
427 wpa_s->off_channel_freq = freq; in offchannel_remain_on_channel_cb()
428 wpas_send_action_cb(wpa_s, NULL); in offchannel_remain_on_channel_cb()
440 void offchannel_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, in offchannel_cancel_remain_on_channel_cb() argument
443 wpa_s->off_channel_freq = 0; in offchannel_cancel_remain_on_channel_cb()
457 const void * offchannel_pending_action_tx(struct wpa_supplicant *wpa_s) in offchannel_pending_action_tx() argument
459 return wpa_s->pending_action_tx; in offchannel_pending_action_tx()
467 void offchannel_clear_pending_action_tx(struct wpa_supplicant *wpa_s) in offchannel_clear_pending_action_tx() argument
471 wpa_s->pending_action_tx); in offchannel_clear_pending_action_tx()
472 wpabuf_free(wpa_s->pending_action_tx); in offchannel_clear_pending_action_tx()
473 wpa_s->pending_action_tx = NULL; in offchannel_clear_pending_action_tx()
484 void offchannel_deinit(struct wpa_supplicant *wpa_s) in offchannel_deinit() argument
486 offchannel_clear_pending_action_tx(wpa_s); in offchannel_deinit()
487 eloop_cancel_timeout(wpas_send_action_cb, wpa_s, NULL); in offchannel_deinit()