aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-07-20 10:33:30 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-20 10:33:30 (GMT)
commit3188aabaf1b04ac40c5baa8270cee72862568205 (patch)
tree3a1ca250e0b71db687ff2a05382e71a68c380e25 /wpa_supplicant
parent8c0d0ff22e402977ddf814d798a5c8e02a21199c (diff)
downloadhostap-3188aabaf1b04ac40c5baa8270cee72862568205.zip
hostap-3188aabaf1b04ac40c5baa8270cee72862568205.tar.gz
hostap-3188aabaf1b04ac40c5baa8270cee72862568205.tar.bz2
Add shared periodic cleanup function for AP mode
This new mechanism can be used to combine multiple periodic AP (including P2P GO) task into a single eloop timeout to minimize number of wakeups for the process. hostapd gets its own periodic caller and wpa_supplicant uses the previously added timer to trigger these calls. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ap.c7
-rw-r--r--wpa_supplicant/ap.h2
-rw-r--r--wpa_supplicant/wpa_supplicant.c6
3 files changed, 14 insertions, 1 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index aaea524..ce09c57 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1369,3 +1369,10 @@ void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
radar->chan_width, radar->cf1, radar->cf2);
}
#endif /* NEED_AP_MLME */
+
+
+void ap_periodic(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->ap_iface)
+ hostapd_periodic_iface(wpa_s->ap_iface);
+}
diff --git a/wpa_supplicant/ap.h b/wpa_supplicant/ap.h
index 3f4151d..594168c 100644
--- a/wpa_supplicant/ap.h
+++ b/wpa_supplicant/ap.h
@@ -93,4 +93,6 @@ void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
struct dfs_event *radar);
+void ap_periodic(struct wpa_supplicant *wpa_s);
+
#endif /* AP_H */
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index ac46ef7..3b107a1 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -4760,8 +4760,12 @@ static void wpas_periodic(void *eloop_ctx, void *timeout_ctx)
p2p_expire_peers(global->p2p);
#endif /* CONFIG_P2P */
- for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next)
+ for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
wpa_bss_flush_by_age(wpa_s, wpa_s->conf->bss_expiration_age);
+#ifdef CONFIG_AP
+ ap_periodic(wpa_s);
+#endif /* CONFIG_AP */
+ }
}