Add basic detection of Option HSO devices
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 27 Dec 2008 07:54:35 +0000 (08:54 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 27 Dec 2008 07:54:35 +0000 (08:54 +0100)
include/device.h
src/detect.c

index 95ffeee..172d959 100644 (file)
@@ -44,6 +44,7 @@ enum connman_device_type {
        CONNMAN_DEVICE_TYPE_MODEM     = CONNMAN_ELEMENT_SUBTYPE_MODEM,
        CONNMAN_DEVICE_TYPE_BLUETOOTH = CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH,
        CONNMAN_DEVICE_TYPE_VENDOR    = 42,
+       CONNMAN_DEVICE_TYPE_HSO,
 };
 
 enum connman_device_mode {
index 85fb077..f6c66a7 100644 (file)
@@ -135,7 +135,7 @@ static void detect_newlink(unsigned short type, int index,
        struct connman_device *device;
        gchar *name, *devname;
 
-       DBG("index %d", index);
+       DBG("type %d index %d", type, index);
 
        device = find_device(index);
        if (device != NULL)
@@ -171,6 +171,9 @@ static void detect_newlink(unsigned short type, int index,
                        devtype = CONNMAN_DEVICE_TYPE_ETHERNET;
 
                close(sk);
+       } else if (type == ARPHRD_NONE) {
+               if (g_str_has_prefix(devname, "hso") == TRUE)
+                       devtype = CONNMAN_DEVICE_TYPE_HSO;
        }
 
        if (devtype == CONNMAN_DEVICE_TYPE_UNKNOWN) {
@@ -206,7 +209,7 @@ static void detect_dellink(unsigned short type, int index,
 {
        struct connman_device *device;
 
-       DBG("index %d", index);
+       DBG("type %d index %d", type, index);
 
        device = find_device(index);
        if (device == NULL)