Open Source Telephony
 help / color / mirror / Atom feed
From: Marit Henriksen <maritsofie.henriksen8@gmail.com>
To: ofono@ofono.org
Subject: [PATCH] stemodem: Fix handling of local_release.
Date: Thu, 03 Feb 2011 14:15:45 +0100	[thread overview]
Message-ID: <1296738945-23696-1-git-send-email-maritsofie.henriksen8@gmail.com> (raw)

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

From: Marit Henriksen <marit.henriksen@stericsson.com>

- Reset local_release when call is disconnected.
- Change bitmap for affected types, ste_hangup is only called when
  call state is Incoming, Dialing, Alerting or Active.
- Used macros instead of numbers when creating bitmaps.
---
 drivers/stemodem/voicecall.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c
index 1c7c0bd..d8c296e 100644
--- a/drivers/stemodem/voicecall.c
+++ b/drivers/stemodem/voicecall.c
@@ -250,7 +250,12 @@ static void ste_answer(struct ofono_voicecall *vc,
 static void ste_hangup(struct ofono_voicecall *vc,
 			ofono_voicecall_cb_t cb, void *data)
 {
-	ste_template("AT+CHUP", vc, ste_generic_cb, 0x3f, cb, data);
+	unsigned int active_dial_alert_or_incoming =
+			(0x1 << CALL_STATUS_ACTIVE) | (0x1 << CALL_STATUS_DIALING) |
+			(0x1 << CALL_STATUS_ALERTING) | (0x1 << CALL_STATUS_INCOMING);
+
+	ste_template("AT+CHUP", vc, ste_generic_cb,
+			active_dial_alert_or_incoming, cb, data);
 }
 
 static void ste_hold_all_active(struct ofono_voicecall *vc,
@@ -262,14 +267,17 @@ static void ste_hold_all_active(struct ofono_voicecall *vc,
 static void ste_release_all_held(struct ofono_voicecall *vc,
 				ofono_voicecall_cb_t cb, void *data)
 {
-	unsigned int held_status = 0x1 << 1;
-	ste_template("AT+CHLD=0", vc, ste_generic_cb, held_status, cb, data);
+	unsigned int held = 0x1 << CALL_STATUS_HELD;
+
+	ste_template("AT+CHLD=0", vc, ste_generic_cb, held, cb, data);
 }
 
 static void ste_set_udub(struct ofono_voicecall *vc,
 			ofono_voicecall_cb_t cb, void *data)
 {
-	unsigned int incoming_or_waiting = (0x1 << 4) | (0x1 << 5);
+	unsigned int incoming_or_waiting =
+			(0x1 << CALL_STATUS_INCOMING) | (0x1 << CALL_STATUS_WAITING);
+
 	ste_template("AT+CHLD=0", vc, ste_generic_cb, incoming_or_waiting,
 			cb, data);
 }
@@ -277,7 +285,9 @@ static void ste_set_udub(struct ofono_voicecall *vc,
 static void ste_release_all_active(struct ofono_voicecall *vc,
 					ofono_voicecall_cb_t cb, void *data)
 {
-	ste_template("AT+CHLD=1", vc, ste_generic_cb, 0x1, cb, data);
+	unsigned int active = 0x1 << CALL_STATUS_ACTIVE;
+
+	ste_template("AT+CHLD=1", vc, ste_generic_cb, active, cb, data);
 }
 
 static void ste_release_specific(struct ofono_voicecall *vc, int id,
@@ -472,6 +482,7 @@ static void ecav_notify(GAtResult *result, gpointer user_data)
 		ofono_voicecall_disconnected(vc, existing_call->id,
 						reason, NULL);
 
+		vd->local_release &= ~(1 << existing_call->id);
 		vd->calls = g_slist_remove(vd->calls, l->data);
 		break;
 	}
-- 
1.7.1


             reply	other threads:[~2011-02-03 13:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 13:15 Marit Henriksen [this message]
2011-02-03 16:20 ` [PATCH] stemodem: Fix handling of local_release 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=1296738945-23696-1-git-send-email-maritsofie.henriksen8@gmail.com \
    --to=maritsofie.henriksen8@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