ofono.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@norrbonn.se>
To: ofono@ofono.org
Subject: Re: [PATCH v5 3/4] Detect SARA R4 QMI device
Date: Wed, 12 May 2021 11:23:31 +0200	[thread overview]
Message-ID: <b849f2c8-21ed-1355-4a84-cfa193cc67e7@norrbonn.se> (raw)
In-Reply-To: <20210512074053.6718-4-jupiter.hce@gmail.com>

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

The SARA R4 modem detaches permanently from the network when the NAS 
Detach action is called.  This is problematic because ofono calls Detach 
when network connectivity is temporarily lost resulting in the modem 
never attempting to reattach again when the network once again becomes 
available.

In testing it was discovered, that the call to Attach doesn't appear to 
be required either.

This patch adds a quirk to the QMI GPRS atom to not call the NAS 
attach/detach actions for the uBlox SARA R4 device.

This has been tested on several SARA R4 devices that are running in 
long-term connectivity tests.  With this patch, the modem reconnects as 
the network comes and goes; without the patch, the modem goes idle the 
first time network connectivity is lost.

/Jonas

On 12/05/2021 09:40, Bing Jupiter wrote:
> ---
>   drivers/qmimodem/gprs.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
> index 896a9e4c..fa20b809 100644
> --- a/drivers/qmimodem/gprs.c
> +++ b/drivers/qmimodem/gprs.c
> @@ -26,6 +26,7 @@
>   #include <ofono/log.h>
>   #include <ofono/modem.h>
>   #include <ofono/gprs.h>
> +#include <drivers/atmodem/vendor.h>
>   
>   #include "qmi.h"
>   #include "nas.h"
> @@ -35,6 +36,7 @@
>   #include "qmimodem.h"
>   
>   struct gprs_data {
> +    unsigned int vendor;
>   	struct qmi_device *dev;
>   	struct qmi_service *nas;
>   	struct qmi_service *wds;
> @@ -284,6 +286,13 @@ static void qmi_set_attached(struct ofono_gprs *gprs, int attached,
>   
>   	DBG("attached %d", attached);
>   
> +    if (data->vendor == OFONO_VENDOR_UBLOX_SARA_R4) {
> +	    DBG("Debug vendor = OFONO_VENDOR_UBLOX_SARA_R4");
> +        CALLBACK_WITH_SUCCESS(cb, cbd->data);
> +        g_free(cbd);
> +        return;
> +    }
> +
>   	if (attached)
>   		action = QMI_NAS_ATTACH_ACTION_ATTACH;
>   	else
> @@ -406,6 +415,7 @@ static int qmi_gprs_probe(struct ofono_gprs *gprs,
>   	DBG("");
>   
>   	data = g_new0(struct gprs_data, 1);
> +    data->vendor = vendor;
>   
>   	ofono_gprs_set_data(gprs, data);
>   
> 

  reply	other threads:[~2021-05-12  9:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12  7:40 [PATCH v5 0/4] Bing Jupiter
2021-05-12  7:40 ` [PATCH v5 1/4] Detect SARA R4 QMI device Bing Jupiter
2021-05-12  7:55   ` Christophe Ronco
2021-05-12  9:17   ` Jonas Bonn
2021-05-12  7:40 ` [PATCH v5 2/4] " Bing Jupiter
2021-05-12  9:18   ` Jonas Bonn
2021-05-12  7:40 ` [PATCH v5 3/4] " Bing Jupiter
2021-05-12  9:23   ` Jonas Bonn [this message]
2021-05-12  7:40 ` [PATCH v5 4/4] " Bing Jupiter
2021-05-12  9:27   ` Jonas Bonn
2021-08-19  5:56     ` Jupiter
2021-05-12  9:17 ` [PATCH v5 0/4] Jonas Bonn
2021-05-14 17:00   ` 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=b849f2c8-21ed-1355-4a84-cfa193cc67e7@norrbonn.se \
    --to=jonas@norrbonn.se \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).