Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH v2 1/3] Add a vendor OFONO_VENDOR_QUECTEL_EC2X
@ 2020-08-11 11:42 poeschel
  2020-08-11 11:42 ` [PATCH v2 2/3] atmodem: Get strength and tech the quectel way on EC21 poeschel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: poeschel @ 2020-08-11 11:42 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3252 bytes --]

From: Lars Poeschel <poeschel@lemonage.de>

The distinction between OFONO_VENDOR_QUECTEL and
OFONO_VENDOR_QUECTEL_SERIAL does not suffice for EC21/EC25 in some
places, so introduce and use a new vendor:
OFONO_VENDOR_QUECTEL_EC2X
---
 drivers/atmodem/sim.c       | 1 +
 drivers/atmodem/sms.c       | 2 ++
 drivers/atmodem/vendor.h    | 1 +
 drivers/atmodem/voicecall.c | 3 ++-
 plugins/quectel.c           | 2 +-
 5 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index e750a139..6ab91655 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -1213,6 +1213,7 @@ static void at_pin_retries_query(struct ofono_sim *sim,
 			return;
 		break;
 	case OFONO_VENDOR_QUECTEL:
+	case OFONO_VENDOR_QUECTEL_EC2X:
 		if (g_at_chat_send(sd->chat, "AT+QPINC?", qpinc_prefix,
 					at_qpinc_cb, cbd, g_free) > 0)
 			return;
diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
index d502da72..ed3b1370 100644
--- a/drivers/atmodem/sms.c
+++ b/drivers/atmodem/sms.c
@@ -337,6 +337,7 @@ static inline void at_ack_delivery(struct ofono_sms *sms)
 	if (data->cnma_ack_pdu) {
 		switch (data->vendor) {
 		case OFONO_VENDOR_GEMALTO:
+		case OFONO_VENDOR_QUECTEL_EC2X:
 			snprintf(buf, sizeof(buf), "AT+CNMA=1");
 			break;
 		case OFONO_VENDOR_QUECTEL_SERIAL:
@@ -845,6 +846,7 @@ static gboolean build_cnmi_string(char *buf, int *cnmi_opts,
 	case OFONO_VENDOR_ZTE:
 	case OFONO_VENDOR_SIMCOM:
 	case OFONO_VENDOR_QUECTEL:
+	case OFONO_VENDOR_QUECTEL_EC2X:
 		/* MSM devices advertise support for mode 2, but return an
 		 * error if we attempt to actually use it. */
 		mode = "1";
diff --git a/drivers/atmodem/vendor.h b/drivers/atmodem/vendor.h
index d839d1e0..6bac7f89 100644
--- a/drivers/atmodem/vendor.h
+++ b/drivers/atmodem/vendor.h
@@ -44,6 +44,7 @@ enum ofono_vendor {
 	OFONO_VENDOR_WAVECOM_Q2XXX,
 	OFONO_VENDOR_ALCATEL,
 	OFONO_VENDOR_QUECTEL,
+	OFONO_VENDOR_QUECTEL_EC2X,
 	OFONO_VENDOR_QUECTEL_SERIAL,
 	OFONO_VENDOR_UBLOX,
 	OFONO_VENDOR_XMM,
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index e7f24b60..4797227e 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -1114,7 +1114,8 @@ static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
 	g_at_chat_send(vd->chat, "AT+CLIP=1", NULL, NULL, NULL, NULL);
 	g_at_chat_send(vd->chat, "AT+CDIP=1", NULL, NULL, NULL, NULL);
 
-	if (vd->vendor != OFONO_VENDOR_QUECTEL)
+	if ((vd->vendor != OFONO_VENDOR_QUECTEL) &&
+		(vd->vendor != OFONO_VENDOR_QUECTEL_EC2X))
 		g_at_chat_send(vd->chat, "AT+CNAP=1", NULL, NULL, NULL, NULL);
 
 	switch (vd->vendor) {
diff --git a/plugins/quectel.c b/plugins/quectel.c
index 203b702e..8ca901f2 100644
--- a/plugins/quectel.c
+++ b/plugins/quectel.c
@@ -1032,7 +1032,7 @@ static void cgmm_cb(int ok, GAtResult *result, void *user_data)
 		data->model = QUECTEL_MC60;
 	} else if (strcmp(model, "EC21") == 0) {
 		DBG("%p model EC21", modem);
-		data->vendor = OFONO_VENDOR_QUECTEL;
+		data->vendor = OFONO_VENDOR_QUECTEL_EC2X;
 		data->model = QUECTEL_EC21;
 	} else {
 		ofono_warn("%p unknown model: '%s'", modem, model);
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-12 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-11 11:42 [PATCH v2 1/3] Add a vendor OFONO_VENDOR_QUECTEL_EC2X poeschel
2020-08-11 11:42 ` [PATCH v2 2/3] atmodem: Get strength and tech the quectel way on EC21 poeschel
2020-08-11 11:42 ` [PATCH v2 3/3] gprs: Quectel EC21 does not understand AT+CPSB poeschel
2020-08-11 15:55   ` Denis Kenzior
2020-08-12  9:20     ` Lars Poeschel
2020-08-12 14:44       ` Denis Kenzior
2020-08-11 15:51 ` [PATCH v2 1/3] Add a vendor OFONO_VENDOR_QUECTEL_EC2X Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox