Open Source Telephony
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: ofono@ofono.org
Subject: Re: [PATCH v2] qmimodem: support wake on SMS receive
Date: Thu, 23 May 2019 15:30:37 +0200	[thread overview]
Message-ID: <20190523133037.GA15765@amd> (raw)
In-Reply-To: <33895343.1315.1558616914012@wamui-dingo.atl.sa.earthlink.net>

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

Hi!

> Some modems, like Quectel EC25, support waking the host platform from a suspend state upon an SMS reception. Current SMS handling configures the modem to not save incoming messages. On platforms where the modem's interfaces (eg, cdc-wdm, wwan, etc) disconnect on suspend and reconnect on resume, oFono will re-initialize. This can cause lost messages upon resume because the QMI indication is sent before oFono is ready.
> 
> Changes to support suspend/resume with wake on SMS:
> - On startup:
>   1. Configure modem to save messages to NV and notify for class NONE.
>   2. Delete all processed messages in modem memory to free space.
>   3. Get list of unread messages, then get and delete each.
> - After startup:
>   1. Process message upon event indication and delete.
>   2. Then check for possibly more messages to process.
> ---
>  drivers/qmimodem/sms.c | 344 +++++++++++++++++++++++++++++++++++++++++--------
>  drivers/qmimodem/wms.h |  77 ++++++++---
>  2 files changed, 348 insertions(+), 73 deletions(-)
> 

> +static void delete_msg(struct ofono_sms *sms, uint8_t tag) {
> +	struct sms_data *data = ofono_sms_get_data(sms);
> +	struct qmi_param *param;
> +	qmi_result_func_t func = NULL;
> +
> +	DBG("");
> +
> +	param = qmi_param_new();
> +	if (param == NULL)
> +		goto done;
> +
> +	qmi_param_append_uint8(param, QMI_WMS_PARAM_DEL_STORE,
> +				QMI_WMS_STORAGE_TYPE_NV);
> +
> +	if (tag == QMI_WMS_MT_UNDEFINE) {
> +		DBG("delete read msg type %d ndx %d", data->rd_msg_id.type,
> +			data->rd_msg_id.ndx);
> +
> +		/* delete 1 msg */
> +		qmi_param_append_uint32(param, QMI_WMS_PARAM_DEL_NDX,
> +					data->rd_msg_id.ndx);
> +		func = delete_msg_cb;
> +	} else {
> +		DBG("delete msg tag %d mode %d", tag, data->msg_mode);
> +
> +		/* delete all msgs from 1 tag type */
> +		qmi_param_append_uint8(param, QMI_WMS_PARAM_DEL_TYPE, tag);
> +	}
> +
> +	qmi_param_append_uint8(param, QMI_WMS_PARAM_DEL_MODE, data->msg_mode);
> +
> +	if (qmi_service_send(data->wms, QMI_WMS_DELETE, param,
> +			func, sms, NULL) > 0)
>  		return;
> +
> +	qmi_param_free(param);
> +
> +done:
> +	return;
> +}

Explicit "return" at the end of void function looks quite strange to
me. goto jumping to it even more so... 
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      reply	other threads:[~2019-05-23 13:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28  1:48 [PATCH v2] qmimodem: support wake on SMS receive Tom Nguyen
2019-05-23 13:30 ` Pavel Machek [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=20190523133037.GA15765@amd \
    --to=pavel@ucw.cz \
    --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