All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Tweak at_util_sim_state_query_new() function
@ 2012-04-17 14:48 Guillaume Zajac
  2012-04-17 14:48 ` [PATCH 1/2] atutil: Add destroyer in at_util_sim_state_query_new prototype Guillaume Zajac
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guillaume Zajac @ 2012-04-17 14:48 UTC (permalink / raw)
  To: ofono

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

Hi all,

First patch improves at_util_sim_state_query_new() function.
A user data destroyer can be now specifed.
Second is just updating the plugins that are using this function.

Kind regards,
Guillaume

Guillaume Zajac (2):
  atutil: Add destroyer in at_util_sim_state_query_new prototype
  plugins: Update new at_util_sim_state_query_new() prototype use

 drivers/atmodem/atutil.c |    8 +++++++-
 drivers/atmodem/atutil.h |    3 ++-
 plugins/alcatel.c        |    3 ++-
 plugins/mbm.c            |    2 +-
 plugins/samsung.c        |    3 ++-
 plugins/speedup.c        |    3 ++-
 plugins/zte.c            |    3 ++-
 7 files changed, 18 insertions(+), 7 deletions(-)

-- 
1.7.4.1


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

* [PATCH 1/2] atutil: Add destroyer in at_util_sim_state_query_new prototype
  2012-04-17 14:48 [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac
@ 2012-04-17 14:48 ` Guillaume Zajac
  2012-04-17 14:48 ` [PATCH 2/2] plugins: Update new at_util_sim_state_query_new() prototype use Guillaume Zajac
  2012-04-18 10:06 ` [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac
  2 siblings, 0 replies; 4+ messages in thread
From: Guillaume Zajac @ 2012-04-17 14:48 UTC (permalink / raw)
  To: ofono

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

---
 drivers/atmodem/atutil.c |    8 +++++++-
 drivers/atmodem/atutil.h |    3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c
index 0c6aab4..7c46dc5 100644
--- a/drivers/atmodem/atutil.c
+++ b/drivers/atmodem/atutil.c
@@ -45,6 +45,7 @@ struct at_util_sim_state_query {
 	guint num_times;
 	at_util_sim_inserted_cb_t cb;
 	void *userdata;
+	GDestroyNotify data_destroy;
 };
 
 static gboolean cpin_check(gpointer userdata);
@@ -574,7 +575,8 @@ static gboolean cpin_check(gpointer userdata)
 struct at_util_sim_state_query *at_util_sim_state_query_new(GAtChat *chat,
 						guint interval, guint num_times,
 						at_util_sim_inserted_cb_t cb,
-						void *userdata)
+						void *userdata,
+						GDestroyNotify data_destroy)
 {
 	struct at_util_sim_state_query *req;
 
@@ -585,6 +587,7 @@ struct at_util_sim_state_query *at_util_sim_state_query_new(GAtChat *chat,
 	req->num_times = num_times;
 	req->cb = cb;
 	req->userdata = userdata;
+	req->data_destroy = data_destroy;
 
 	cpin_check(req);
 
@@ -599,5 +602,8 @@ void at_util_sim_state_query_free(struct at_util_sim_state_query *req)
 	if (req->cpin_poll_source > 0)
 		g_source_remove(req->cpin_poll_source);
 
+	if (req->data_destroy)
+		req->data_destroy(req->userdata);
+
 	g_free(req);
 }
diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h
index 5046547..5ab9901 100644
--- a/drivers/atmodem/atutil.h
+++ b/drivers/atmodem/atutil.h
@@ -79,7 +79,8 @@ gboolean at_util_parse_attr(GAtResult *result, const char *prefix,
 struct at_util_sim_state_query *at_util_sim_state_query_new(GAtChat *chat,
 						guint interval, guint num_times,
 						at_util_sim_inserted_cb_t cb,
-						void *userdata);
+						void *userdata,
+						GDestroyNotify data_destroy);
 void at_util_sim_state_query_free(struct at_util_sim_state_query *req);
 
 struct cb_data {
-- 
1.7.4.1


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

* [PATCH 2/2] plugins: Update new at_util_sim_state_query_new() prototype use
  2012-04-17 14:48 [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac
  2012-04-17 14:48 ` [PATCH 1/2] atutil: Add destroyer in at_util_sim_state_query_new prototype Guillaume Zajac
@ 2012-04-17 14:48 ` Guillaume Zajac
  2012-04-18 10:06 ` [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac
  2 siblings, 0 replies; 4+ messages in thread
From: Guillaume Zajac @ 2012-04-17 14:48 UTC (permalink / raw)
  To: ofono

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

---
 plugins/alcatel.c |    3 ++-
 plugins/mbm.c     |    2 +-
 plugins/samsung.c |    3 ++-
 plugins/speedup.c |    3 ++-
 plugins/zte.c     |    3 ++-
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/plugins/alcatel.c b/plugins/alcatel.c
index fd0e4ec..8005170 100644
--- a/plugins/alcatel.c
+++ b/plugins/alcatel.c
@@ -157,7 +157,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 	}
 
 	data->sim_state_query = at_util_sim_state_query_new(data->aux,
-						2, 20, sim_state_cb, modem);
+						2, 20, sim_state_cb, modem,
+						NULL);
 }
 
 static int alcatel_enable(struct ofono_modem *modem)
diff --git a/plugins/mbm.c b/plugins/mbm.c
index 32c7665..035f87e 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -164,7 +164,7 @@ done:
 	data->sim_state_query = at_util_sim_state_query_new(data->modem_port,
 								1, 5,
 								sim_state_cb,
-								modem);
+								modem, NULL);
 }
 
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
diff --git a/plugins/samsung.c b/plugins/samsung.c
index 8e0d360..68a9b0a 100644
--- a/plugins/samsung.c
+++ b/plugins/samsung.c
@@ -142,7 +142,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 	}
 
 	data->sim_state_query = at_util_sim_state_query_new(data->chat,
-						1, 5, sim_state_cb, modem);
+						1, 5, sim_state_cb, modem,
+						NULL);
 }
 
 static int samsung_enable(struct ofono_modem *modem)
diff --git a/plugins/speedup.c b/plugins/speedup.c
index ca6ed13..ca33f48 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -174,7 +174,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 	}
 
 	data->sim_state_query = at_util_sim_state_query_new(data->aux,
-						2, 20, sim_state_cb, modem);
+						2, 20, sim_state_cb, modem,
+						NULL);
 }
 
 static int speedup_enable(struct ofono_modem *modem)
diff --git a/plugins/zte.c b/plugins/zte.c
index 3a83c8b..53beefe 100644
--- a/plugins/zte.c
+++ b/plugins/zte.c
@@ -218,7 +218,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 	}
 
 	data->sim_state_query = at_util_sim_state_query_new(data->aux,
-						2, 20, sim_state_cb, modem);
+						2, 20, sim_state_cb, modem,
+						NULL);
 }
 
 static int zte_enable(struct ofono_modem *modem)
-- 
1.7.4.1


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

* Re: [PATCH 0/2] Tweak at_util_sim_state_query_new() function
  2012-04-17 14:48 [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac
  2012-04-17 14:48 ` [PATCH 1/2] atutil: Add destroyer in at_util_sim_state_query_new prototype Guillaume Zajac
  2012-04-17 14:48 ` [PATCH 2/2] plugins: Update new at_util_sim_state_query_new() prototype use Guillaume Zajac
@ 2012-04-18 10:06 ` Guillaume Zajac
  2 siblings, 0 replies; 4+ messages in thread
From: Guillaume Zajac @ 2012-04-18 10:06 UTC (permalink / raw)
  To: ofono

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

Hi,

On 17/04/2012 16:48, Guillaume Zajac wrote:
> Hi all,
>
> First patch improves at_util_sim_state_query_new() function.
> A user data destroyer can be now specifed.
> Second is just updating the plugins that are using this function.
>
> Kind regards,
> Guillaume
>
> Guillaume Zajac (2):
>    atutil: Add destroyer in at_util_sim_state_query_new prototype
>    plugins: Update new at_util_sim_state_query_new() prototype use
>
>   drivers/atmodem/atutil.c |    8 +++++++-
>   drivers/atmodem/atutil.h |    3 ++-
>   plugins/alcatel.c        |    3 ++-
>   plugins/mbm.c            |    2 +-
>   plugins/samsung.c        |    3 ++-
>   plugins/speedup.c        |    3 ++-
>   plugins/zte.c            |    3 ++-
>   7 files changed, 18 insertions(+), 7 deletions(-)
>

I need to integrate these patches with SIM polling patch to be more clear.
I will send a new version.

Kind regards,
Guillaume

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

end of thread, other threads:[~2012-04-18 10:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 14:48 [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac
2012-04-17 14:48 ` [PATCH 1/2] atutil: Add destroyer in at_util_sim_state_query_new prototype Guillaume Zajac
2012-04-17 14:48 ` [PATCH 2/2] plugins: Update new at_util_sim_state_query_new() prototype use Guillaume Zajac
2012-04-18 10:06 ` [PATCH 0/2] Tweak at_util_sim_state_query_new() function Guillaume Zajac

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.