All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 4/7] quectel: EC21 needs aux channel to be the first mux channel
Date: Tue, 26 May 2020 16:14:45 +0000	[thread overview]
Message-ID: <344edfdc-5119-698a-9544-6a49a939ec44@gmail.com> (raw)
In-Reply-To: <20200526101625.31871-5-poeschel@lemonage.de>

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

Hi Lars,

On 5/26/20 5:16 AM, poeschel(a)lemonage.de wrote:
> From: Lars Poeschel <poeschel@lemonage.de>
> 
> The Quectel EC21 does only work correctly, if the mux channel used for
> aux is the first mux channel. It does only put it's URC messages in the
> first mux channel, so this has to be the aux channel in our case.
> ---
>   plugins/quectel.c | 51 +++++++++++++++++++++++++++++++++++------------
>   1 file changed, 38 insertions(+), 13 deletions(-)
> 
> diff --git a/plugins/quectel.c b/plugins/quectel.c
> index 1d312c45..9ff75516 100644
> --- a/plugins/quectel.c
> +++ b/plugins/quectel.c
> @@ -847,18 +847,38 @@ static void cmux_gatmux(struct ofono_modem *modem)
>   
>   	g_at_mux_start(data->mux);
>   
> -	data->modem = create_chat(modem, "Modem: ");
> -	if (!data->modem) {
> -		ofono_error("failed to create modem channel");
> -		close_serial(modem);
> -		return;
> -	}
> +	if (data->model == QUECTEL_EC21) {
> +		data->aux = create_chat(modem, "Aux: ");
>   
> -	data->aux = create_chat(modem, "Aux: ");
> -	if (!data->aux) {
> -		ofono_error("failed to create aux channel");
> -		close_serial(modem);
> -		return;
> +		if (!data->aux) {
> +			ofono_error("failed to create aux channel");
> +			close_serial(modem);
> +			return;
> +		}
> +
> +		data->modem = create_chat(modem, "Modem: ");
> +
> +		if (!data->modem) {
> +			ofono_error("failed to create modem channel");
> +			close_serial(modem);
> +			return;
> +		}
> +	} else {
> +		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;
> +		}
>   	}

Can we be smarter about this and just store the per-model creation 
sequence as an array or something?  Then have a loop that calls 
create_chat from the array info?  The proposed copy-pasting approach is 
not maintainable long term.

>   
>   	setup_aux(modem);
> @@ -951,8 +971,13 @@ 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
>   	 */
> -	ofono_modem_set_string(modem, "Modem", "/dev/gsmtty1");
> -	ofono_modem_set_string(modem, "Aux", "/dev/gsmtty2");
> +	if (data->model == QUECTEL_EC21) {
> +		ofono_modem_set_string(modem, "Modem", "/dev/gsmtty2");
> +		ofono_modem_set_string(modem, "Aux", "/dev/gsmtty1");
> +	} else {
> +		ofono_modem_set_string(modem, "Modem", "/dev/gsmtty1");
> +		ofono_modem_set_string(modem, "Aux", "/dev/gsmtty2");
> +	}

Doesn't this break the logic in mux_ready_cb, particularly the 'check if 
the last virtual gsm tty's are created'

>   
>   	/* wait for gsmtty devices to appear */
>   	if (!l_timeout_create_ms(100, mux_ready_cb, modem, NULL)) {
> 

Regards,
-Denis

  reply	other threads:[~2020-05-26 16:14 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 [this message]
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                   ` [PATCH] Revert "quectel: EC21 needs aux channel to be the first mux channel" poeschel
2020-08-07 16:07                     ` 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=344edfdc-5119-698a-9544-6a49a939ec44@gmail.com \
    --to=denkenz@gmail.com \
    --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.