r2379 - in trunk/src/host/qemu-neo1973: gnokiigsm hw

andrew at sita.openmoko.org andrew at sita.openmoko.org
Thu Jul 12 10:00:51 CEST 2007


Author: andrew
Date: 2007-07-12 10:00:49 +0200 (Thu, 12 Jul 2007)
New Revision: 2379

Modified:
   trunk/src/host/qemu-neo1973/gnokiigsm/at-emulator.h
   trunk/src/host/qemu-neo1973/gnokiigsm/statemachine.h
   trunk/src/host/qemu-neo1973/hw/neo1973.c
Log:
Only power the modem up/down if it's there.


Modified: trunk/src/host/qemu-neo1973/gnokiigsm/at-emulator.h
===================================================================
--- trunk/src/host/qemu-neo1973/gnokiigsm/at-emulator.h	2007-07-11 20:26:48 UTC (rev 2378)
+++ trunk/src/host/qemu-neo1973/gnokiigsm/at-emulator.h	2007-07-12 08:00:49 UTC (rev 2379)
@@ -88,10 +88,11 @@
 	   are guesses as I've not got an AT reference handy.   HAB */
 
 #define 	MR_OK			(0)
+#define         MR_RING                 (2)
+#define		MR_NOCARRIER		(3)
 #define		MR_ERROR		(4)
-#define		MR_NOCARRIER	(5)
-#define		MR_CARRIER		(2)
-#define		MR_CONNECT		(3)
-#define         MR_RING                 (6)
+#define		MR_CARRIER		(5)	/* guess */
+#define		MR_CONNECT		(6)	/* guess */
+#define		MR_BUSY			(7)
 
 #endif	/* _gnokii_data_at_emulator_h */

Modified: trunk/src/host/qemu-neo1973/gnokiigsm/statemachine.h
===================================================================
--- trunk/src/host/qemu-neo1973/gnokiigsm/statemachine.h	2007-07-11 20:26:48 UTC (rev 2378)
+++ trunk/src/host/qemu-neo1973/gnokiigsm/statemachine.h	2007-07-12 08:00:49 UTC (rev 2379)
@@ -74,7 +74,7 @@
 	gn_link link;
 	gn_driver driver;
 	char *lockfile;
-	
+
 	/* Store last message for resend purposes */
 	unsigned char last_msg_type;
 	unsigned int last_msg_size;

Modified: trunk/src/host/qemu-neo1973/hw/neo1973.c
===================================================================
--- trunk/src/host/qemu-neo1973/hw/neo1973.c	2007-07-11 20:26:48 UTC (rev 2378)
+++ trunk/src/host/qemu-neo1973/hw/neo1973.c	2007-07-12 08:00:49 UTC (rev 2379)
@@ -113,17 +113,19 @@
 {
     struct neo_board_s *s = (struct neo_board_s *) opaque;
 
-    /* The GSM modem seems to take a little while to power up and
-     * start talking to the serial.  This turns out to be critical because
-     * before gsmd runs and disables Local Echo for the UART, everything
-     * that the modem outputs is looped back and confuses the parser.
-     */
-    if (level)
-        qemu_mod_timer(s->modem_timer, qemu_get_clock(vm_clock) +
-                        (ticks_per_sec >> 4));
-    else {
-        qemu_del_timer(s->modem_timer);
-        modem_enable(s->modem, 0);
+    if (s->modem) {
+        /* The GSM modem seems to take a little while to power up and
+         * start talking to the serial.  This turns out to be critical because
+         * before gsmd runs and disables Local Echo for the UART, everything
+         * that the modem outputs is looped back and confuses the parser.
+         */
+        if (level)
+            qemu_mod_timer(s->modem_timer, qemu_get_clock(vm_clock) +
+                            (ticks_per_sec >> 4));
+        else {
+            qemu_del_timer(s->modem_timer);
+            modem_enable(s->modem, 0);
+        }
     }
 
     neo_printf("Modem powered %s.\n", level ? "up" : "down");





More information about the commitlog mailing list