From f6756e60371e5942db40c2a7aa95f60f781717f8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 1 Jul 2008 08:48:21 +0200 Subject: [PATCH] Add support for detecting modem devices --- plugins/hal.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/hal.c b/plugins/hal.c index 467e5d3..3b990c3 100644 --- a/plugins/hal.c +++ b/plugins/hal.c @@ -36,6 +36,7 @@ static struct { } capabilities[] = { { "net.80203", CONNMAN_ELEMENT_SUBTYPE_ETHERNET }, { "net.80211", CONNMAN_ELEMENT_SUBTYPE_WIFI }, + { "modem", CONNMAN_ELEMENT_SUBTYPE_MODEM }, { } }; @@ -63,7 +64,8 @@ static void device_info(LibHalContext *ctx, const char *udi, "Driver", DBUS_TYPE_STRING, &value); } - if (g_str_equal(subsys, "net") == TRUE) { + if (g_str_equal(subsys, "net") == TRUE || + g_str_equal(subsys, "tty") == TRUE) { value = libhal_device_get_property_string(ctx, parent, "info.vendor", NULL); if (value != NULL) @@ -89,6 +91,14 @@ static void device_netdev(LibHalContext *ctx, const char *udi, element->netdev.name = libhal_device_get_property_string(ctx, udi, "net.interface", NULL); } + + if (element->subtype == CONNMAN_ELEMENT_SUBTYPE_MODEM) { + element->netdev.index = libhal_device_get_property_int(ctx, + udi, "serial.port", NULL); + + element->netdev.name = libhal_device_get_property_string(ctx, + udi, "serial.device", NULL); + } } static void create_element(LibHalContext *ctx, const char *udi, -- 2.7.4