linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver
@ 2010-11-30 12:26 Luiz Augusto von Dentz
  2010-11-30 12:26 ` [PATCH 2/3] Use specific members in D-Bus match rules on telephony maemo6 driver Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2010-11-30 12:26 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

---
 audio/telephony-maemo6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 2e01fb1..0240957 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -1963,7 +1963,7 @@ int telephony_init(void)
 	add_watch(NULL, NULL, CSD_CSNET_REGISTRATION, NULL);
 	add_watch(NULL, NULL, CSD_CSNET_OPERATOR, NULL);
 	add_watch(NULL, NULL, CSD_CSNET_SIGNAL, NULL);
-	add_watch(NULL, NULL, CSD_CSNET_SIGNAL, "modem_state_changed_ind");
+	add_watch(NULL, NULL, SSC_DBUS_IFACE, "modem_state_changed_ind");
 
 	if (send_method_call(SSC_DBUS_NAME, SSC_DBUS_PATH, SSC_DBUS_IFACE,
 					"get_modem_state", modem_state_reply,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] Use specific members in D-Bus match rules on telephony maemo6 driver
  2010-11-30 12:26 [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Luiz Augusto von Dentz
@ 2010-11-30 12:26 ` Luiz Augusto von Dentz
  2010-11-30 12:26 ` [PATCH 3/3] Fix not canceling pending calls on maemo6 telephony driver exit Luiz Augusto von Dentz
  2010-11-30 12:31 ` [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Johan Hedberg
  2 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2010-11-30 12:26 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

This reduces the amount of unnecessary wake-ups without breaking anything
---
 audio/telephony-maemo6.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 0240957..7853bae 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -1960,9 +1960,9 @@ int telephony_init(void)
 	add_watch(NULL, NULL, CSD_CALL_INTERFACE, NULL);
 	add_watch(NULL, NULL, CSD_CALL_INSTANCE, NULL);
 	add_watch(NULL, NULL, CSD_CALL_CONFERENCE, NULL);
-	add_watch(NULL, NULL, CSD_CSNET_REGISTRATION, NULL);
-	add_watch(NULL, NULL, CSD_CSNET_OPERATOR, NULL);
-	add_watch(NULL, NULL, CSD_CSNET_SIGNAL, NULL);
+	add_watch(NULL, NULL, CSD_CSNET_REGISTRATION, "RegistrationChanged");
+	add_watch(NULL, NULL, CSD_CSNET_OPERATOR, "OperatorNameChanged");
+	add_watch(NULL, NULL, CSD_CSNET_SIGNAL, "SignalBarsChanged");
 	add_watch(NULL, NULL, SSC_DBUS_IFACE, "modem_state_changed_ind");
 
 	if (send_method_call(SSC_DBUS_NAME, SSC_DBUS_PATH, SSC_DBUS_IFACE,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] Fix not canceling pending calls on maemo6 telephony driver exit
  2010-11-30 12:26 [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Luiz Augusto von Dentz
  2010-11-30 12:26 ` [PATCH 2/3] Use specific members in D-Bus match rules on telephony maemo6 driver Luiz Augusto von Dentz
@ 2010-11-30 12:26 ` Luiz Augusto von Dentz
  2010-11-30 12:32   ` Johan Hedberg
  2010-11-30 12:31 ` [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Johan Hedberg
  2 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2010-11-30 12:26 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

This happens when the driver exit is called quickly after init due to
adapter power changes.
---
 audio/telephony-maemo6.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 7853bae..bfd3ba1 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -150,6 +150,7 @@ static DBusConnection *connection = NULL;
 
 static GSList *calls = NULL;
 static GSList *watches = NULL;
+static GSList *pending = NULL;
 
 /* Reference count for determining the call indicator status */
 static GSList *active_calls = NULL;
@@ -592,7 +593,7 @@ static int send_method_call(const char *dest, const char *path,
 	}
 
 	dbus_pending_call_set_notify(call, cb, user_data, NULL);
-	dbus_pending_call_unref(call);
+	pending = g_slist_prepend(pending, call);
 	dbus_message_unref(msg);
 
 	return 0;
@@ -1312,6 +1313,12 @@ static gboolean iter_get_basic_args(DBusMessageIter *iter,
 	return type == DBUS_TYPE_INVALID ? TRUE : FALSE;
 }
 
+static void remove_pending(DBusPendingCall *call)
+{
+	pending = g_slist_remove(pending, call);
+	dbus_pending_call_unref(call);
+}
+
 static void hal_battery_level_reply(DBusPendingCall *call, void *user_data)
 {
 	DBusError err;
@@ -1360,8 +1367,10 @@ static void hal_battery_level_reply(DBusPendingCall *call, void *user_data)
 
 		telephony_update_indicator(maemo_indicators, "battchg", new);
 	}
+
 done:
 	dbus_message_unref(reply);
+	remove_pending(call);
 }
 
 static void hal_get_integer(const char *path, const char *key, void *user_data)
@@ -1556,6 +1565,7 @@ static void get_property_reply(DBusPendingCall *call, void *user_data)
 done:
 	g_free(prop);
 	dbus_message_unref(reply);
+	remove_pending(call);
 }
 
 static int get_property(const char *iface, const char *prop)
@@ -1615,6 +1625,7 @@ static void call_info_reply(DBusPendingCall *call, void *user_data)
 
 done:
 	dbus_message_unref(reply);
+	remove_pending(call);
 }
 
 
@@ -1665,6 +1676,7 @@ static void phonebook_read_reply(DBusPendingCall *call, void *user_data)
 
 done:
 	dbus_message_unref(reply);
+	remove_pending(call);
 }
 
 static void csd_init(void)
