Crash in network-registration.c/creg_notify() when receiving unsolicited +CREG: 0

2010-08-10 Thread Berthier, Emmanuel
Hi, I use ofono 0.25 and encounter a segmentation fault when trying to put the modem OffLine (flight mode). The AT command sent to modem is: AT+CFUN=4 The modem replies with: OK +CREG=0 Then, in creg_notify(), the user_data points to uninitialized (deallocated?)

RE: Crash in network-registration.c/creg_notify() when receiving unsolicited +CREG: 0

2010-08-10 Thread Zhang, Zhenhua
Hi Emmanuel, Berthier, Emmanuel wrote: Hi, I use ofono 0.25 and encounter a segmentation fault when trying to put the modem OffLine (flight mode). The AT command sent to modem is: AT+CFUN=4 The modem replies with: OK +CREG=0 Then, in creg_notify(),

[PATCH 1/2] huawei: poll sim state

2010-08-10 Thread Kalle Valo
On my Huawei E1552 when I plug in the modem (ie. cold start) with PIN locked SIM, the sim state is 255 (HUAWEI_SIM_STATE_NOT_EXISTENT). As the modem doesn't send ^SIMST notifications, poll the sim state until it's ready. In theory it might be possible to do this better, for example follow ^BOOT

[PATCH 2/2] huawei: postpone post_sim until SIM is ready

2010-08-10 Thread Kalle Valo
On my Huawei E1552 with PIN locked SIM sim_state is 0 when calling huawei_post_sim() and gprs context is not registered. This is because ^SIMST notification is received only after huawei_post_sim() is called: Aug 10 12:38:33 tukki ofonod[6565]: plugins/huawei.c:huawei_post_sim() 0x6cdb50 [...]

[PATCH 02/10] gprs: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing gprs driver. --- drivers/atmodem/gprs.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c index bf82d06..dcf9759 100644 --- a/drivers/atmodem/gprs.c +++ b/drivers/atmodem/gprs.c

[PATCH 04/10] cbs: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing cbs driver. --- drivers/atmodem/cbs.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/atmodem/cbs.c b/drivers/atmodem/cbs.c index a1c4037..ef312e9 100644 --- a/drivers/atmodem/cbs.c +++ b/drivers/atmodem/cbs.c @@

[PATCH 05/10] ussd: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Add struct ussd_data to hold gatchat and cusd_id. So that we could unregister AT notifications in driver removing phase. --- drivers/atmodem/ussd.c | 33 ++--- 1 files changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/atmodem/ussd.c

[PATCH 07/10] stk: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing stk driver. --- drivers/atmodem/stk.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/atmodem/stk.c b/drivers/atmodem/stk.c index d6c19da..de687f8 100644 --- a/drivers/atmodem/stk.c +++ b/drivers/atmodem/stk.c @@

[PATCH 08/10] sms: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing sms driver. --- drivers/atmodem/sms.c | 31 +-- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c index ba98c12..335f456 100644 --- a/drivers/atmodem/sms.c +++

[PATCH 09/10] call-meter: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing call-meter at modem driver. --- drivers/atmodem/call-meter.c | 55 - 1 files changed, 37 insertions(+), 18 deletions(-) diff --git a/drivers/atmodem/call-meter.c b/drivers/atmodem/call-meter.c index 38774d4..f36ff3c

[PATCH 10/10] voicecall: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing voicecall driver. --- drivers/atmodem/voicecall.c | 40 +++- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c index fce9144..16b3069 100644 ---

[PATCH 03/10] netreg: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing network registeration driver. --- drivers/atmodem/network-registration.c | 49 --- 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/drivers/atmodem/network-registration.c

[PATCH 06/10] ssn: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing ssn driver. --- drivers/atmodem/ssn.c | 30 ++ 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/atmodem/ssn.c b/drivers/atmodem/ssn.c index f219cde..ce8f1e0 100644 --- a/drivers/atmodem/ssn.c +++

