r2580 - trunk/src/target/gsm/src/gsmd

laforge at sita.openmoko.org laforge at sita.openmoko.org
Tue Jul 31 09:29:04 CEST 2007


Author: laforge
Date: 2007-07-31 09:29:00 +0200 (Tue, 31 Jul 2007)
New Revision: 2580

Modified:
   trunk/src/target/gsm/src/gsmd/gsmd.c
   trunk/src/target/gsm/src/gsmd/vendor_qc.c
Log:
in some cases the Qualcomm chip in the HTC Universal switches to V0 mode
behind our backs. We need support for "0" instead of "OK" in the
synchronous initial command and in the alive check. Note that this
nearly duplicates the "OK" check in atcmd.c. (Philip Zabel)


Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c	2007-07-31 07:11:08 UTC (rev 2579)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c	2007-07-31 07:29:00 UTC (rev 2580)
@@ -62,7 +62,8 @@
 {
 	struct gsmd_alive_priv *alp = ctx;
 
-	if (!strcmp(resp, "OK"))
+	if (!strcmp(resp, "OK") ||
+	    ((alp->gsmd->flags & GSMD_FLAG_V0) && resp[0] == '0'))
 		alp->alive_responded = 1;
 	return 0;
 }
@@ -199,7 +200,8 @@
 {
 	struct gsmd *gsmd = ctx;
 
-	if (strcmp(resp, "OK")) {
+	if (strcmp(resp, "OK") &&
+	    (!(gsmd->flags & GSMD_FLAG_V0) || resp[0] != '0')) {
 		gsmd_log(GSMD_FATAL, "response '%s' to initial command invalid", resp);
 		exit(5);
 	}

Modified: trunk/src/target/gsm/src/gsmd/vendor_qc.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_qc.c	2007-07-31 07:11:08 UTC (rev 2579)
+++ trunk/src/target/gsm/src/gsmd/vendor_qc.c	2007-07-31 07:29:00 UTC (rev 2580)
@@ -81,6 +81,9 @@
 {
 	/* FIXME: do actual detection of vendor if we have multiple vendors */
 	/* open /proc/cpuinfo and check for HTC Universal? */
+
+	/* The Qualcomm chip switches to V0 mode in the strangest places */
+	g->flags |= GSMD_FLAG_V0;
 	return 1;
 }
 





More information about the commitlog mailing list