]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Support dynamic update of wowlan_triggers
authorLior David <qca_liord@qca.qualcomm.com>
Wed, 13 Sep 2017 09:50:54 +0000 (12:50 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 13 Sep 2017 19:17:58 +0000 (22:17 +0300)
Previously, wowlan_triggers were updated in kernel only during startup.
Also update it whenever it is set from the control interface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/wpa_supplicant.c

index 37489f716e26321a445283d549b9eaf99eb39f81..7e6022d5719ebbf0785c7137f9ef59a573063790 100644 (file)
@@ -4550,7 +4550,7 @@ static const struct global_parse_data global_fields[] = {
        { INT(sched_scan_start_delay), 0 },
        { INT(tdls_external_control), 0},
        { STR(osu_dir), 0 },
-       { STR(wowlan_triggers), 0 },
+       { STR(wowlan_triggers), CFG_CHANGED_WOWLAN_TRIGGERS },
        { INT(p2p_search_delay), 0},
        { INT(mac_addr), 0 },
        { INT(rand_addr_lifetime), 0 },
index 6a2c8028d12c8fdf68f6f37be536f514e8587fb1..90e7e4a4c39dad2004121278a0cf87d4f8cdeca6 100644 (file)
@@ -336,6 +336,7 @@ struct wpa_cred {
 #define CFG_CHANGED_NFC_PASSWORD_TOKEN BIT(15)
 #define CFG_CHANGED_P2P_PASSPHRASE_LEN BIT(16)
 #define CFG_CHANGED_SCHED_SCAN_PLANS BIT(17)
+#define CFG_CHANGED_WOWLAN_TRIGGERS BIT(18)
 
 /**
  * struct wpa_config - wpa_supplicant configuration data
index b8c1da44e61efc2adbe18e193bd435fc1c30f7ca..cdff003d8f74b870883b44feae37160d5c5ae9e7 100644 (file)
@@ -6018,6 +6018,16 @@ void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s)
        if (wpa_s->conf->changed_parameters & CFG_CHANGED_SCHED_SCAN_PLANS)
                wpas_sched_scan_plans_set(wpa_s, wpa_s->conf->sched_scan_plans);
 
+       if (wpa_s->conf->changed_parameters & CFG_CHANGED_WOWLAN_TRIGGERS) {
+               struct wpa_driver_capa capa;
+               int res = wpa_drv_get_capa(wpa_s, &capa);
+
+               if (res == 0 && wpas_set_wowlan_triggers(wpa_s, &capa) < 0)
+                       wpa_printf(MSG_ERROR,
+                                  "Failed to update wowlan_triggers to '%s'",
+                                  wpa_s->conf->wowlan_triggers);
+       }
+
 #ifdef CONFIG_WPS
        wpas_wps_update_config(wpa_s);
 #endif /* CONFIG_WPS */