summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-08-17 08:34:29 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-08-17 08:34:29 +0000
commit94bfe1d72a36b701430f5f73a71431f1c4881ef1 (patch)
tree4eb2195f7c4634eeb2cee4ebe73867d353f15b62
parentc20bdfa5eafb8ac776092c816018de0b07045c97 (diff)
Use vendor specific ext_chars.
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2728 99fdad57-331a-0410-800a-d7fa5415bdb3
-rw-r--r--include/gsmd/vendorplugin.h1
-rw-r--r--src/gsmd/atcmd.c4
-rw-r--r--src/gsmd/vendor_qc.c1
-rw-r--r--src/gsmd/vendor_ti.c1
-rw-r--r--src/gsmd/vendor_tihtc.c1
5 files changed, 6 insertions, 2 deletions
diff --git a/include/gsmd/vendorplugin.h b/include/gsmd/vendorplugin.h
index c3843b2..1911fef 100644
--- a/include/gsmd/vendorplugin.h
+++ b/include/gsmd/vendorplugin.h
@@ -12,6 +12,7 @@ struct gsmd_unsolicit;
struct gsmd_vendor_plugin {
struct llist_head list;
unsigned char *name;
+ unsigned char *ext_chars;
unsigned int num_unsolicit;
const struct gsmd_unsolicit *unsolicit;
int (*detect)(struct gsmd *g);
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index 9d45588..800035a 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -237,7 +237,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
* TBD
*/
- if (buf[0] == '+' || buf[0] == '%') {
+ if (buf[0] == '+' || strchr(g->vendorpl->ext_chars, buf[0])) {
/* an extended response */
const char *colon = strchr(buf, ':');
if (!colon) {
@@ -293,7 +293,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
}
if (cmd) {
- if (cmd->buf[2] != '+' && cmd->buf[2] != '%') {
+ if (cmd->buf[2] != '+' && strchr(g->vendorpl->ext_chars, cmd->buf[2]) == NULL) {
gsmd_log(GSMD_ERROR, "extd reply to non-extd command?\n");
return -EINVAL;
}
diff --git a/src/gsmd/vendor_qc.c b/src/gsmd/vendor_qc.c
index a4a65ce..1aa4e6f 100644
--- a/src/gsmd/vendor_qc.c
+++ b/src/gsmd/vendor_qc.c
@@ -100,6 +100,7 @@ static int qc_initsettings(struct gsmd *g)
struct gsmd_vendor_plugin gsmd_vendor_plugin = {
.name = "Qualcomm msm6250",
+ .ext_chars = "@",
.num_unsolicit = ARRAY_SIZE(qc_unsolicit),
.unsolicit = qc_unsolicit,
.detect = &qc_detect,
diff --git a/src/gsmd/vendor_ti.c b/src/gsmd/vendor_ti.c
index c219355..4c7d182 100644
--- a/src/gsmd/vendor_ti.c
+++ b/src/gsmd/vendor_ti.c
@@ -303,6 +303,7 @@ static int ticalypso_initsettings(struct gsmd *g)
struct gsmd_vendor_plugin gsmd_vendor_plugin = {
.name = "TI Calypso",
+ .ext_chars = "%@",
.num_unsolicit = ARRAY_SIZE(ticalypso_unsolicit),
.unsolicit = ticalypso_unsolicit,
.detect = &ticalypso_detect,
diff --git a/src/gsmd/vendor_tihtc.c b/src/gsmd/vendor_tihtc.c
index 8add5f7..42f9d50 100644
--- a/src/gsmd/vendor_tihtc.c
+++ b/src/gsmd/vendor_tihtc.c
@@ -298,6 +298,7 @@ static int tihtc_initsettings(struct gsmd *g)
struct gsmd_vendor_plugin gsmd_vendor_plugin = {
.name = "TI Calypso / HTC firmware",
+ .ext_chars = "%",
.num_unsolicit = ARRAY_SIZE(tihtc_unsolicit),
.unsolicit = tihtc_unsolicit,
.detect = &tihtc_detect,
personal git repositories of Harald Welte. Your mileage may vary