diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-07-24 00:03:57 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-07-24 00:03:57 +0200 |
commit | cd2e6d201e373cd2719f679996038f82a528957f (patch) | |
tree | 094a4affae8b9daaafe1dff8837a040e94c852fc | |
parent | a15e326f47b47f171f699405f811ac765b0d8238 (diff) | |
download | ofono-cd2e6d201e373cd2719f679996038f82a528957f.tar.bz2 |
udev: Add detection support for Samsung LTE dongles
-rw-r--r-- | plugins/ofono.rules | 3 | ||||
-rw-r--r-- | plugins/udev.c | 37 |
2 files changed, 40 insertions, 0 deletions
diff --git a/plugins/ofono.rules b/plugins/ofono.rules index 97912039..990c29a0 100644 --- a/plugins/ofono.rules +++ b/plugins/ofono.rules @@ -494,6 +494,9 @@ ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130b", ENV{OFONO_DRIVER}="mbm" ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130c", ENV{OFONO_DRIVER}="mbm" ATTRS{idVendor}=="0930", ATTRS{idProduct}=="1311", ENV{OFONO_DRIVER}="mbm" +# Samsung GT-B3740 (LTE) +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6889", ENV{OFONO_DRIVER}="samsung" + # Nokia Internet Stick CS-10 ATTRS{idVendor}=="0421", ATTRS{idProduct}=="060e", ENV{OFONO_DRIVER}="nokia" diff --git a/plugins/udev.c b/plugins/udev.c index 1d9aaf23..08c767ca 100644 --- a/plugins/udev.c +++ b/plugins/udev.c @@ -691,6 +691,41 @@ static void add_speedup(struct ofono_modem *modem, ofono_modem_register(modem); } +static void add_samsung(struct ofono_modem *modem, + struct udev_device *udev_device) +{ + const char *subsystem; + + DBG("modem %p", modem); + + subsystem = udev_device_get_subsystem(udev_device); + if (subsystem == NULL) + return; + + if (g_str_equal(subsystem, "net") == TRUE) { + const char *interface; + + interface = get_property(udev_device, "INTERFACE"); + if (interface == NULL) + return; + + DBG("network %s", interface); + + ofono_modem_set_string(modem, "Network", interface); + } else if (g_str_equal(subsystem, "tty") == TRUE) { + const char *devnode; + + devnode = udev_device_get_devnode(udev_device); + if (devnode == NULL) + return; + + DBG("device %s", devnode); + + ofono_modem_set_string(modem, "Device", devnode); + ofono_modem_register(modem); + } +} + static void add_modem(struct udev_device *udev_device) { struct ofono_modem *modem; @@ -797,6 +832,8 @@ done: add_speedup(modem, udev_device); else if (g_strcmp0(driver, "speedupcdma") == 0) add_speedup(modem, udev_device); + else if (g_strcmp0(driver, "samsung") == 0) + add_samsung(modem, udev_device); } static gboolean devpath_remove(gpointer key, gpointer value, gpointer user_data) |