All of lore.kernel.org
 help / color / mirror / Atom feed
From: poeschel@lemonage.de
To: ofono@ofono.org
Subject: [PATCH] Revert "quectel: EC21 needs aux channel to be the first mux channel"
Date: Tue, 04 Aug 2020 13:56:49 +0200	[thread overview]
Message-ID: <20200804115649.907281-1-poeschel@lemonage.de> (raw)
In-Reply-To: <e63d269e-e40b-63f7-2e95-135f06cb038e@gmail.com>

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

From: Lars Poeschel <poeschel@lemonage.de>

This reverts commit 1868dbf2b3e5929a7081b03a8ff76d214fd38624.
Development for this was done on EC21 firmware version
EC21EFAR06A01M4G_BETA0318. It now turns out, that actual release
firmware versions for this modem again need the original mux order with
aux channel as the second mux channel. (We know for sure for firmware
version EC21EFAR06A03M4G.)
We do not know for sure when and for what firmware versions quectel did
the switch back on the mux order, but we suspect that the "BETA"
firmware is the only one with the reversed mux order. This "BETA"
firmware was only given out for development purposes and will not appear
"in the wild", so we revert the patch here and hope for the best.
---
 plugins/quectel.c | 61 +++++++++++------------------------------------
 1 file changed, 14 insertions(+), 47 deletions(-)

diff --git a/plugins/quectel.c b/plugins/quectel.c
index cb15e147..043d39f9 100644
--- a/plugins/quectel.c
+++ b/plugins/quectel.c
@@ -78,27 +78,6 @@ static const uint8_t gsm0710_terminate[] = {
 	0xf9, /* close flag */
 };
 
