Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [isi-voicecall-fix PATCHv3 3/6] isi/voicecall: save call id when queueing requests
Date: Mon, 22 Nov 2010 08:16:35 -0600	[thread overview]
Message-ID: <4CEA7B43.3030206@gmail.com> (raw)
In-Reply-To: <1289927124-30133-3-git-send-email-Pekka.Pessi@nokia.com>

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

Hi Pekka,

On 11/16/2010 11:05 AM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> ---
>  drivers/isimodem/voicecall.c |   64 +++++++++++++++++++++++++++---------------
>  1 files changed, 41 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
> index c450f12..60052d4 100644
> --- a/drivers/isimodem/voicecall.c
> +++ b/drivers/isimodem/voicecall.c
> @@ -80,41 +80,57 @@ enum {
>  /* ------------------------------------------------------------------------- */
>  /* Request context for voicecall cb */
>  
> -struct isi_call_req_context;
> -
>  typedef void isi_call_req_step(struct isi_call_req_context *, int reason);
>  
>  struct isi_call_req_context {
> -	struct isi_call_req_context *next, **prev;
> +	struct isi_call_req_context *next;
> +	struct isi_call_req_context **prev;
>  	isi_call_req_step *step;
> +	int id;
>  	struct ofono_voicecall *ovc;
>  	ofono_voicecall_cb_t cb;
>  	void *data;
>  };
>  
> -static struct isi_call_req_context *
> -isi_call_req(struct ofono_voicecall *ovc,
> -		void const *restrict req,
> -		size_t len,
> -		GIsiResponse *handler,
> -		ofono_voicecall_cb_t cb, void *data)
> +static struct isi_call_req_context *isi_call_req_new(
> +	struct ofono_voicecall *ovc,
> +	ofono_voicecall_cb_t cb,
> +	void *data)

Please indent this some more

>  {
> -	struct isi_voicecall *ivc;
>  	struct isi_call_req_context *irc;
>  
> -	ivc = ofono_voicecall_get_data(ovc);
> -
>  	irc = g_try_new0(struct isi_call_req_context, 1);
> +	if (irc == NULL) {
> +		if (cb)
> +			CALLBACK_WITH_FAILURE(cb, data);

doc/docing-style.txt item M1.

> +		return NULL;
> +	}
>  
> -	if (irc) {
> -		irc->ovc = ovc;
> -		irc->cb = cb;
> -		irc->data = data;
> +	irc->ovc = ovc;
> +	irc->cb = cb;
> +	irc->data = data;
>  
> -		if (g_isi_request_make(ivc->client, req, len,
> -					ISI_CALL_TIMEOUT, handler, irc))
> -			return irc;
> -	}
> +	return irc;
> +}
> +
> +static struct isi_call_req_context *isi_call_req(struct ofono_voicecall *ovc,
> +						void const *restrict req,
> +						size_t len,
> +						GIsiResponse *handler,
> +						ofono_voicecall_cb_t cb,
> +						void *data)
> +{
> +	struct isi_voicecall *ivc;
> +	struct isi_call_req_context *irc;
> +
> +	irc = isi_call_req_new(ovc, cb, data);
> +	if (!irc)
> +		return NULL;
> +
> +	ivc = ofono_voicecall_get_data(ovc);

doc/docing-style.txt item M1.

> +	if (g_isi_send(ivc->client, req, len,
> +			ISI_CALL_TIMEOUT, handler, irc, NULL))
> +		return irc;
>  
>  	g_free(irc);
>  
> @@ -125,7 +141,8 @@ isi_call_req(struct ofono_voicecall *ovc,
>  }
>  
>  static void isi_ctx_queue(struct isi_call_req_context *irc,
> -				isi_call_req_step *next)
> +				isi_call_req_step *next,
> +				int id)
>  {
>  	if (irc->prev == NULL) {
>  		struct isi_voicecall *ivc = ofono_voicecall_get_data(irc->ovc);
> @@ -139,6 +156,7 @@ static void isi_ctx_queue(struct isi_call_req_context *irc,
>  	}
>  
>  	irc->step = next;
> +	irc->id = id;
>  }
>  
>  static void isi_ctx_remove(struct isi_call_req_context *irc)
> @@ -1078,9 +1096,9 @@ static void isi_release_all_active(struct ofono_voicecall *ovc,
>  		if (irc == NULL)
>  			;
>  		else if (waiting)
> -			isi_ctx_queue(irc, isi_wait_and_answer);
> +			isi_ctx_queue(irc, isi_wait_and_answer, 0);
>  		else if (hold)
> -			isi_ctx_queue(irc, isi_wait_and_retrieve);
> +			isi_ctx_queue(irc, isi_wait_and_retrieve, 0);
>  	} else
>  		CALLBACK_WITH_FAILURE(cb, data);
>  }

Regards,
-Denis

  parent reply	other threads:[~2010-11-22 14:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 17:05 [isi-voicecall-fix PATCHv3 1/6] voicecall: fix dial result handling Pekka.Pessi
2010-11-16 17:05 ` [isi-voicecall-fix PATCHv3 2/6] isi/voicecall: fix status reporting Pekka.Pessi
2010-11-16 17:05   ` [isi-voicecall-fix PATCHv3 3/6] isi/voicecall: save call id when queueing requests Pekka.Pessi
2010-11-16 17:05     ` [isi-voicecall-fix PATCHv3 4/6] isi/voicecall: fix answering early incoming calls Pekka.Pessi
2010-11-16 17:05       ` [isi-voicecall-fix PATCHv3 5/6] isi/voicecall: release COMING calls with BUSY cause Pekka.Pessi
2010-11-16 17:05         ` [isi-voicecall-fix PATCHv3 6/6] isi/voicecall: fix isi_release_all_active() Pekka.Pessi
2010-11-22 14:21         ` [isi-voicecall-fix PATCHv3 5/6] isi/voicecall: release COMING calls with BUSY cause Denis Kenzior
2010-11-22 14:19       ` [isi-voicecall-fix PATCHv3 4/6] isi/voicecall: fix answering early incoming calls Denis Kenzior
2010-11-22 16:22         ` Pekka Pessi
2010-11-22 16:38           ` Denis Kenzior
2010-11-22 14:16     ` Denis Kenzior [this message]
2010-11-22 14:14   ` [isi-voicecall-fix PATCHv3 2/6] isi/voicecall: fix status reporting Denis Kenzior
2010-11-22 16:09     ` Pekka Pessi
2010-11-22 16:37       ` Denis Kenzior
2010-11-22 13:43 ` [isi-voicecall-fix PATCHv3 1/6] voicecall: fix dial result handling Denis Kenzior
2010-11-22 16:50   ` Pekka Pessi
2010-11-22 17:27     ` 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=4CEA7B43.3030206@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox