All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Add call_compare_by_phone_number utility function
@ 2009-11-07  7:21 Zhenhua Zhang
  2009-11-11 22:26 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Zhenhua Zhang @ 2009-11-07  7:21 UTC (permalink / raw)
  To: ofono

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

These 4 patches are small enhancements and bugs fixing for HFP voice
call driver.

It's used by HFP voicecall driver to compare two calls. In some
hardware, the call index may be shift when another call is released.
So we cannot use call index to update status.

For example, we have call #1 and call #2. When #1 is release, the
index of #2 decrease to 1. But we need index num 2 in the driver.
Otherwise, the core will be confused.
---
 drivers/atmodem/atutil.c |    9 +++++++++
 drivers/atmodem/atutil.h |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c
index 26d0c25..687a466 100644
--- a/drivers/atmodem/atutil.c
+++ b/drivers/atmodem/atutil.c
@@ -67,6 +67,15 @@ gint at_util_call_compare_by_status(gconstpointer a,
gconstpointer b)
 	return 0;
 }
 
+gint at_util_call_compare_by_phone_number(gconstpointer a,
gconstpointer b)
+{
+	const struct ofono_call *call = a;
+	const struct ofono_phone_number *pb = b;
+
+	return memcmp(&call->phone_number, pb,
+				sizeof(struct ofono_phone_number));
+}
+
 gint at_util_call_compare(gconstpointer a, gconstpointer b)
 {
 	const struct ofono_call *ca = a;
diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h
index 0444561..4ae1a27 100644
--- a/drivers/atmodem/atutil.h
+++ b/drivers/atmodem/atutil.h
@@ -22,6 +22,7 @@
 void decode_at_error(struct ofono_error *error, const char *final);
 void dump_response(const char *func, gboolean ok, GAtResult *result);
 gint at_util_call_compare_by_status(gconstpointer a, gconstpointer b);
+gint at_util_call_compare_by_phone_number(gconstpointer a,
gconstpointer b);
 gint at_util_call_compare(gconstpointer a, gconstpointer b);
 unsigned int at_util_alloc_next_id(unsigned int *id_list);
 void at_util_release_id(unsigned int *id_list, unsigned int id);
-- 
1.6.2.5




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

end of thread, other threads:[~2009-11-11 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-07  7:21 [PATCH 1/4] Add call_compare_by_phone_number utility function Zhenhua Zhang
2009-11-11 22:26 ` Denis Kenzior

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.