aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-02-27 16:46:02 (GMT)
committerJouni Malinen <j@w1.fi>2010-02-27 16:46:02 (GMT)
commit207ef3fb12b713e9432d0eca81d0632c124ee271 (patch)
treeb41a27b6d443e24d88e7b250a6075cc45c8083ad /wpa_supplicant/wpa_cli.c
parentbe8be6717d0fc9568b436826453ed8541a017f5b (diff)
downloadhostap-207ef3fb12b713e9432d0eca81d0632c124ee271.zip
hostap-207ef3fb12b713e9432d0eca81d0632c124ee271.tar.gz
hostap-207ef3fb12b713e9432d0eca81d0632c124ee271.tar.bz2
Add suspend/resume notifications
wpa_supplicant can now be notified of suspend/resume events, e.g., from pm-action scripts. This allows wpa_supplicant to clear information that may become invalid during a suspend operation.
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index d3b9e1f..518afa0 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1403,6 +1403,18 @@ static int wpa_cli_cmd_all_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
#endif /* CONFIG_AP */
+static int wpa_cli_cmd_suspend(struct wpa_ctrl *ctrl, int argc, char *argv[])
+{
+ return wpa_ctrl_command(ctrl, "SUSPEND");
+}
+
+
+static int wpa_cli_cmd_resume(struct wpa_ctrl *ctrl, int argc, char *argv[])
+{
+ return wpa_ctrl_command(ctrl, "RESUME");
+}
+
+
enum wpa_cli_cmd_flags {
cli_cmd_flag_none = 0x00,
cli_cmd_flag_sensitive = 0x01
@@ -1597,6 +1609,10 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
cli_cmd_flag_none,
"= get information about all associated stations (AP)" },
#endif /* CONFIG_AP */
+ { "suspend", wpa_cli_cmd_suspend, cli_cmd_flag_none,
+ "= notification of suspend/hibernate" },
+ { "resume", wpa_cli_cmd_resume, cli_cmd_flag_none,
+ "= notification of resume/thaw" },
{ NULL, NULL, cli_cmd_flag_none, NULL }
};