summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-04-25 11:47:49 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-26 09:31:32 (GMT)
commit409f346fbf0cc54c04682fdb8982a76e1ce53b21 (patch)
treefb9df123a82f0f15c5b918da489f1d3d6bd535e5 /src
parent03055c5a5eabca0f8bc1daf9e7f20708fa11e324 (diff)
downloadconnman-409f346fbf0cc54c04682fdb8982a76e1ce53b21.zip
connman-409f346fbf0cc54c04682fdb8982a76e1ce53b21.tar.gz
connman-409f346fbf0cc54c04682fdb8982a76e1ce53b21.tar.bz2
device: Add support functions needed by ethernet tethering
Diffstat (limited to 'src')
-rw-r--r--src/device.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 2e0dbdc..5feeee1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -647,6 +647,36 @@ int __connman_device_disconnect(struct connman_device *device)
return 0;
}
+int connman_device_disconnect_service(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ device->reconnect = FALSE;
+
+ if (device->network) {
+ struct connman_service *service =
+ connman_service_lookup_from_network(device->network);
+
+ if (service != NULL)
+ __connman_service_disconnect(service);
+ else
+ connman_network_set_connected(device->network, FALSE);
+ }
+
+ return 0;
+}
+
+int connman_device_reconnect_service(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ device->reconnect = TRUE;
+
+ __connman_service_auto_connect();
+
+ return 0;
+}
+
static void mark_network_available(gpointer key, gpointer value,
gpointer user_data)
{
@@ -1035,6 +1065,19 @@ struct connman_device *__connman_device_find_device(
return NULL;
}
+struct connman_device *connman_device_find_by_index(int index)
+{
+ GSList *list;
+
+ for (list = device_list; list != NULL; list = list->next) {
+ struct connman_device *device = list->data;
+ if (device->index == index)
+ return device;
+ }
+
+ return NULL;
+}
+
/**
* connman_device_set_regdom
* @device: device structure