Merge lp:~rsalveti/phablet-extras/ofono_data_state_tracking into lp:phablet-extras/ofono

Proposed by Ricardo Salveti
Status: Merged
Approved by: Tony Espy
Approved revision: 53
Merged at revision: 50
Proposed branch: lp:~rsalveti/phablet-extras/ofono_data_state_tracking
Merge into: lp:phablet-extras/ofono
Diff against target: 71 lines (+37/-1)
2 files modified
debian/changelog (+7/-0)
drivers/rilmodem/gprs.c (+30/-1)
To merge this branch: bzr merge lp:~rsalveti/phablet-extras/ofono_data_state_tracking
Reviewer Review Type Date Requested Status
Tony Espy Approve
PS Jenkins bot continuous-integration Approve
Dave Morley (community) tested on maguro device Approve
Review via email: mp+177505@code.launchpad.net

Commit message

rilmodem/gprs.c: adding back state tracking for data network (only when ofono is already attached)

Description of the change

rilmodem/gprs.c: adding back state tracking for data network (only when ofono is already attached)

Adding back some of the logic that was removed when you fixed the roaming bug, as we need to track the data network status anyway (e.g when we get disconnected or when we start roaming).

To avoid a loop when notifying ofono, we only care to check different states if ofono_attached is true (which means we need to tell ofono if something changed). If the device is roaming, ofono_attached will be set to false at the second run, breaking the previous infinite loop logic.

Tested with maguro and I can always get attached, right after boot.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Pitt (pitti) wrote :

I installed the .debs on my nexus4, and confirm that I can still successfully make phone calls, as well as that the "ofonod and rild eating CPU" problem did not come back.

Revision history for this message
Dave Morley (davmor2) wrote :

Okay found the debs in the output file. I've installed them, I've reboot and I have a connection. The rild/ofono cpu high percentage issue now seems to be gone. I've disconnected and reconnected several times and they all seemed to of functioned correctly.

review: Approve (tested on maguro device)
52. By Ricardo Salveti

rilmodem/gprs.c fixing coding style

53. By Ricardo Salveti

releasing version 1.12phablet11

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tony Espy (awe) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-07-26 19:35:06 +0000
+++ debian/changelog 2013-07-30 16:00:00 +0000
@@ -1,3 +1,10 @@
1ofono (1.12phablet11) saucy; urgency=low
2
3 * drivers/rilmodem/gprs.c: adding data network state tracking back, but
4 handling it better to avoid the roaming bug
5
6 -- Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Tue, 30 Jul 2013 12:54:37 -0300
7
1ofono (1.12phablet10) saucy; urgency=low8ofono (1.12phablet10) saucy; urgency=low
29
3 * [rilmodem] Fixed disable GPRS bug (LP:1204644).10 * [rilmodem] Fixed disable GPRS bug (LP:1204644).
411
=== modified file 'drivers/rilmodem/gprs.c'
--- drivers/rilmodem/gprs.c 2013-07-27 22:51:04 +0000
+++ drivers/rilmodem/gprs.c 2013-07-30 16:00:00 +0000
@@ -67,6 +67,25 @@
67 int rild_status;67 int rild_status;
68};68};
6969
70static void ril_gprs_registration_status(struct ofono_gprs *gprs,
71 ofono_gprs_status_cb_t cb,
72 void *data);
73
74static void ril_gprs_state_change(struct ril_msg *message, gpointer user_data)
75{
76 struct ofono_gprs *gprs = user_data;
77 struct gprs_data *gd = ofono_gprs_get_data(gprs);
78
79 g_assert(message->req == RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED);
80
81 /*
82 * We are just want to track network data status change if ofono
83 * itself is attached, so we avoid unnecessary data state requests.
84 */
85 if (gd->ofono_attached == TRUE)
86 ril_gprs_registration_status(gprs, NULL, NULL);
87}
88
70static void ril_gprs_set_pref_network_cb(struct ril_msg *message,89static void ril_gprs_set_pref_network_cb(struct ril_msg *message,
71 gpointer user_data)90 gpointer user_data)
72{91{
@@ -164,15 +183,25 @@
164 goto error;183 goto error;
165 }184 }
166185
167 if (gd->rild_status == -1)186 if (gd->rild_status == -1) {
168 ofono_gprs_register(gprs);187 ofono_gprs_register(gprs);
169188
189 /* RILD tracks data network state together with voice */
190 g_ril_register(gd->ril, RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED,
191 ril_gprs_state_change, gprs);
192 }
193
170 if (max_cids > gd->max_cids) {194 if (max_cids > gd->max_cids) {
171 DBG("Setting max cids to %d", max_cids);195 DBG("Setting max cids to %d", max_cids);
172 gd->max_cids = max_cids;196 gd->max_cids = max_cids;
173 ofono_gprs_set_cid_range(gprs, 1, max_cids);197 ofono_gprs_set_cid_range(gprs, 1, max_cids);
174 }198 }
175199
200 /* Just need to notify ofono if it's already attached */
201 if (gd->ofono_attached && (gd->rild_status != status)) {
202 ofono_gprs_status_notify(gprs, status);
203 }
204
176 gd->rild_status = status;205 gd->rild_status = status;
177206
178 /*207 /*

Subscribers

People subscribed via source and target branches