[PATCH] mm-generic-gsm.c: non-fatal CFUN=1

View: New views
2 Messages — Rating Filter:   Alert me  

[PATCH] mm-generic-gsm.c: non-fatal CFUN=1

by Valmantas Palikša :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If CFUN=1 returns an ERROR don't abort the Enable() process.

[cfun-non-fatal.patch]

diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c
index b63e0ba..e781889 100644
--- a/src/mm-generic-gsm.c
+++ b/src/mm-generic-gsm.c
@@ -339,6 +339,16 @@ enable_done (MMSerialPort *port,
 }
 
 static void
+power_up_done (MMSerialPort *port,
+             GString *response,
+             GError *error,
+             gpointer user_data)
+{
+    /* non-fatal, ignore errors */
+    enable_done(port, NULL, NULL, user_data);
+}
+
+static void
 init_done (MMSerialPort *port,
            GString *response,
            GError *error,
@@ -363,7 +373,7 @@ init_done (MMSerialPort *port,
 
         g_object_get (G_OBJECT (info->modem), MM_GENERIC_GSM_POWER_UP_CMD, &cmd, NULL);
         if (cmd && strlen (cmd))
-            mm_serial_port_queue_command (port, cmd, 5, enable_done, user_data);
+            mm_serial_port_queue_command (port, cmd, 5, power_up_done, user_data);
         else
             enable_done (port, NULL, NULL, user_data);
         g_free (cmd);


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

Re: [PATCH] mm-generic-gsm.c: non-fatal CFUN=1

by Dan Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-10-17 at 11:23 +0300, Valmantas Palikša wrote:
> If CFUN=1 returns an ERROR don't abort the Enable() process.

Thanks, committed in a slightly different form with a fixme.  We don't
actually need a whole new function; we can just remove the error bits
from enable_done().  There's a better way to do this too, which I've
noted in the FIXME comment in the commit.  Care to take a stab at it?
For now this will do though.

Dan


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