* [PATCH 2/9] common: implement initializer for ofono_call
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 3/9] atmodem: use ofono_call initializer Lucas De Marchi
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
---
src/common.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/common.c b/src/common.c
index 8bf9dbb..f25f105 100644
--- a/src/common.c
+++ b/src/common.c
@@ -762,3 +762,10 @@ const char *ofono_uuid_to_str(const struct ofono_uuid *uuid)
return encode_hex_own_buf(uuid->uuid, OFONO_SHA1_UUID_LEN, 0, buf);
}
+
+void ofono_call_init(struct ofono_call *call)
+{
+ memset(call, 0, sizeof(struct ofono_call));
+ call->cnap_validity = CNAP_VALIDITY_NOT_AVAILABLE;
+ call->clip_validity = CLIP_VALIDITY_NOT_AVAILABLE;
+}
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/9] atmodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
2011-02-01 17:12 ` [PATCH 2/9] common: implement " Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 4/9] calypsomodem: " Lucas De Marchi
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]
---
drivers/atmodem/atutil.c | 4 +++-
drivers/atmodem/voicecall.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c
index a55b3f5..01f5460 100644
--- a/drivers/atmodem/atutil.c
+++ b/drivers/atmodem/atutil.c
@@ -132,10 +132,12 @@ GSList *at_util_parse_clcc(GAtResult *result)
if (g_at_result_iter_next_string(&iter, &str))
g_at_result_iter_next_number(&iter, &number_type);
- call = g_try_new0(struct ofono_call, 1);
+ call = g_try_new(struct ofono_call, 1);
if (call == NULL)
break;
+ ofono_call_init(call);
+
call->id = id;
call->direction = dir;
call->status = status;
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index a64269d..583e037 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -112,10 +112,12 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
struct ofono_call *call;
/* Generate a call structure for the waiting call */
- call = g_try_new0(struct ofono_call, 1);
+ call = g_try_new(struct ofono_call, 1);
if (call == NULL)
return NULL;
+ ofono_call_init(call);
+
call->id = ofono_voicecall_get_next_callid(vc);
call->type = type;
call->direction = direction;
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/9] calypsomodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
2011-02-01 17:12 ` [PATCH 2/9] common: implement " Lucas De Marchi
2011-02-01 17:12 ` [PATCH 3/9] atmodem: use ofono_call initializer Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 5/9] hfpmodem: " Lucas De Marchi
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
---
drivers/calypsomodem/voicecall.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/calypsomodem/voicecall.c b/drivers/calypsomodem/voicecall.c
index 01be990..fed442c 100644
--- a/drivers/calypsomodem/voicecall.c
+++ b/drivers/calypsomodem/voicecall.c
@@ -314,7 +314,7 @@ static void cpi_notify(GAtResult *result, gpointer user_data)
g_at_chat_send(vd->chat, "AT%N0187", none_prefix,
NULL, NULL, NULL);
- memset(&call, 0, sizeof(call));
+ ofono_call_init(&call);
switch (msgtype) {
case 0:
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/9] hfpmodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
` (2 preceding siblings ...)
2011-02-01 17:12 ` [PATCH 4/9] calypsomodem: " Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 6/9] huaweimodem: " Lucas De Marchi
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
---
drivers/hfpmodem/voicecall.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index b9bee62..a87ddbe 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -96,10 +96,12 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
struct ofono_call *call;
/* Generate a call structure for the waiting call */
- call = g_try_new0(struct ofono_call, 1);
+ call = g_try_new(struct ofono_call, 1);
if (call == NULL)
return NULL;
+ ofono_call_init(call);
+
call->id = ofono_voicecall_get_next_callid(vc);
call->type = type;
call->direction = direction;
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/9] huaweimodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
` (3 preceding siblings ...)
2011-02-01 17:12 ` [PATCH 5/9] hfpmodem: " Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 7/9] ifxmodem: " Lucas De Marchi
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
---
drivers/huaweimodem/voicecall.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/huaweimodem/voicecall.c b/drivers/huaweimodem/voicecall.c
index a30513a..53377d9 100644
--- a/drivers/huaweimodem/voicecall.c
+++ b/drivers/huaweimodem/voicecall.c
@@ -56,10 +56,12 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
struct ofono_call *call;
/* Generate a call structure for the waiting call */
- call = g_try_new0(struct ofono_call, 1);
+ call = g_try_new(struct ofono_call, 1);
if (call == NULL)
return NULL;
+ ofono_call_init(call);
+
call->id = id;
call->type = type;
call->direction = direction;
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/9] ifxmodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
` (4 preceding siblings ...)
2011-02-01 17:12 ` [PATCH 6/9] huaweimodem: " Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 8/9] isimodem: " Lucas De Marchi
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
---
drivers/ifxmodem/voicecall.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 716652c..e7f72fc 100644
--- a/drivers/ifxmodem/voicecall.c
+++ b/drivers/ifxmodem/voicecall.c
@@ -87,10 +87,12 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
struct ofono_call *call;
/* Generate a call structure for the waiting call */
- call = g_try_new0(struct ofono_call, 1);
+ call = g_try_new(struct ofono_call, 1);
if (call == NULL)
return NULL;
+ ofono_call_init(call);
+
call->id = ofono_voicecall_get_next_callid(vc);
call->type = type;
call->direction = direction;
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 8/9] isimodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
` (5 preceding siblings ...)
2011-02-01 17:12 ` [PATCH 7/9] ifxmodem: " Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:12 ` [PATCH 9/9] stemodem: " Lucas De Marchi
2011-02-01 17:32 ` [PATCH 1/9] include: define initializer for ofono_call Marcel Holtmann
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 806 bytes --]
---
drivers/isimodem/voicecall.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 6a1e582..12896f2 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -384,11 +384,11 @@ static int isi_call_status_to_clcc(const struct isi_call *call)
static struct ofono_call isi_call_as_ofono_call(const struct isi_call *call)
{
- struct ofono_call ocall = {
- call->id
- };
+ struct ofono_call ocall;
struct ofono_phone_number *number = &ocall.phone_number;
+ ofono_call_init(&ocall);
+ ocall.id = call->id;
ocall.type = 0; /* Voice call */
ocall.direction = call->mode_info & CALL_MODE_ORIGINATOR;
ocall.status = isi_call_status_to_clcc(call);
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 9/9] stemodem: use ofono_call initializer
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
` (6 preceding siblings ...)
2011-02-01 17:12 ` [PATCH 8/9] isimodem: " Lucas De Marchi
@ 2011-02-01 17:12 ` Lucas De Marchi
2011-02-01 17:32 ` [PATCH 1/9] include: define initializer for ofono_call Marcel Holtmann
8 siblings, 0 replies; 10+ messages in thread
From: Lucas De Marchi @ 2011-02-01 17:12 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 715 bytes --]
---
drivers/stemodem/voicecall.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c
index 1c7c0bd..fa078a8 100644
--- a/drivers/stemodem/voicecall.c
+++ b/drivers/stemodem/voicecall.c
@@ -108,10 +108,12 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
struct ofono_call *call;
/* Generate a call structure for the waiting call */
- call = g_try_new0(struct ofono_call, 1);
+ call = g_try_new(struct ofono_call, 1);
if (call == NULL)
return NULL;
+ ofono_call_init(call);
+
call->type = type;
call->direction = direction;
call->status = status;
--
1.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/9] include: define initializer for ofono_call
2011-02-01 17:12 [PATCH 1/9] include: define initializer for ofono_call Lucas De Marchi
` (7 preceding siblings ...)
2011-02-01 17:12 ` [PATCH 9/9] stemodem: " Lucas De Marchi
@ 2011-02-01 17:32 ` Marcel Holtmann
8 siblings, 0 replies; 10+ messages in thread
From: Marcel Holtmann @ 2011-02-01 17:32 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 401 bytes --]
Hi Lucas,
> Some fields in struct ofono_call such as cnap_validity and clip_validity
> are not correctly initialized as 0 since this means they are present. If
> driver does not implement the necessary handlers, it might send to core
> an ofono_call signalling that cnap and clip are available when they are
> actually not.
all 9 patches have been applied. Thanks.
Regards
Marcel
^ permalink raw reply [flat|nested] 10+ messages in thread