[PATCH 00/16] Implement DUN server for oFono

2010-08-10 Thread Zhenhua Zhang
Hi, These patches are based my 6 patches sent on Aug 5th. It implements DUN server logic to manage GPRS context create/destroy per DUN client requests. On DUN client side, you can use 'rfcomm bind 0 xx:xx:xx:xx:xx:xx 1' and then 'gsmdial -n /dev/rfcomm0 -c 1 -a cid -l' to test it. Review

[PATCH 02/16] emulator: Add status watches for ofono emulator

2010-08-10 Thread Zhenhua Zhang
The status watches monitor the emulator activities. Other atoms like gprs, netreg could register notification to watch emulator status changes. --- include/emulator.h |6 + src/emulator.c | 60 src/ofono.h| 11 +

[PATCH 06/16] gprs: Make gprs_proto_to/from_string non-static

2010-08-10 Thread Zhenhua Zhang
So DUN server could share gprs_proto_to_string and gprs_proto_from_string. --- include/gprs-context.h |3 +++ src/gprs.c |5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/gprs-context.h b/include/gprs-context.h index f4c7321..de170b8 100644 ---

[PATCH 09/16] gprs: Add DUN +CGATT support in gprs atom

2010-08-10 Thread Zhenhua Zhang
DUN client may request to attach/deattach GPRS network. Use gprs_netreg_update to set attach/deattach status. --- src/gprs.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index f91d0dc..5d850df 100644 --- a/src/gprs.c +++

[PATCH 11/16] gprs: Add DUN +CGDCONT support in gprs atom

2010-08-10 Thread Zhenhua Zhang
DUN client may request to create a new context. Call ofono_gprs_create_context to create it. --- src/gprs.c | 53 + 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 7e85d39..2313f52 100644 ---

[PATCH 12/16] gprs: Add DUN server GPRS connect support

2010-08-10 Thread Zhenhua Zhang
Implement dial up networking in GPRS atom. --- src/gprs.c | 232 +++- 1 files changed, 229 insertions(+), 3 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 2313f52..95f7ab2 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -49,6 +49,10

[PATCH 15/16] emulator: Watch GPRS status changes

2010-08-10 Thread Zhenhua Zhang
Watch GPRS status update to notify DUN client, such as +CGREG unsolicited result. --- src/emulator.c | 94 1 files changed, 94 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index 8811f6c..c8f3d65 100644 ---

[PATCH 13/16] gprs: Add status watch functions

2010-08-10 Thread Zhenhua Zhang
So DUN server could watch GPRS status changes and notify client unsolicited results like +CGREG. --- include/gprs.h |9 + src/gprs.c | 55 +++ 2 files changed, 64 insertions(+), 0 deletions(-) diff --git a/include/gprs.h

[PATCH 14/16] gprs: Add gprs_get_status

2010-08-10 Thread Zhenhua Zhang
So that DUN server could get latest GPRS status. --- include/gprs.h |2 ++ src/gprs.c |8 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/gprs.h b/include/gprs.h index c0a0e2f..ca23c45 100644 --- a/include/gprs.h +++ b/include/gprs.h @@ -76,6 +76,8 @@

[PATCH 16/16] emulator: Watch netreg status changes

2010-08-10 Thread Zhenhua Zhang
Watch netreg status update to notify DUN client, such as +CREG unsolicited result. --- src/emulator.c | 106 1 files changed, 106 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index c8f3d65..56edab6 100644 ---

Re: [PATCH v3 2/2] huawei: add gprs context

2010-08-10 Thread Inaky Perez-Gonzalez
On Fri, 2010-08-06 at 10:26 +0300, Kalle Valo wrote: Inaky Perez-Gonzalez in...@linux.intel.com writes: Hi Kale Hola, On Thu, 2010-08-05 at 08:54 +0300, Kalle Valo wrote: This is my setup: ; from linux/Documentation/CodingStyle (defun c-lineup-arglist-tabs-only (ignored)