From 8402272a4be52ddf3fe28d8037dfd249c3de9f04 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 15 Sep 2010 17:42:06 +0200 Subject: [PATCH 4/5] Prioritize wifi plugins The legacy one as the default wifi plugin. --- include/device.h | 4 ++++ include/network.h | 4 ++++ plugins/wifi-legacy.c | 2 ++ plugins/wifi.c | 2 ++ 4 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/device.h b/include/device.h index a5ed412..f80969b 100644 --- a/include/device.h +++ b/include/device.h @@ -52,6 +52,10 @@ enum connman_device_mode { CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE = 2, }; +#define CONNMAN_DEVICE_PRIORITY_LOW -100 +#define CONNMAN_DEVICE_PRIORITY_DEFAULT 0 +#define CONNMAN_DEVICE_PRIORITY_HIGH 100 + struct connman_device; struct connman_device *connman_device_create(const char *node, diff --git a/include/network.h b/include/network.h index 322712e..96d2d28 100644 --- a/include/network.h +++ b/include/network.h @@ -58,6 +58,10 @@ enum connman_network_error { CONNMAN_NETWORK_ERROR_CONFIGURE_FAIL = 2, }; +#define CONNMAN_NETWORK_PRIORITY_LOW -100 +#define CONNMAN_NETWORK_PRIORITY_DEFAULT 0 +#define CONNMAN_NETWORK_PRIORITY_HIGH 100 + struct connman_network; struct connman_network *connman_network_create(const char *identifier, diff --git a/plugins/wifi-legacy.c b/plugins/wifi-legacy.c index eb7dd83..4c775b9 100644 --- a/plugins/wifi-legacy.c +++ b/plugins/wifi-legacy.c @@ -81,6 +81,7 @@ static int network_disconnect(struct connman_network *network) static struct connman_network_driver network_driver = { .name = "wifi", .type = CONNMAN_NETWORK_TYPE_WIFI, + .priority = CONNMAN_NETWORK_PRIORITY_HIGH, .probe = network_probe, .remove = network_remove, .connect = network_connect, @@ -181,6 +182,7 @@ static int wifi_scan(struct connman_device *device) static struct connman_device_driver wifi_driver = { .name = "wifi", .type = CONNMAN_DEVICE_TYPE_WIFI, + .priority = CONNMAN_DEVICE_PRIORITY_HIGH, .probe = wifi_probe, .remove = wifi_remove, .enable = wifi_enable, diff --git a/plugins/wifi.c b/plugins/wifi.c index 8986233..67b0323 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -250,6 +250,7 @@ static int wifi_scan(struct connman_device *device) static struct connman_device_driver wifi_ng_driver = { .name = "wifi", .type = CONNMAN_DEVICE_TYPE_WIFI, + .priority = CONNMAN_DEVICE_PRIORITY_LOW, .probe = wifi_probe, .remove = wifi_remove, .enable = wifi_enable, @@ -586,6 +587,7 @@ static int network_disconnect(struct connman_network *network) static struct connman_network_driver network_driver = { .name = "wifi", .type = CONNMAN_NETWORK_TYPE_WIFI, + .priority = CONNMAN_NETWORK_PRIORITY_LOW, .probe = network_probe, .remove = network_remove, .connect = network_connect, -- 1.7.1