Message ID | 1410870475-8761-1-git-send-email-tomasz.bursztyka@linux.intel.com |
---|---|
State | Superseded |
Headers | show |
On Tue, Sep 16, 2014 at 03:27:55PM +0300, Tomasz Bursztyka wrote: > It is thus possible to select which WPS methods is prefered for a P2P > device. I have nothing against making wpa_s->conf->config_methods configurable through D-Bus, but this commit message is confusing. First of all, this parameter is in no way specific to P2P, i.e., it applies to all WPS operations. Furthermore, it is not a preference; it is a list of all supported configuration methods and it should not really change unless the device capabilities changes. Could you please clarify how you are planning on using this and why this would be in P2P-specific D-Bus setter?
Hi Jouni, > On Tue, Sep 16, 2014 at 03:27:55PM +0300, Tomasz Bursztyka wrote: >> It is thus possible to select which WPS methods is prefered for a P2P >> device. > I have nothing against making wpa_s->conf->config_methods configurable > through D-Bus, but this commit message is confusing. First of all, this > parameter is in no way specific to P2P, i.e., it applies to all WPS > operations. Furthermore, it is not a preference; it is a list of all > supported configuration methods and it should not really change unless > the device capabilities changes. > > Could you please clarify how you are planning on using this and why this > would be in P2P-specific D-Bus setter? Indeed, let's change this. I'll post another patch, and this will be set through global settings DBus interface. Tomasz
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 5e90b37..4a84c22 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -991,7 +991,20 @@ dbus_bool_t wpas_dbus_setter_p2p_device_config(DBusMessageIter *iter, else if (os_strcmp(entry.key, "p2p_search_delay") == 0 && entry.type == DBUS_TYPE_UINT32) wpa_s->conf->p2p_search_delay = entry.uint32_value; - else + else if (os_strcmp(entry.key, "ConfigMethods") == 0 && + entry.type == DBUS_TYPE_STRING) { + char *methods; + + methods = os_strdup(entry.str_value); + if (!methods) + goto err_no_mem_clear; + + os_free(wpa_s->conf->config_methods); + wpa_s->conf->config_methods = methods; + + wpa_s->conf->changed_parameters |= + CFG_CHANGED_CONFIG_METHODS; + } else goto error; wpa_dbus_dict_entry_clear(&entry);
It is thus possible to select which WPS methods is prefered for a P2P device. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> --- wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)