summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-07-31 07:29:00 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-07-31 07:29:00 +0000
commit5dcc1231bd8895cc3364b573116f5b91ef41e327 (patch)
tree883406049c24e065eec8f9a8abab50995a5143cf /src
parent31538ce00e8c114f385eefd2452fe3f2df6f8e64 (diff)
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) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2580 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src')
-rw-r--r--src/gsmd/gsmd.c6
-rw-r--r--src/gsmd/vendor_qc.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gsmd/gsmd.c b/src/gsmd/gsmd.c
index 99945c3..519d553 100644
--- a/src/gsmd/gsmd.c
+++ b/src/gsmd/gsmd.c
@@ -62,7 +62,8 @@ static int gsmd_alive_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
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 @@ static int firstcmd_atcb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
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);
}
diff --git a/src/gsmd/vendor_qc.c b/src/gsmd/vendor_qc.c
index 2bb74bb..a4a65ce 100644
--- a/src/gsmd/vendor_qc.c
+++ b/src/gsmd/vendor_qc.c
@@ -81,6 +81,9 @@ static int qc_detect(struct gsmd *g)
{
/* 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;
}
personal git repositories of Harald Welte. Your mileage may vary