-enum mux_type {
-	QUECTEL_MUX_TYPE_AUX = 0,
-	QUECTEL_MUX_TYPE_MODEM,
-	QUECTEL_MUX_TYPE_MAX,
-};
-
-struct mux_initialization_data {
-	enum mux_type mux_type;
-	char *chat_debug;
-	const char *n_gsm_key;
-	const char *n_gsm_value;
-};
-
-static const struct mux_initialization_data mux_order_default[] = {
-		{ QUECTEL_MUX_TYPE_MODEM, "Modem: ", "Modem", "/dev/gsmtty1"},
-		{ QUECTEL_MUX_TYPE_AUX, "Aux: ", "Aux", "/dev/gsmtty2"} };
-
-static const struct mux_initialization_data mux_order_ec21[] = {
-		{ QUECTEL_MUX_TYPE_AUX, "Aux: ", "Aux", "/dev/gsmtty1"},
-		{ QUECTEL_MUX_TYPE_MODEM, "Modem: ", "Modem", "/dev/gsmtty2"} };
-
 enum quectel_model {
 	QUECTEL_UNKNOWN,
 	QUECTEL_UC15,
@@ -127,7 +106,6 @@ struct quectel_data {
 	struct l_timeout *init_timeout;
 	size_t init_count;
 	guint init_cmd;
-	const struct mux_initialization_data *mux_order;
 };
 
 struct dbus_hw {
@@ -860,7 +838,6 @@ static GAtChat *create_chat(struct ofono_modem *modem, char *debug)
 static void cmux_gatmux(struct ofono_modem *modem)
 {
 	struct quectel_data *data = ofono_modem_get_data(modem);
-	GAtChat *chat;
 
 	DBG("%p", modem);
 
@@ -876,21 +853,18 @@ static void cmux_gatmux(struct ofono_modem *modem)
 
 	g_at_mux_start(data->mux);
 
-	for (int i = 0; i < QUECTEL_MUX_TYPE_MAX; i++) {
-		chat = create_chat(modem, data->mux_order[i].chat_debug);
-
-		if (!chat) {
-			ofono_error("failed to create %schannel",
-					data->mux_order[i].chat_debug);
-			close_serial(modem);
-			return;
-		}
-
-		if (data->mux_order[i].mux_type == QUECTEL_MUX_TYPE_AUX)
-			data->aux = chat;
-		else
-			data->modem = chat;
+	data->modem = create_chat(modem, "Modem: ");
+	if (!data->modem) {
+		ofono_error("failed to create modem channel");
+		close_serial(modem);
+		return;
+	}
 
+	data->aux = create_chat(modem, "Aux: ");
+	if (!data->aux) {
+		ofono_error("failed to create aux channel");
+		close_serial(modem);
+		return;
 	}
 
 	setup_aux(modem);
@@ -906,9 +880,7 @@ static void mux_ready_cb(struct l_timeout *timeout, void *user_data)
 	DBG("%p", modem);
 
 	/* check if the last (and thus all) virtual gsm tty's are created */
-	ret = stat(ofono_modem_get_string(modem,
-			data->mux_order[QUECTEL_MUX_TYPE_MAX - 1].n_gsm_key),
-			&st);
+	ret = stat(ofono_modem_get_string(modem, "Modem"), &st);
 	if (ret < 0) {
 		if (data->mux_ready_count++ < 5) {
 			/* not ready yet; try again in 100 ms*/
@@ -985,10 +957,8 @@ static void cmux_ngsm(struct ofono_modem *modem)
 	 * the kernel does not yet support mapping the underlying serial device
 	 * to its virtual gsm ttys, so hard-code gsmtty1 gsmtty2 for now
 	 */
-	for (int i = 0; i < QUECTEL_MUX_TYPE_MAX; i++) {
-		ofono_modem_set_string(modem, data->mux_order[i].n_gsm_key,
-					data->mux_order[i].n_gsm_value);
-	}
+	ofono_modem_set_string(modem, "Modem", "/dev/gsmtty1");
+	ofono_modem_set_string(modem, "Aux", "/dev/gsmtty2");
 
 	/* wait for gsmtty devices to appear */
 	if (!l_timeout_create_ms(100, mux_ready_cb, modem, NULL)) {
@@ -1044,8 +1014,6 @@ static void cgmm_cb(int ok, GAtResult *result, void *user_data)
 		return;
 	}
 
-	data->mux_order = mux_order_default;
-
 	if (strcmp(model, "UC15") == 0) {
 		DBG("%p model UC15", modem);
 		data->vendor = OFONO_VENDOR_QUECTEL;
@@ -1062,7 +1030,6 @@ static void cgmm_cb(int ok, GAtResult *result, void *user_data)
 		DBG("%p model EC21", modem);
 		data->vendor = OFONO_VENDOR_QUECTEL;
 		data->model = QUECTEL_EC21;
-		data->mux_order = mux_order_ec21;
 	} else {
 		ofono_warn("%p unknown model: '%s'", modem, model);
 		data->vendor = OFONO_VENDOR_QUECTEL;
-- 
2.27.0

  reply	other threads:[~2020-08-04 11:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 10:16 [PATCH 0/7] Add quectel EC21 in serial mode poeschel
2020-05-26 10:16 ` [PATCH 1/7] quectel: Add Quectel EC21 to known serial modems poeschel
2020-05-26 10:16 ` [PATCH 2/7] quectel: use lte atom on EC21 poeschel
2020-05-26 10:16 ` [PATCH 3/7] quectel: Query the model before setting up the mux poeschel
2020-05-26 10:16 ` [PATCH 4/7] quectel: EC21 needs aux channel to be the first mux channel poeschel
2020-05-26 16:14   ` Denis Kenzior
2020-05-27 15:08     ` Lars Poeschel
2020-05-28  9:32       ` [PATCH v2] " poeschel
2020-05-28 16:25         ` Denis Kenzior
2020-05-29 12:43           ` [PATCH v3] " poeschel
2020-05-29 14:58             ` Denis Kenzior
2020-07-24 11:02               ` Lars Poeschel
2020-07-28 16:40                 ` Denis Kenzior
2020-08-04 11:56                   ` poeschel [this message]
2020-08-07 16:07                     ` [PATCH] Revert "quectel: EC21 needs aux channel to be the first mux channel" Denis Kenzior
2020-05-26 10:16 ` [PATCH 5/7] quectel: EC21 does not understand AT+QIURC poeschel
2020-05-26 10:16 ` [PATCH 6/7] voicecall: Quectel modem do not understand AT+CNAP poeschel
2020-05-26 10:16 ` [PATCH 7/7] quectel: EC21 add ussd with atmodem driver poeschel
2020-05-26 16:09 ` [PATCH 0/7] Add quectel EC21 in serial mode Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200804115649.907281-1-poeschel@lemonage.de \
    --to=poeschel@lemonage.de \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.