udev: Add detection support for Samsung LTE dongles

This commit is contained in:
Marcel Holtmann 2011-07-24 00:03:57 +02:00
parent a15e326f47
commit cd2e6d201e
2 changed files with 40 additions and 0 deletions

View File

@ -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"

View File

@ -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)