Commit e7d08af9 authored by Slava Monich's avatar Slava Monich

[connman] Added sailfish_wifi plugin. JB#37468

Replaces the original wifi plugin, as it was becoming unmaintainable.
Significant portions of the original one have been rewritten which
made applying upstream patches increasingly difficult. Also, upstream
is pushing their own replacement for wpa_supplicant and is likely to
stop supporting this plugin anyway.

This also removes support for signal_poll plugins from the connman core.
It was never merged upstream (for unknown reasons) and since nothing but
sailfish_wifi plugin is using this functionality, there's no need to have
it as a plugin.

[connman] WPS push button configuration. Fixes JB#37812
parent bdd95fe1
plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
@DBUS_CFLAGS@ @GLIB_CFLAGS@
plugin_ldflags = -no-undefined -module -avoid-version
......@@ -27,6 +26,11 @@ builtin_sources += plugins/wifi.c $(gsupplicant_sources)
src_connmand_CFLAGS += -DWIFI_PLUGIN
endif
if SAILFISH_WIFI
builtin_modules += sailfish_wifi
builtin_sources += plugins/sailfish_wifi.c plugins/sailfish_signalpoll.c
endif
if BLUETOOTH
builtin_modules += bluetooth_legacy
builtin_sources += plugins/bluetooth_legacy.c
......@@ -81,11 +85,6 @@ builtin_modules += sailfish_usb_tethering
builtin_sources += plugins/sailfish_usb_tethering.c
endif
if SAILFISH_SIGNALPOLL
builtin_modules += sailfish_signalpoll
builtin_sources += plugins/sailfish_signalpoll.c
endif
if VPN
builtin_modules += vpn
builtin_sources += plugins/vpn.c
......
......@@ -401,16 +401,18 @@ AC_ARG_ENABLE(sailfish-usb-tethering,
[enable_sailfish_usb=${enableval}], [enable_sailfish_usb="no"])
AM_CONDITIONAL(SAILFISH_USB_TETHERING, test "${enable_sailfish_usb_tethering}" != "no")
AC_ARG_ENABLE(sailfish-signalpoll,
AC_HELP_STRING([--enable-sailfish-signalpoll], [enable Sailfish signal poll plugin]),
[enable_sailfish_signalpoll=${enableval}], [enable_sailfish_signalpoll="no"])
AM_CONDITIONAL(SAILFISH_SIGNALPOLL, test "${enable_sailfish_signalpoll}" != "no")
AC_ARG_ENABLE(sailfish-wifi,
AC_HELP_STRING([--enable-sailfish-wifi], [enable Sailfish WiFi plugin]),
[enable_sailfish_wifi=${enableval}], [enable_sailfish_wifi="no"])
AM_CONDITIONAL(SAILFISH_WIFI, test "${enable_sailfish_wifi}" != "no")
if (test "${enable_sailfish_signalpoll}" = "yes"); then
if (test "${enable_sailfish_wifi}" = "yes"); then
PKG_CHECK_MODULES(LIBMCE, libmce-glib, dummy=yes,
AC_MSG_ERROR(libmce-glib is required))
CFLAGS="$CFLAGS $LIBMCE_CFLAGS"
LIBS="$LIBS $LIBMCE_LIBS"
PKG_CHECK_MODULES(GSUPPLICANT, libgsupplicant, dummy=yes,
AC_MSG_ERROR(libgsupplicant is required))
CFLAGS="$CFLAGS $GSUPPLICANT_CFLAGS $LIBMCE_CFLAGS"
LIBS="$LIBS $GSUPPLICANT_LIBS $LIBMCE_LIBS"
need_glibutil=yes
fi
......@@ -420,8 +422,8 @@ AC_ARG_ENABLE(sailfish-ofono,
AM_CONDITIONAL(SAILFISH_OFONO, test "${enable_sailfish_ofono}" != "no")
if (test "${enable_sailfish_ofono}" = "yes"); then
PKG_CHECK_MODULES(GOFONO, libgofono, dummy=yes,
AC_MSG_ERROR(libgofono is required))
PKG_CHECK_MODULES(GOFONO, libgofono >= 2.0.0, dummy=yes,
AC_MSG_ERROR(libgofono >= 2.0.0 is required))
PKG_CHECK_MODULES(GOFONOEXT, libgofonoext, dummy=yes,
AC_MSG_ERROR(libgofonoext is required))
CFLAGS="$CFLAGS $GOFONO_CFLAGS $GOFONOEXT_CFLAGS"
......@@ -430,8 +432,8 @@ if (test "${enable_sailfish_ofono}" = "yes"); then
fi
if (test "${need_glibutil}" = "yes"); then
PKG_CHECK_MODULES(GLIBUTIL, libglibutil, dummy=yes,
AC_MSG_ERROR(libglibutil is required))
PKG_CHECK_MODULES(GLIBUTIL, libglibutil >= 1.0.20, dummy=yes,
AC_MSG_ERROR(libglibutil >= 1.0.20 is required))
CFLAGS="$CFLAGS $GLIBUTIL_CFLAGS"
LIBS="$LIBS $GLIBUTIL_LIBS"
fi
......
......@@ -173,13 +173,6 @@ struct _GSupplicantScanParams {
uint16_t *freqs;
};
typedef struct _GSupplicantSignalPoll {
int rssi;
int linkspeed;
int noise;
unsigned int frequency;
} GSupplicantSignalPoll;
typedef struct _GSupplicantScanParams GSupplicantScanParams;
struct _GSupplicantPeerParams {
......@@ -223,10 +216,6 @@ typedef void (*GSupplicantInterfaceCallback) (int result,
GSupplicantInterface *interface,
void *user_data);
typedef void (*GSupplicantSignalPollCallback) (int result,
const GSupplicantSignalPoll *data,
void *user_data);
void g_supplicant_interface_cancel(GSupplicantInterface *interface);
int g_supplicant_interface_create(const char *ifname, const char *driver,
......@@ -303,9 +292,6 @@ int g_supplicant_interface_set_country(GSupplicantInterface *interface,
GSupplicantCountryCallback callback,
const char *alpha2,
void *user_data);
int g_supplicant_interface_signal_poll(GSupplicantInterface *interface,
GSupplicantSignalPollCallback callback,
void *user_data);
bool g_supplicant_interface_has_p2p(GSupplicantInterface *interface);
int g_supplicant_interface_set_p2p_device_config(GSupplicantInterface *interface,
const char *device_name,
......
......@@ -3396,127 +3396,6 @@ int g_supplicant_interface_set_country(GSupplicantInterface *interface,
return ret;
}
static bool signal_poll_get_data(DBusMessageIter *iter,
GSupplicantSignalPoll *data)
{
DBusMessageIter array, dict;
memset(data, 0, sizeof(*data));
if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_VARIANT)
return false;
dbus_message_iter_recurse(iter, &array);
if (dbus_message_iter_get_arg_type(&array) != DBUS_TYPE_ARRAY)
return false;
dbus_message_iter_recurse(&array, &dict);
while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
DBusMessageIter entry, value;
DBusBasicValue basic;
const char *key = NULL;
dbus_message_iter_recurse(&dict, &entry);
if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING)
return false;
dbus_message_iter_get_basic(&entry, &key);
dbus_message_iter_next(&entry);
if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_VARIANT)
return false;
dbus_message_iter_recurse(&entry, &value);
if (g_str_equal(key, "rssi")) {
if (dbus_message_iter_get_arg_type(&value) !=
DBUS_TYPE_INT32)
return false;
dbus_message_iter_get_basic(&value, &basic);
data->rssi = basic.i32;
} else if (g_str_equal(key, "linkspeed")) {
if (dbus_message_iter_get_arg_type(&value) !=
DBUS_TYPE_INT32)
return false;
dbus_message_iter_get_basic(&value, &basic);
data->linkspeed = basic.i32;
} else if (g_str_equal(key, "noise")) {
if (dbus_message_iter_get_arg_type(&value) !=
DBUS_TYPE_INT32)
return false;
dbus_message_iter_get_basic(&value, &basic);
data->noise = basic.i32;
} else if (g_str_equal(key, "frequency")) {
if (dbus_message_iter_get_arg_type(&value) !=
DBUS_TYPE_UINT32)
return false;
dbus_message_iter_get_basic(&value, &basic);
data->frequency = basic.u32;
}
dbus_message_iter_next(&dict);
}
return true;
}
struct signal_poll_call {
GSupplicantSignalPollCallback callback;
void *user_data;
};
static void signal_poll_result(const char *error, DBusMessageIter *iter,
void *user_data)
{
struct signal_poll_call *call = user_data;
const GSupplicantSignalPoll *data = NULL;
GSupplicantSignalPoll parsed_data;
int result;
if (error) {
SUPPLICANT_DBG("SignalPoll failure %s", error);
result = -EFAULT;
} else if (!signal_poll_get_data(iter, &parsed_data)) {
SUPPLICANT_DBG("failed to parse SignalPoll result");
result = -EINVAL;
} else {
SUPPLICANT_DBG("SignalPoll OK");
data = &parsed_data;
result = 0;
}
call->callback(result, data, call->user_data);
g_free(call);
}
int g_supplicant_interface_signal_poll(GSupplicantInterface *interface,
GSupplicantSignalPollCallback callback,
void *user_data)
{
struct signal_poll_call *call;
int ret;
/* This call makes no sense without the callback */
if (!callback)
return -EINVAL;
call = dbus_new0(struct signal_poll_call, 1);
if (!call)
return -ENOMEM;
call->callback = callback;
call->user_data = user_data;
ret = supplicant_dbus_method_call(interface->path,
SUPPLICANT_INTERFACE ".Interface", "SignalPoll", NULL,
signal_poll_result, call, interface);
if (ret < 0)
dbus_free(call);
return ret;
}
bool g_supplicant_interface_has_p2p(GSupplicantInterface *interface)
{
if (!interface)
......
......@@ -84,8 +84,6 @@ int connman_device_set_scanning(struct connman_device *device,
enum connman_service_type type, bool scanning);
bool connman_device_get_scanning(struct connman_device *device);
void connman_device_reset_scanning(struct connman_device *device);
bool connman_device_supports_signal_poll(struct connman_device *device);
int connman_device_signal_poll(struct connman_device *device);
int connman_device_set_string(struct connman_device *device,
const char *key, const char *value);
......@@ -128,7 +126,6 @@ struct connman_device_driver {
const char *security, void *user_data);
int (*set_regdom) (struct connman_device *device,
const char *alpha2);
int (*signal_poll) (struct connman_device *device);
};
int connman_device_driver_register(struct connman_device_driver *driver);
......
This diff is collapsed.
/*
* Connection Manager
*
* Copyright (C) 2015-2017 Jolla Ltd. All rights reserved.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __SAILFISH_SIGNALPOLL_H
#define __SAILFISH_SIGNALPOLL_H
#include <gsupplicant_types.h>
typedef struct signalpoll_priv SignalPollPriv;
typedef struct signalpoll {
GObject object;
SignalPollPriv* priv;
guint average;
} SignalPoll;
typedef guint (*signalpoll_rssi_to_strength_func)(int rssi);
typedef void (*signalpoll_event_func)(struct signalpoll *poll, void *data);
struct signalpoll *signalpoll_new(GSupplicantInterface *iface,
signalpoll_rssi_to_strength_func fn);
struct signalpoll *signalpoll_ref(struct signalpoll *poll);
void signalpoll_unref(struct signalpoll *poll);
gulong signalpoll_add_average_changed_handler(struct signalpoll *poll,
signalpoll_event_func fn, void *data);
void signalpoll_remove_handler(struct signalpoll *poll, gulong id);
#endif /* __SAILFISH_SIGNALPOLL_H */
/*
* Local Variables:
* mode: C
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*/
This diff is collapsed.
......@@ -108,21 +108,6 @@ struct autoscan_params {
unsigned int timeout;
};
#define SIGNAL_POLL_HISTORY_SIZE (10) /* Number of history entries */
#define SIGNAL_POLL_HISTORY_SECS (10) /* Max history depth in seconds */
struct signal_poll_record {
unsigned char strength;
time_t time;
};
struct signal_poll_data {
bool in_progress; /* D-Bus call in progress */
int first; /* Oldest position in the history (inclusive) */
int last; /* Latest position in the history (inclusive) */
struct signal_poll_record history[SIGNAL_POLL_HISTORY_SIZE];
};
struct wifi_tethering_info {
struct wifi_data *wifi;
struct connman_technology *technology;
......@@ -151,7 +136,6 @@ struct wifi_data {
int retries;
struct hidden_params *hidden;
bool postpone_hidden;
struct signal_poll_data signal_poll;
struct wifi_tethering_info *tethering_param;
unsigned int scan_fail_timeout;
/**
......@@ -790,7 +774,6 @@ static int wifi_probe(struct connman_device *device)
return -ENOMEM;
wifi->state = G_SUPPLICANT_STATE_INACTIVE;
wifi->signal_poll.first = wifi->signal_poll.last = -1;
wifi->ap_supported = WIFI_AP_UNKNOWN;
wifi->tethering_param = NULL;
......@@ -2013,122 +1996,6 @@ static int wifi_set_regdom(struct connman_device *device, const char *alpha2)
return ret;
}
static void wifi_update_strength(struct wifi_data *wifi, unsigned char strength)
{
struct signal_poll_data *data = &wifi->signal_poll;
struct signal_poll_record* last;
const time_t now = time(NULL);
const time_t old = now - SIGNAL_POLL_HISTORY_SECS;
if (data->last >= 0) {
last = data->history + data->last;
if (last->time > now || last->time < old) {
/* Reset the history */
data->first = data->last;
} else if (last->time != now) {
/* Create new entry */
data->last = (data->last + 1)
% SIGNAL_POLL_HISTORY_SIZE;
if (data->last == data->first)
data->first = (data->first + 1)
% SIGNAL_POLL_HISTORY_SIZE;
}
} else {
/* First entry */
data->first = data->last = 0;
}
last = data->history + data->last;
last->strength = strength;
last->time = now;
if (wifi->network) {
/* Calculate average for the last SIGNAL_POLL_HISTORY_SECS */
unsigned int sum = last->strength;
int n = 1, pos = data->last;
DBG("%d %u", pos, last->strength);
while (pos != data->first) {
if (--pos < 0) pos = SIGNAL_POLL_HISTORY_SIZE - 1;
if (data->history[pos].time >= old) {
DBG("%d %u", pos, data->history[pos].strength);
sum += data->history[pos].strength;
n++;
} else {
/* This entry is too old */
data->first = (pos + 1)
% SIGNAL_POLL_HISTORY_SIZE;
break;
}
}
DBG("average %u", sum/n);
connman_network_set_strength(wifi->network, sum/n);
connman_service_update_strength_from_network(wifi->network);
}
}
static unsigned char rssi_to_strength(int rssi)
{
int strength = 120 + rssi;
if (strength > 100)
strength = 100;
else if (strength < 0)
strength = 0;
return (unsigned char)strength;
}
static void wifi_signal_poll_callback(int result,
const GSupplicantSignalPoll* data, void *user_data)
{
struct connman_device *device = user_data;
struct wifi_data *wifi = connman_device_get_data(device);
if (result == 0) {
DBG("rssi %d linkspeed %d noise %d frequency %u", data->rssi,
data->linkspeed, data->noise, data->frequency);
if (data->rssi > 1000 || data->rssi < -1000) {
DBG("ignoring bogus rssi value");
} else if (wifi) {
wifi_update_strength(wifi,
rssi_to_strength(data->rssi));
}
} else {
DBG("signal_poll error %d", result);
}
if (wifi)
wifi->signal_poll.in_progress = false;
connman_device_unref(device);
}
static int wifi_signal_poll(struct connman_device *device)
{
struct wifi_data *wifi = connman_device_get_data(device);
int ret;
if (!wifi || !wifi->interface)
return -EINVAL;
if (wifi->signal_poll.in_progress) {
DBG("SignalPoll is already pending");
return -EALREADY;
}
ret = g_supplicant_interface_signal_poll(wifi->interface,
wifi_signal_poll_callback,
device);
if (ret < 0)
return ret;
wifi->signal_poll.in_progress = true;
connman_device_ref(device);
return 0;
}
static struct connman_device_driver wifi_ng_driver = {
.name = "wifi",
.type = CONNMAN_DEVICE_TYPE_WIFI,
......@@ -2139,7 +2006,6 @@ static struct connman_device_driver wifi_ng_driver = {
.disable = wifi_disable,
.scan = wifi_scan,
.set_regdom = wifi_set_regdom,
.signal_poll = wifi_signal_poll,
};
static void system_ready(void)
......@@ -2810,9 +2676,15 @@ static void ap_create_fail(GSupplicantInterface *interface)
return;
}
static unsigned char calculate_strength(GSupplicantNetwork *network)
static unsigned char calculate_strength(GSupplicantNetwork *supplicant_network)
{
return rssi_to_strength(g_supplicant_network_get_signal(network));
unsigned char strength;
strength = 120 + g_supplicant_network_get_signal(supplicant_network);
if (strength > 100)
strength = 100;
return strength;
}
static void network_added(GSupplicantNetwork *supplicant_network)
......
......@@ -761,6 +761,9 @@ void __connman_service_return_error(struct connman_service *service,
int __connman_service_provision_changed(const char *ident);
void __connman_service_set_config(struct connman_service *service,
const char *file_id, const char *section);
bool __connman_service_update_value_from_network(
struct connman_service *service,
struct connman_network *network, const char *key);
const char *__connman_service_type2string(enum connman_service_type type);
enum connman_service_type __connman_service_string2type(const char *str);
......
......@@ -10,7 +10,7 @@ Type=notify
Restart=always
EnvironmentFile=-/etc/tracing/connman/connman.tracing
EnvironmentFile=-/etc/sysconfig/connman
ExecStart=@sbindir@/connmand -n -W nl80211 --nobacktrace --systemd $TRACING $SYSCONF_ARGS
ExecStart=@sbindir@/connmand -n -W nl80211 --nobacktrace --systemd --noplugin=wifi $TRACING $SYSCONF_ARGS
StandardOutput=null
[Install]
......
......@@ -659,19 +659,6 @@ int __connman_device_disconnect(struct connman_device *device)
return 0;
}
bool connman_device_supports_signal_poll(struct connman_device *device)
{
return device && device->driver && device->driver->signal_poll;
}
int connman_device_signal_poll(struct connman_device *device)
{
if (!device->driver || !device->driver->signal_poll)
return -EOPNOTSUPP;
return device->driver->signal_poll(device);
}
int connman_device_reconnect_service(struct connman_device *device)
{
DBG("device %p", device);
......
......@@ -486,6 +486,25 @@ int __connman_service_load_modifiable(struct connman_service *service)
return 0;
}
static void get_config_string(GKeyFile *keyfile, const char *group,
const char *key, char **value)
{
char *str = g_key_file_get_string(keyfile, group, key, NULL);
if (str) {
g_free(*value);
*value = str;
}
}
static void set_config_string(GKeyFile *keyfile, const char *group,
const char *key, const char *value)
{
if (value)
g_key_file_set_string(keyfile, group, key, value);
else
g_key_file_remove_key(keyfile, group, key, NULL);
}
static int service_load(struct connman_service *service)
{
GKeyFile *keyfile;
......@@ -598,6 +617,31 @@ static int service_load(struct connman_service *service)
g_free(str);
}
get_config_string(keyfile, service->identifier, "EAP",
&service->eap);
get_config_string(keyfile, service->identifier, "Identity",
&service->identity);
get_config_string(keyfile, service->identifier, "AnonymousIdentity",
&service->anonymous_identity);
get_config_string(keyfile, service->identifier, "CACertFile",
&service->ca_cert_file);
get_config_string(keyfile, service->identifier, "SubjectMatch",
&service->subject_match);
get_config_string(keyfile, service->identifier, "AltSubjectMatch",
&service->altsubject_match);
get_config_string(keyfile, service->identifier, "DomainSuffixMatch",
&service->domain_suffix_match);
get_config_string(keyfile, service->identifier, "DomainMatch",
&service->domain_match);
get_config_string(keyfile, service->identifier, "ClientCertFile",
&service->client_cert_file);
get_config_string(keyfile, service->identifier, "PrivateKeyFile",
&service->private_key_file);
get_config_string(keyfile, service->identifier, "PrivateKeyPassphrase",
&service->private_key_passphrase);
get_config_string(keyfile, service->identifier, "Phase2",
&service->phase2);
str = g_key_file_get_string(keyfile,
service->identifier, "Passphrase", NULL);
if (str) {
......@@ -738,6 +782,30 @@ static int service_save(struct connman_service *service)
g_key_file_set_integer(keyfile, service->identifier,
"Frequency", freq);
}
set_config_string(keyfile, service->identifier,
"EAP", service->eap);
set_config_string(keyfile, service->identifier,
"Identity", service->identity);
set_config_string(keyfile, service->identifier,
"AnonymousIdentity", service->anonymous_identity);
set_config_string(keyfile, service->identifier,
"CACertFile", service->ca_cert_file);
set_config_string(keyfile, service->identifier,
"SubjectMatch", service->subject_match);
set_config_string(keyfile, service->identifier,
"AltSubjectMatch", service->altsubject_match);
set_config_string(keyfile, service->identifier,
"DomainSuffixMatch", service->domain_suffix_match);
set_config_string(keyfile, service->identifier,
"DomainMatch", service->domain_match);
set_config_string(keyfile, service->identifier,
"ClientCertFile", service->client_cert_file);
set_config_string(keyfile, service->identifier,
"PrivateKeyFile", service->private_key_file);
set_config_string(keyfile, service->identifier,
"PrivateKeyPassphrase", service->private_key_passphrase);
set_config_string(keyfile, service->identifier,
"Phase2", service->phase2);
/* fall through */
case CONNMAN_SERVICE_TYPE_GADGET:
......@@ -5411,14 +5479,36 @@ int __connman_service_set_ignore(struct connman_service *service,
return 0;
}
/* Only allows valid values */
static bool set_eap_method(struct connman_service *service, const char *method)
{
if (method && method[0]) {
if (!g_strcmp0(service->eap, method)) {
return false;
} else if (!g_strcmp0(method, "peap") ||
!g_strcmp0(method, "tls") ||
!g_strcmp0(method, "ttls")) {
g_free(service->eap);
service->eap = g_strdup(method);
return true;
}
DBG("invalid EAP method %s", method);
}
if (service->eap) {
g_free(service->eap);
service->eap = NULL;
return true;
}
return false;
}
void __connman_service_set_string(struct connman_service *service,
const char *key, const char *value)
{
if (service->hidden)
return;
if (g_str_equal(key, "EAP")) {
g_free(service->eap);
service->eap = g_strdup(value);
set_eap_method(service, value);
} else if (g_str_equal(key, "Identity")) {
g_free(service->identity);
service->identity = g_strdup(value);
......@@ -7175,6 +7265,43 @@ static enum connman_service_security convert_wifi_security(const char *security)
return CONNMAN_SERVICE_SECURITY_UNKNOWN;
}
static bool update_string_from_network(struct connman_network *network,
const char *key, char **value)
{
const char *network_value = connman_network_get_string(network, key);
if (g_strcmp0(*value, network_value)) {
g_free(*value);
*value = g_strdup(network_value);
return true;
}
return false;
}
/* Return true if service has been updated */
bool __connman_service_update_value_from_network(
struct connman_service *service,
struct connman_network *network, const char *key)
{
if (!service || !network || !key) {
return false;
} else if (!g_strcmp0(key, "WiFi.EAP")) {
const char *value = connman_network_get_string(network, key);
if (value && !value[0]) {
/* Substitute default (empty) value with "peap" */
value = service->eap ? service->eap : "peap";
connman_network_set_string(network, key, value);
}
return set_eap_method(service, value);
} else if (!g_strcmp0(key, "WiFi.Identity")) {
return update_string_from_network(network, key,
&service->identity);
} else {
return false;
}
}
static void update_from_network(struct connman_service *service,
struct connman_network *network)
{
......@@ -7214,8 +7341,11 @@ static void update_from_network(struct connman_service *service,
str = connman_network_get_string(network, "WiFi.Security");
service->security = convert_wifi_security(str);
if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
if (service->type == CONNMAN_SERVICE_TYPE_WIFI) {
__connman_service_update_value_from_network(service, network,
"WiFi.EAP");
service->wps = connman_network_get_bool(network, "WiFi.WPS");
}
/*
* Reset the ignore flag if there was no network associated with
......
......@@ -15,7 +15,7 @@ Requires: pacrunner
Requires: connman-configs
Requires: systemd
Requires: libgofono >= 2.0.0
Requires: libglibutil >= 1.0.10
Requires: libglibutil >= 1.0.20
Requires(preun): systemd
Requires(post): systemd
Requires(postun): systemd
......@@ -31,9 +31,10 @@ BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(libiphb)