All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] atmodem: Add gprs-context quirk for SIM900
Date: Wed, 17 Jul 2013 10:33:24 -0500	[thread overview]
Message-ID: <51E6B944.3060800@gmail.com> (raw)
In-Reply-To: <1374045255-26600-3-git-send-email-jesper.larsen@ixonos.com>

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

Hi Jesper,

On 07/17/2013 02:14 AM, Jesper Larsen wrote:
> The SIM900 module from SIMCOM does have a AT+CGDATA command.
> However, it is not possible to make a ppp connection when CGDATA
> has been used to bring up the gprs context.
>
> This patch ads a quirk that uses the alternative ATD*99***<cid>#
> command instead.
> ---
>   drivers/atmodem/gprs-context.c |    8 ++++++--
>   drivers/atmodem/vendor.h       |    1 +

I'd like the vendor.h change in a separate commit

>   plugins/sim900.c               |    2 +-

The changes to files in different directories should be separated 
whenever possible.  See 'HACKING' document in the top level directory of 
the source tree, particularly the 'Submitting Patches' section.

So your commits should be:
vendor.h change
gprs-context.c change
sim900.c change

>   3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
> index 3694c27..f46d881 100644
> --- a/drivers/atmodem/gprs-context.c
> +++ b/drivers/atmodem/gprs-context.c
> @@ -208,8 +208,12 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
>   		return;
>   	}
>
> -	sprintf(buf, "AT+CGDATA=\"PPP\",%u", gcd->active_context);
> -	if (g_at_chat_send(gcd->chat, buf, none_prefix,
> +        if (gcd->vendor == OFONO_VENDOR_SIMCOM_SIM900)
> +		sprintf(buf, "ATD*99***%u#", gcd->active_context);
> +	else
> +		sprintf(buf, "AT+CGDATA=\"PPP\",%u", gcd->active_context);
> +
> +        if (g_at_chat_send(gcd->chat, buf, none_prefix,

You're mixing tabs and spaces for indentation all over here.  We only 
use tabs.

>   				at_cgdata_cb, gc, NULL) > 0)
>   		return;
>
> diff --git a/drivers/atmodem/vendor.h b/drivers/atmodem/vendor.h
> index 0532d10..2b1a567 100644
> --- a/drivers/atmodem/vendor.h
> +++ b/drivers/atmodem/vendor.h
> @@ -39,6 +39,7 @@ enum ofono_vendor {
>   	OFONO_VENDOR_SPEEDUP,
>   	OFONO_VENDOR_SAMSUNG,
>   	OFONO_VENDOR_SIMCOM,
> +        OFONO_VENDOR_SIMCOM_SIM900,

Again, tabs for indentation only please

>   	OFONO_VENDOR_ICERA,
>   	OFONO_VENDOR_WAVECOM_Q2XXX,
>   	OFONO_VENDOR_ALCATEL
> diff --git a/plugins/sim900.c b/plugins/sim900.c
> index 643de51..3b4fd84 100644
> --- a/plugins/sim900.c
> +++ b/plugins/sim900.c
> @@ -361,7 +361,7 @@ static void sim900_post_sim(struct ofono_modem *modem)
>   	if (gprs == NULL)
>   		return;
>
> -	gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM,
> +	gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM_SIM900,
>   					"atmodem", data->dlcs[GPRS_DLC]);
>   	if (gc)
>   		ofono_gprs_add_context(gprs, gc);
>

Regards,
-Denis

  parent reply	other threads:[~2013-07-17 15:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  7:14 [PATCH 0/3] SIM900 GPRS fixes Jesper Larsen
2013-07-17  7:14 ` [PATCH 1/3] sim900: Enable serial receiver Jesper Larsen
2013-07-17  7:14   ` [PATCH 2/3] atmodem: Add gprs-context quirk for SIM900 Jesper Larsen
2013-07-17  7:14     ` [PATCH 3/3] sim900: Fix order of dlc prefixes Jesper Larsen
2013-07-17 15:29       ` Denis Kenzior
2013-07-17 15:33     ` Denis Kenzior [this message]
2013-07-17 15:29   ` [PATCH 1/3] sim900: Enable serial receiver Denis Kenzior
2013-07-18  7:49 ` [PATCH v2 1/3] atmodem: Add vendor entry for SIM900 module Jesper Larsen
2013-07-18  7:49   ` [PATCH v2 2/3] atmodem: Add gprs-context quirk for SIM900 Jesper Larsen
2013-07-18  7:49     ` [PATCH v2 3/3] sim900: Use SIM900 quirk for gprs context Jesper Larsen
2013-07-18 19:13   ` [PATCH v2 1/3] atmodem: Add vendor entry for SIM900 module 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=51E6B944.3060800@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.