@@ -1843,6 +1855,7 @@ static void modem_state_reply(DBusPendingCall *call, void *user_data)
 		handle_modem_state(reply);
 
 	dbus_message_unref(reply);
+	remove_pending(call);
 }
 
 static gboolean signal_filter(DBusConnection *conn, DBusMessage *msg,
@@ -1940,6 +1953,7 @@ static void hal_find_device_reply(DBusPendingCall *call, void *user_data)
 
 done:
 	dbus_message_unref(reply);
+	remove_pending(call);
 }
 
 int telephony_init(void)
@@ -2016,6 +2030,11 @@ void telephony_exit(void)
 	g_slist_free(calls);
 	calls = NULL;
 
+	g_slist_foreach(pending, (GFunc) dbus_pending_call_cancel, NULL);
+	g_slist_foreach(pending, (GFunc) remove_pending, NULL);
+	g_slist_free(pending);
+	pending = NULL;
+
 	g_slist_foreach(watches, (GFunc) remove_watch, NULL);
 	g_slist_free(watches);
 	watches = NULL;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver
  2010-11-30 12:26 [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Luiz Augusto von Dentz
  2010-11-30 12:26 ` [PATCH 2/3] Use specific members in D-Bus match rules on telephony maemo6 driver Luiz Augusto von Dentz
  2010-11-30 12:26 ` [PATCH 3/3] Fix not canceling pending calls on maemo6 telephony driver exit Luiz Augusto von Dentz
@ 2010-11-30 12:31 ` Johan Hedberg
  2 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2010-11-30 12:31 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Tue, Nov 30, 2010, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
> 
> ---
>  audio/telephony-maemo6.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

The first two patches have been pushed upstream. Thanks.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] Fix not canceling pending calls on maemo6 telephony driver exit
  2010-11-30 12:26 ` [PATCH 3/3] Fix not canceling pending calls on maemo6 telephony driver exit Luiz Augusto von Dentz
@ 2010-11-30 12:32   ` Johan Hedberg
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2010-11-30 12:32 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Tue, Nov 30, 2010, Luiz Augusto von Dentz wrote:
> +	g_slist_foreach(pending, (GFunc) remove_pending, NULL);
> +	g_slist_free(pending);

Maybe GLib can handle removing the items in the foreach callback, but I
think it'd be better to just use pending_call_unref in this case.

Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-30 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30 12:26 [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Luiz Augusto von Dentz
2010-11-30 12:26 ` [PATCH 2/3] Use specific members in D-Bus match rules on telephony maemo6 driver Luiz Augusto von Dentz
2010-11-30 12:26 ` [PATCH 3/3] Fix not canceling pending calls on maemo6 telephony driver exit Luiz Augusto von Dentz
2010-11-30 12:32   ` Johan Hedberg
2010-11-30 12:31 ` [PATCH 1/3] Fix interface name of modem states on maemo6 telephony driver Johan Hedberg

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).