Lines Matching refs:wpa_s
22 wpas_get_tx_interface(struct wpa_supplicant *wpa_s, const u8 *src)
26 if (os_memcmp(src, wpa_s->own_addr, ETH_ALEN) == 0)
27 return wpa_s;
32 iface = wpa_s->global->ifaces;
41 iface->ifname, wpa_s->ifname);
45 return wpa_s;
51 struct wpa_supplicant *wpa_s = eloop_ctx;
56 without_roc = wpa_s->pending_action_without_roc;
57 wpa_s->pending_action_without_roc = 0;
60 without_roc, wpa_s->pending_action_tx,
61 !!wpa_s->pending_action_tx_done);
63 if (wpa_s->pending_action_tx == NULL || wpa_s->pending_action_tx_done)
75 iface = wpas_get_tx_interface(wpa_s, wpa_s->pending_action_src);
77 if (wpa_s->off_channel_freq != wpa_s->pending_action_freq &&
78 wpa_s->pending_action_freq != 0 &&
79 wpa_s->pending_action_freq != iface->assoc_freq) {
83 wpa_s->pending_action_freq,
84 wpa_s->off_channel_freq,
86 if (without_roc && wpa_s->off_channel_freq == 0) {
96 if (wpa_s->extra_roc_dur) {
100 duration + wpa_s->extra_roc_dur);
101 duration += wpa_s->extra_roc_dur;
105 wpa_s, wpa_s->pending_action_freq,
110 "TX", wpa_s->pending_action_freq);
112 wpa_s->off_channel_freq = 0;
113 wpa_s->roc_waiting_drv_freq =
114 wpa_s->pending_action_freq;
122 MAC2STR(wpa_s->pending_action_dst), iface->ifname,
123 wpa_s->pending_action_tx);
124 res = wpa_drv_send_action(iface, wpa_s->pending_action_freq, 0,
125 wpa_s->pending_action_dst,
126 wpa_s->pending_action_src,
127 wpa_s->pending_action_bssid,
128 wpabuf_head(wpa_s->pending_action_tx),
129 wpabuf_len(wpa_s->pending_action_tx),
130 wpa_s->pending_action_no_cck);
139 wpa_s, wpa_s->pending_action_dst,
140 wpabuf_head(wpa_s->pending_action_tx),
141 wpabuf_len(wpa_s->pending_action_tx),
149 * @wpa_s: Pointer to wpa_supplicant data
159 struct wpa_supplicant *wpa_s, const u8 *dst, const u8 *data,
162 if (wpa_s->pending_action_tx == NULL) {
168 if (os_memcmp(dst, wpa_s->pending_action_dst, ETH_ALEN) != 0) {
175 if (data_len - wpabuf_len(wpa_s->pending_action_tx) != 24 ||
176 os_memcmp(data + 24, wpabuf_head(wpa_s->pending_action_tx),
177 wpabuf_len(wpa_s->pending_action_tx)) != 0) {
183 wpa_s->pending_action_tx);
190 wpa_s->pending_action_tx);
192 wpa_s->pending_action_tx);
193 wpabuf_free(wpa_s->pending_action_tx);
194 wpa_s->pending_action_tx = NULL;
197 result, wpa_s->pending_action_tx_status_cb);
199 if (wpa_s->pending_action_tx_status_cb) {
200 wpa_s->pending_action_tx_status_cb(
201 wpa_s, wpa_s->pending_action_freq,
202 wpa_s->pending_action_dst, wpa_s->pending_action_src,
203 wpa_s->pending_action_bssid,
208 if (wpa_s->p2p_long_listen > 0) {
211 wpas_p2p_listen_start(wpa_s, wpa_s->p2p_long_listen);
219 * @wpa_s: Pointer to wpa_supplicant data
238 int offchannel_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
241 void (*tx_cb)(struct wpa_supplicant *wpa_s,
254 wpa_s->pending_action_tx_status_cb = tx_cb;
256 if (wpa_s->pending_action_tx) {
259 MAC2STR(wpa_s->pending_action_dst),
260 wpa_s->pending_action_tx);
262 wpa_s->pending_action_tx);
263 wpabuf_free(wpa_s->pending_action_tx);
265 wpa_s->pending_action_tx_done = 0;
266 wpa_s->pending_action_tx = wpabuf_alloc(len);
267 if (wpa_s->pending_action_tx == NULL) {
273 wpabuf_put_data(wpa_s->pending_action_tx, buf, len);
274 os_memcpy(wpa_s->pending_action_src, src, ETH_ALEN);
275 os_memcpy(wpa_s->pending_action_dst, dst, ETH_ALEN);
276 os_memcpy(wpa_s->pending_action_bssid, bssid, ETH_ALEN);
277 wpa_s->pending_action_freq = freq;
278 wpa_s->pending_action_no_cck = no_cck;
282 MAC2STR(dst), wpa_s->pending_action_tx);
284 wpa_s->pending_action_tx);
286 if (freq != 0 && wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) {
290 iface = wpas_get_tx_interface(wpa_s, src);
291 wpa_s->action_tx_wait_time = wait_time;
294 iface, wpa_s->pending_action_freq,
295 wait_time, wpa_s->pending_action_dst,
296 wpa_s->pending_action_src, wpa_s->pending_action_bssid,
297 wpabuf_head(wpa_s->pending_action_tx),
298 wpabuf_len(wpa_s->pending_action_tx),
299 wpa_s->pending_action_no_cck);
301 wpa_s->pending_action_tx_done = 1;
307 tx_iface = wpas_get_tx_interface(wpa_s, src);
316 if (wpa_s->off_channel_freq == freq || freq == 0) {
321 wpa_s->pending_action_without_roc = 1;
322 eloop_cancel_timeout(wpas_send_action_cb, wpa_s, NULL);
323 eloop_register_timeout(0, 0, wpas_send_action_cb, wpa_s, NULL);
326 wpa_s->pending_action_without_roc = 0;
328 if (wpa_s->roc_waiting_drv_freq == freq) {
338 if (wait_time > wpa_s->max_remain_on_chan)
339 wait_time = wpa_s->max_remain_on_chan;
343 if (wpa_s->extra_roc_dur) {
345 wait_time, wait_time + wpa_s->extra_roc_dur);
346 wait_time += wpa_s->extra_roc_dur;
349 if (wpa_drv_remain_on_channel(wpa_s, freq, wait_time) < 0) {
355 wpa_s->off_channel_freq = 0;
356 wpa_s->roc_waiting_drv_freq = freq;
364 * @wpa_s: Pointer to wpa_supplicant data
369 void offchannel_send_action_done(struct wpa_supplicant *wpa_s)
373 wpa_s->pending_action_tx,
374 !!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX),
375 wpa_s->action_tx_wait_time, wpa_s->off_channel_freq,
376 wpa_s->roc_waiting_drv_freq);
377 wpabuf_free(wpa_s->pending_action_tx);
378 wpa_s->pending_action_tx = NULL;
379 if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX &&
380 wpa_s->action_tx_wait_time)
381 wpa_drv_send_action_cancel_wait(wpa_s);
382 else if (wpa_s->off_channel_freq || wpa_s->roc_waiting_drv_freq) {
383 wpa_drv_cancel_remain_on_channel(wpa_s);
384 wpa_s->off_channel_freq = 0;
385 wpa_s->roc_waiting_drv_freq = 0;
392 * @wpa_s: Pointer to wpa_supplicant data
399 void offchannel_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
402 wpa_s->roc_waiting_drv_freq = 0;
403 wpa_s->off_channel_freq = freq;
404 wpas_send_action_cb(wpa_s, NULL);
410 * @wpa_s: Pointer to wpa_supplicant data
416 void offchannel_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
419 wpa_s->off_channel_freq = 0;
425 * @wpa_s: Pointer to wpa_supplicant data
433 const void * offchannel_pending_action_tx(struct wpa_supplicant *wpa_s)
435 return wpa_s->pending_action_tx;
441 * @wpa_s: Pointer to wpa_supplicant data
443 void offchannel_clear_pending_action_tx(struct wpa_supplicant *wpa_s)
447 wpa_s->pending_action_tx);
448 wpabuf_free(wpa_s->pending_action_tx);
449 wpa_s->pending_action_tx = NULL;
455 * @wpa_s: Pointer to wpa_supplicant data
460 void offchannel_deinit(struct wpa_supplicant *wpa_s)
462 offchannel_clear_pending_action_tx(wpa_s);
463 eloop_cancel_timeout(wpas_send_action_cb, wpa_s, NULL);