All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] emulator: force creation of atom at modem offline state
@ 2011-02-17 17:23 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-02-17 17:26 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-02-17 17:23 UTC (permalink / raw)
  To: ofono

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

this allows to fix problem when atom created in online state
are destroyed when modem goes to offline state
---
 src/emulator.c |    3 ++-
 src/modem.c    |   14 ++++++++++++++
 src/ofono.h    |    5 +++++
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index 5744903..101b33d 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -115,7 +115,8 @@ struct ofono_emulator *ofono_emulator_create(struct ofono_modem *modem,
 
 	em->type = type;
 
-	em->atom = __ofono_modem_add_atom(modem, atom_t, emulator_remove, em);
+	em->atom = __ofono_modem_add_atom_offline(modem, atom_t,
+							emulator_remove, em);
 
 	return em;
 }
diff --git a/src/modem.c b/src/modem.c
index 8567cac..bf8b0c0 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -189,6 +189,20 @@ struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,
 	return atom;
 }
 
+struct ofono_atom *__ofono_modem_add_atom_offline(struct ofono_modem *modem,
+					enum ofono_atom_type type,
+					void (*destruct)(struct ofono_atom *),
+					void *data)
+{
+	struct ofono_atom *atom;
+
+	atom = __ofono_modem_add_atom(modem, type, destruct, data);
+
+	atom->modem_state = MODEM_STATE_OFFLINE;
+
+	return atom;
+}
+
 void *__ofono_atom_get_data(struct ofono_atom *atom)
 {
 	return atom->data;
diff --git a/src/ofono.h b/src/ofono.h
index f52356e..9d13684 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -148,6 +148,11 @@ struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,
 					void (*destruct)(struct ofono_atom *),
 					void *data);
 
+struct ofono_atom *__ofono_modem_add_atom_offline(struct ofono_modem *modem,
+					enum ofono_atom_type type,
+					void (*destruct)(struct ofono_atom *),
+					void *data);
+
 struct ofono_atom *__ofono_modem_find_atom(struct ofono_modem *modem,
 						enum ofono_atom_type type);
 
-- 
1.7.1


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

* Re: [PATCH] emulator: force creation of atom at modem offline state
  2011-02-17 17:23 [PATCH] emulator: force creation of atom at modem offline state =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-02-17 17:26 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-02-17 17:26 UTC (permalink / raw)
  To: ofono

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

Hi Frédéric,

On 02/17/2011 11:23 AM, Frédéric Danis wrote:
> this allows to fix problem when atom created in online state
> are destroyed when modem goes to offline state
> ---
>  src/emulator.c |    3 ++-
>  src/modem.c    |   14 ++++++++++++++
>  src/ofono.h    |    5 +++++
>  3 files changed, 21 insertions(+), 1 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-02-17 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 17:23 [PATCH] emulator: force creation of atom at modem offline state =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-02-17 17: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.