aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/mm-modem-huawei.c1
-rw-r--r--plugins/mm-plugin-huawei.c17
2 files changed, 8 insertions, 10 deletions
diff --git a/plugins/mm-modem-huawei.c b/plugins/mm-modem-huawei.c
index 1aebebac..2e6b5151 100644
--- a/plugins/mm-modem-huawei.c
+++ b/plugins/mm-modem-huawei.c
@@ -34,6 +34,7 @@ mm_modem_huawei_new (const char *data_device,
return MM_MODEM (g_object_new (MM_TYPE_MODEM_HUAWEI,
MM_SERIAL_DEVICE, monitor_device,
MM_MODEM_DEVICE, data_device,
+ MM_SERIAL_CARRIER_DETECT, FALSE,
MM_MODEM_DRIVER, driver,
MM_MODEM_TYPE, MM_MODEM_TYPE_GSM,
NULL));
diff --git a/plugins/mm-plugin-huawei.c b/plugins/mm-plugin-huawei.c
index 5fb8e6d0..206fa7b5 100644
--- a/plugins/mm-plugin-huawei.c
+++ b/plugins/mm-plugin-huawei.c
@@ -130,15 +130,13 @@ find_second_port (LibHalContext *ctx, const char *parent)
int num_children = 0;
int i;
- children = libhal_manager_find_device_string_match (ctx, "info.parent", parent, &num_children, NULL);
- for (i = 0; i < num_children && second_port == NULL; i++) {
- const char *child = children[i];
-
- if (libhal_device_property_exists (ctx, child, "serial.port", NULL) &&
- libhal_device_get_property_int (ctx, child, "serial.port", NULL) == 1)
+ if (!libhal_device_property_exists (ctx, parent, "usb.interface.number", NULL) ||
+ libhal_device_get_property_int (ctx, parent, "usb.interface.number", NULL) != 1)
+ return NULL;
- second_port = libhal_device_get_property_string (ctx, child, "serial.device", NULL);
- }
+ children = libhal_manager_find_device_string_match (ctx, "info.parent", parent, &num_children, NULL);
+ for (i = 0; i < num_children && second_port == NULL; i++)
+ second_port = libhal_device_get_property_string (ctx, children[i], "serial.device", NULL);
libhal_free_string_array (children);
@@ -190,9 +188,8 @@ create_modem (MMPlugin *plugin, LibHalContext *hal_ctx, const char *udi)
g_return_val_if_fail (driver != NULL, NULL);
if (get_product (hal_ctx, udi) == 0x1001) {
- /* This modem is handled by generic GSM device with carrier detection turned off */
+ /* This modem is handled by generic GSM device */
modem = mm_generic_gsm_new (data_device, driver);
- g_object_set (G_OBJECT (modem), MM_SERIAL_CARRIER_DETECT, FALSE, NULL);
} else {
monitor_device = get_monitor_device (hal_ctx, udi);
modem = mm_modem_huawei_new (data_device, monitor_device, driver);