ofono.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@norrbonn.se>
To: ofono@ofono.org
Subject: Re: [PATCH v2 4/4] Make SARA R4 vendor ID conditional being attach and detach
Date: Wed, 24 Feb 2021 09:50:02 +0100	[thread overview]
Message-ID: <4c9a50c7-3007-d9f1-2ee0-679e899cedbf@norrbonn.se> (raw)
In-Reply-To: <20210224083924.3480-5-jupiter.hce@gmail.com>

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

Hi,

On 24/02/2021 09:39, Bing Jupiter wrote:
> ---
>   drivers/qmimodem/gprs.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
> index 896a9e4c..90203dd3 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,18 @@ static void qmi_set_attached(struct ofono_gprs *gprs, int attached,
>   
>   	DBG("attached %d", attached);
>   
> +	if (data->vendor == OFONO_VENDOR_UBLOX_SARA_R4) {
> +	/* This assumes neither 'attach' nor 'detach' are
> +	 * necessary... if 'attach' is required, then you'll
> +	 * need to make this section conditional on the action
> +	 * being 'detach'
> +	 */

Assuming you've tested this, you'll know whether 'attach' is required or 
not.  As such, fix accordingly and remove the above comment.

/Jonas


> +		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 +420,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-02-24  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  8:39 [PATCH v2 0/4] oFono uBlox SARA R4 QMI Bing Jupiter
2021-02-24  8:39 ` [PATCH v2 1/4] SARA R4 QMI support Bing Jupiter
2021-02-24  8:49   ` Jonas Bonn
2021-02-24  8:39 ` [PATCH v2 2/4] Enable SARA R4 vendor ID for gprs create Bing Jupiter
2021-02-24  8:39 ` [PATCH v2 3/4] Add SARA R4 vendor ID Bing Jupiter
2021-02-24  8:39 ` [PATCH v2 4/4] Make SARA R4 vendor ID conditional being attach and detach Bing Jupiter
2021-02-24  8:50   ` Jonas Bonn [this message]

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=4c9a50c7-3007-d9f1-2ee0-679e899cedbf@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).