summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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