> >> >  From a cursory reading of the bug reports you cited it seems like some
> >> > sierra modems crash when ModemManager sends CFUN=1 to them.
> >> >
> >> > Can you help verify if this is indeed the case with yours as well?
> >> >
> >
> > So it really seems that not only Wavecom modems get a whole software
> > restart (including USB stack) when they get AT+CFUN=1. The thing is, is
> > removing the power-up command a solution for *all* Sierra modems or are
> > there any Sierra modems that really need the power-up command? If so,
> > we'll probably need to disable the power-up only for specific models,
> > like the one reported in the bug; or the other way around, enable it
> > only for only some specific models.
> 
> >From reading the cited bug reports and from general "instict" I would think
> that probably some of them need CFUN=1 and others crash when they get it
> so the best thing to do is enable it selectively. (We can start from this
> USBID and expand).
> 
> Unfortunately I don't have the device myself, so I can't test.
> 
> 
> > Wasn't that patch already applied to Ubuntu's MM? According to the logs
> > in https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/459052
> > that was written by Alexander Sack long ago, and possibly applied in
> > Ubuntu... (comment #7?)
> 
> It was probably applied to ubuntu once but somehow it got dropped (I think
> during the karmic -> lucid transition if I read well).
> 
> In the current version (natty) there is no such patch from what I could see.
> 
> In any case, a distro-local patch is really a bad idea for solving this type
> of problems, especially when you have such a friendly and responsive
> upstream like in this case.
> 
> Unfortunately I don't have any modemmanager experience or time to
> implement the quirk "the right way", so if someone can start from
> the previous attached patch and fix the problem correctly, it would be
> great :)
> 

Attached a patch which should do AT+CFUN=1 only if product ID is not
0x6832. Can you guys test it?

Cheers!

-- 
Aleksander
>From a91835798a7d7a5fffddb905e71b45178ef05ebf Mon Sep 17 00:00:00 2001
From: Aleksander Morgado <aleksan...@lanedo.com>
Date: Fri, 20 May 2011 11:46:32 +0200
Subject: [PATCH] sierra: avoid sending power-up command to MC8780

Fixes LP#459052

Based on a patch developed by Alexander Sack
---
 plugins/mm-modem-sierra-gsm.c |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index d4636d7..163263d 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -609,6 +609,44 @@ simple_connect (MMModemSimple *simple,
 /*****************************************************************************/
 
 static void
+set_property (GObject *object,
+              guint prop_id,
+              const GValue *value,
+              GParamSpec *pspec)
+{
+    /* Do nothing... see set_property() in parent, which also does nothing */
+}
+
+static void
+get_property (GObject *object,
+              guint prop_id,
+              GValue *value,
+              GParamSpec *pspec)
+{
+    switch (prop_id) {
+    case MM_GENERIC_GSM_PROP_POWER_UP_CMD: {
+        guint16 product_id = 0;
+
+        g_object_get (object,
+                      MM_MODEM_HW_PID, &product_id,
+                      NULL);
+
+        /* Some Sierra modems do a full software reset (including
+         * USB stack) with AT+CFUN=1, so try to avoid that.
+         *   - MC8780 (0x6832)
+         * */
+        if (product_id == 0x6832)
+            g_value_set_string (value, "");
+        else
+            g_value_set_string (value, "+CFUN=1");
+        break;
+    }
+    default:
+        break;
+    }
+}
+
+static void
 modem_init (MMModem *modem_class)
 {
     modem_class->grab_port = grab_port;
@@ -646,6 +684,9 @@ mm_modem_sierra_gsm_class_init (MMModemSierraGsmClass *klass)
     mm_modem_sierra_gsm_parent_class = g_type_class_peek_parent (klass);
     g_type_class_add_private (object_class, sizeof (MMModemSierraGsmPrivate));
 
+    object_class->get_property = get_property;
+    object_class->set_property = set_property;
+
     object_class->dispose = dispose;
     gsm_class->do_enable_power_up_done = real_do_enable_power_up_done;
     gsm_class->set_allowed_mode = set_allowed_mode;
-- 
1.7.4.1

_______________________________________________
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to