Merge lp:~phablet-team/ofono/lp1598181 into lp:~phablet-team/ofono/ubuntu
- lp1598181
- Merge into ubuntu
Proposed by
Alfonso Sanchez-Beato
Status: | Merged |
---|---|
Approved by: | Tony Espy |
Approved revision: | 6924 |
Merged at revision: | 6920 |
Proposed branch: | lp:~phablet-team/ofono/lp1598181 |
Merge into: | lp:~phablet-team/ofono/ubuntu |
Diff against target: |
683 lines (+226/-266) 9 files modified
debian/changelog (+6/-0) drivers/isimodem/voicecall.c (+1/-1) drivers/rilmodem/network-registration.c (+13/-13) gril/grilreply.c (+2/-9) plugins/nokia-gpio.c (+2/-7) unit/test-rilmodem-cb.c (+63/-63) unit/test-rilmodem-cs.c (+61/-61) unit/test-rilmodem-sms.c (+78/-78) unit/test-stkutil.c (+0/-34) |
To merge this branch: | bzr merge lp:~phablet-team/ofono/lp1598181 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tony Espy | Approve | ||
Konrad Zapałowicz (community) | code | Approve | |
Review via email: mp+303369@code.launchpad.net |
Commit message
Description of the change
Fix network name parsing for turbo (LP: #1598181)
To post a comment you must log in.
lp:~phablet-team/ofono/lp1598181
updated
- 6921. By Alfonso Sanchez-Beato
-
Fix unit test
- 6922. By Alfonso Sanchez-Beato
-
Fix compilation with gcc 6
- 6923. By Alfonso Sanchez-Beato
-
Fix glibc 2.23.9+ issues
- 6924. By Alfonso Sanchez-Beato
-
Fix gcc 6.0 compilation on big endian archs
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2016-07-19 15:39:18 +0000 | |||
3 | +++ debian/changelog 2016-08-19 11:05:27 +0000 | |||
4 | @@ -1,3 +1,9 @@ | |||
5 | 1 | ofono (1.17.bzr6921+16.10.20160819.1-0ubuntu1) UNRELEASED; urgency=medium | ||
6 | 2 | |||
7 | 3 | * Fix network name parsing for turbo (LP: #1598181) | ||
8 | 4 | |||
9 | 5 | -- Alfonso Sanchez-Beato (email Canonical) <alfonso.sanchez-beato@canonical.com> Fri, 19 Aug 2016 08:46:21 +0200 | ||
10 | 6 | |||
11 | 1 | ofono (1.17.bzr6919+16.10.20160719.1-0ubuntu1) yakkety; urgency=medium | 7 | ofono (1.17.bzr6919+16.10.20160719.1-0ubuntu1) yakkety; urgency=medium |
12 | 2 | 8 | ||
13 | 3 | [ Alfonso Sanchez-Beato ] | 9 | [ Alfonso Sanchez-Beato ] |
14 | 4 | 10 | ||
15 | === modified file 'drivers/isimodem/voicecall.c' | |||
16 | --- drivers/isimodem/voicecall.c 2012-09-12 04:30:25 +0000 | |||
17 | +++ drivers/isimodem/voicecall.c 2016-08-19 11:05:27 +0000 | |||
18 | @@ -1715,7 +1715,7 @@ | |||
19 | 1715 | 1715 | ||
20 | 1716 | if ((status->mode_info & CALL_MODE_ORIGINATOR)) | 1716 | if ((status->mode_info & CALL_MODE_ORIGINATOR)) |
21 | 1717 | cause = CALL_CAUSE_BUSY_USER_REQUEST; | 1717 | cause = CALL_CAUSE_BUSY_USER_REQUEST; |
23 | 1718 | break; | 1718 | break; |
24 | 1719 | } | 1719 | } |
25 | 1720 | 1720 | ||
26 | 1721 | isi_call_release_req(ovc, id, CALL_CAUSE_TYPE_CLIENT, cause, cb, data); | 1721 | isi_call_release_req(ovc, id, CALL_CAUSE_TYPE_CLIENT, cause, cb, data); |
27 | 1722 | 1722 | ||
28 | === modified file 'drivers/rilmodem/network-registration.c' | |||
29 | --- drivers/rilmodem/network-registration.c 2016-06-15 14:10:26 +0000 | |||
30 | +++ drivers/rilmodem/network-registration.c 2016-08-19 11:05:27 +0000 | |||
31 | @@ -201,26 +201,26 @@ | |||
32 | 201 | static void set_oper_name(const struct reply_operator *reply, | 201 | static void set_oper_name(const struct reply_operator *reply, |
33 | 202 | struct ofono_network_operator *op) | 202 | struct ofono_network_operator *op) |
34 | 203 | { | 203 | { |
36 | 204 | const char *spn = NULL; | 204 | if (reply->lalpha != NULL && |
37 | 205 | g_strcmp0(reply->numeric, reply->lalpha) != 0) { | ||
38 | 206 | strncpy(op->name, reply->lalpha, | ||
39 | 207 | OFONO_MAX_OPERATOR_NAME_LENGTH); | ||
40 | 208 | } else if (reply->salpha != NULL && | ||
41 | 209 | g_strcmp0(reply->numeric, reply->salpha) != 0) { | ||
42 | 210 | strncpy(op->name, reply->salpha, | ||
43 | 211 | OFONO_MAX_OPERATOR_NAME_LENGTH); | ||
44 | 212 | } else { | ||
45 | 213 | const char *spn = NULL; | ||
46 | 205 | 214 | ||
47 | 206 | /* Use SPN list if we do not have name */ | ||
48 | 207 | if (strcmp(reply->numeric, reply->lalpha) == 0) { | ||
49 | 208 | spn = __ofono_spn_table_get_spn(reply->numeric); | 215 | spn = __ofono_spn_table_get_spn(reply->numeric); |
50 | 209 | if (spn != NULL) { | 216 | if (spn != NULL) { |
51 | 210 | DBG("using spn override %s", spn); | 217 | DBG("using spn override %s", spn); |
52 | 211 | strncpy(op->name, spn, OFONO_MAX_OPERATOR_NAME_LENGTH); | 218 | strncpy(op->name, spn, OFONO_MAX_OPERATOR_NAME_LENGTH); |
53 | 219 | } else { | ||
54 | 220 | strncpy(op->name, reply->numeric, | ||
55 | 221 | OFONO_MAX_OPERATOR_NAME_LENGTH); | ||
56 | 212 | } | 222 | } |
57 | 213 | } | 223 | } |
58 | 214 | |||
59 | 215 | if (spn == NULL) { | ||
60 | 216 | /* Try to use long by default */ | ||
61 | 217 | if (reply->lalpha) | ||
62 | 218 | strncpy(op->name, reply->lalpha, | ||
63 | 219 | OFONO_MAX_OPERATOR_NAME_LENGTH); | ||
64 | 220 | else if (reply->salpha) | ||
65 | 221 | strncpy(op->name, reply->salpha, | ||
66 | 222 | OFONO_MAX_OPERATOR_NAME_LENGTH); | ||
67 | 223 | } | ||
68 | 224 | } | 224 | } |
69 | 225 | 225 | ||
70 | 226 | static void ril_cops_cb(struct ril_msg *message, gpointer user_data) | 226 | static void ril_cops_cb(struct ril_msg *message, gpointer user_data) |
71 | 227 | 227 | ||
72 | === modified file 'gril/grilreply.c' | |||
73 | --- gril/grilreply.c 2016-07-19 15:08:32 +0000 | |||
74 | +++ gril/grilreply.c 2016-08-19 11:05:27 +0000 | |||
75 | @@ -248,14 +248,6 @@ | |||
76 | 248 | reply->salpha = parcel_r_string(&rilp); | 248 | reply->salpha = parcel_r_string(&rilp); |
77 | 249 | reply->numeric = parcel_r_string(&rilp); | 249 | reply->numeric = parcel_r_string(&rilp); |
78 | 250 | 250 | ||
79 | 251 | if (reply->lalpha == NULL && reply->salpha == NULL) { | ||
80 | 252 | ofono_error("%s: invalid OPERATOR reply: " | ||
81 | 253 | " no names returned.", | ||
82 | 254 | __func__); | ||
83 | 255 | |||
84 | 256 | goto error; | ||
85 | 257 | } | ||
86 | 258 | |||
87 | 259 | if (reply->numeric == NULL) { | 251 | if (reply->numeric == NULL) { |
88 | 260 | ofono_error("%s: invalid OPERATOR reply: " | 252 | ofono_error("%s: invalid OPERATOR reply: " |
89 | 261 | " no numeric returned.", | 253 | " no numeric returned.", |
90 | @@ -265,7 +257,8 @@ | |||
91 | 265 | 257 | ||
92 | 266 | g_ril_append_print_buf(gril, | 258 | g_ril_append_print_buf(gril, |
93 | 267 | "(lalpha=%s, salpha=%s, numeric=%s)", | 259 | "(lalpha=%s, salpha=%s, numeric=%s)", |
95 | 268 | reply->lalpha, reply->salpha, reply->numeric); | 260 | PRINTABLE_STR(reply->lalpha), |
96 | 261 | PRINTABLE_STR(reply->salpha), reply->numeric); | ||
97 | 269 | 262 | ||
98 | 270 | g_ril_print_response(gril, message); | 263 | g_ril_print_response(gril, message); |
99 | 271 | 264 | ||
100 | 272 | 265 | ||
101 | === modified file 'plugins/nokia-gpio.c' | |||
102 | --- plugins/nokia-gpio.c 2011-05-11 18:29:33 +0000 | |||
103 | +++ plugins/nokia-gpio.c 2016-08-19 11:05:27 +0000 | |||
104 | @@ -635,7 +635,7 @@ | |||
105 | 635 | char const *gpiodir = "/sys/class/gpio"; | 635 | char const *gpiodir = "/sys/class/gpio"; |
106 | 636 | char const *cmtdir = "/dev/cmt"; | 636 | char const *cmtdir = "/dev/cmt"; |
107 | 637 | DIR *gpio; | 637 | DIR *gpio; |
109 | 638 | struct dirent *d, entry[1]; | 638 | struct dirent *d; |
110 | 639 | 639 | ||
111 | 640 | if (file_exists(cmtdir)) { | 640 | if (file_exists(cmtdir)) { |
112 | 641 | DBG("Using %s", cmtdir); | 641 | DBG("Using %s", cmtdir); |
113 | @@ -657,16 +657,11 @@ | |||
114 | 657 | return -(errno = ENODEV); | 657 | return -(errno = ENODEV); |
115 | 658 | } | 658 | } |
116 | 659 | 659 | ||
118 | 660 | while (readdir_r(gpio, entry, &d) == 0) { | 660 | while ((d = readdir(gpio)) != NULL) { |
119 | 661 | char nn[PATH_MAX], name[PATH_MAX], from[PATH_MAX], to[PATH_MAX]; | 661 | char nn[PATH_MAX], name[PATH_MAX], from[PATH_MAX], to[PATH_MAX]; |
120 | 662 | FILE *nf; | 662 | FILE *nf; |
121 | 663 | size_t len; | 663 | size_t len; |
122 | 664 | 664 | ||
123 | 665 | if (d == NULL) { | ||
124 | 666 | (void) closedir(gpio); | ||
125 | 667 | return 0; | ||
126 | 668 | } | ||
127 | 669 | |||
128 | 670 | snprintf(nn, sizeof nn, "%s/%s/name", gpiodir, d->d_name); | 665 | snprintf(nn, sizeof nn, "%s/%s/name", gpiodir, d->d_name); |
129 | 671 | 666 | ||
130 | 672 | nf = fopen(nn, "rb"); | 667 | nf = fopen(nn, "rb"); |
131 | 673 | 668 | ||
132 | === modified file 'unit/test-rilmodem-cb.c' | |||
133 | --- unit/test-rilmodem-cb.c 2016-03-10 10:48:53 +0000 | |||
134 | +++ unit/test-rilmodem-cb.c 2016-08-19 11:05:27 +0000 | |||
135 | @@ -42,10 +42,6 @@ | |||
136 | 42 | #include "ril_constants.h" | 42 | #include "ril_constants.h" |
137 | 43 | #include "rilmodem-test-server.h" | 43 | #include "rilmodem-test-server.h" |
138 | 44 | 44 | ||
139 | 45 | static GMainLoop *mainloop; | ||
140 | 46 | |||
141 | 47 | static const struct ofono_call_barring_driver *cbdriver; | ||
142 | 48 | |||
143 | 49 | struct rilmodem_cb_data { | 45 | struct rilmodem_cb_data { |
144 | 50 | GRil *ril; | 46 | GRil *ril; |
145 | 51 | struct ofono_modem *modem; | 47 | struct ofono_modem *modem; |
146 | @@ -71,6 +67,68 @@ | |||
147 | 71 | int status; | 67 | int status; |
148 | 72 | }; | 68 | }; |
149 | 73 | 69 | ||
150 | 70 | static const struct ofono_call_barring_driver *cbdriver; | ||
151 | 71 | |||
152 | 72 | /* Declarations && Re-implementations of core functions. */ | ||
153 | 73 | void ril_call_barring_exit(void); | ||
154 | 74 | void ril_call_barring_init(void); | ||
155 | 75 | |||
156 | 76 | struct ofono_call_barring { | ||
157 | 77 | void *driver_data; | ||
158 | 78 | const struct cb_data *cbd; | ||
159 | 79 | }; | ||
160 | 80 | |||
161 | 81 | struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem, | ||
162 | 82 | unsigned int vendor, | ||
163 | 83 | const char *driver, | ||
164 | 84 | void *data) | ||
165 | 85 | { | ||
166 | 86 | struct rilmodem_cb_data *rsd = data; | ||
167 | 87 | struct ofono_call_barring *cb = g_new0(struct ofono_call_barring, 1); | ||
168 | 88 | int retval; | ||
169 | 89 | |||
170 | 90 | retval = cbdriver->probe(cb, OFONO_RIL_VENDOR_AOSP, rsd->ril); | ||
171 | 91 | g_assert(retval == 0); | ||
172 | 92 | |||
173 | 93 | return cb; | ||
174 | 94 | } | ||
175 | 95 | |||
176 | 96 | int ofono_call_barring_driver_register(const struct ofono_call_barring_driver *d) | ||
177 | 97 | { | ||
178 | 98 | if (cbdriver == NULL) | ||
179 | 99 | cbdriver = d; | ||
180 | 100 | |||
181 | 101 | return 0; | ||
182 | 102 | } | ||
183 | 103 | |||
184 | 104 | void ofono_call_barring_set_data(struct ofono_call_barring *cb, void *data) | ||
185 | 105 | { | ||
186 | 106 | cb->driver_data = data; | ||
187 | 107 | } | ||
188 | 108 | |||
189 | 109 | void *ofono_call_barring_get_data(struct ofono_call_barring *cb) | ||
190 | 110 | { | ||
191 | 111 | return cb->driver_data; | ||
192 | 112 | } | ||
193 | 113 | |||
194 | 114 | void ofono_call_barring_register(struct ofono_call_barring *cb) | ||
195 | 115 | { | ||
196 | 116 | } | ||
197 | 117 | |||
198 | 118 | void ofono_call_barring_driver_unregister(const struct ofono_call_barring_driver *d) | ||
199 | 119 | { | ||
200 | 120 | } | ||
201 | 121 | |||
202 | 122 | /* | ||
203 | 123 | * As all our architectures are little-endian except for | ||
204 | 124 | * PowerPC, and the Binder wire-format differs slightly | ||
205 | 125 | * depending on endian-ness, the following guards against test | ||
206 | 126 | * failures when run on PowerPC. | ||
207 | 127 | */ | ||
208 | 128 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
209 | 129 | |||
210 | 130 | static GMainLoop *mainloop; | ||
211 | 131 | |||
212 | 74 | static void query_callback(const struct ofono_error *error, int status, | 132 | static void query_callback(const struct ofono_error *error, int status, |
213 | 75 | gpointer data) | 133 | gpointer data) |
214 | 76 | { | 134 | { |
215 | @@ -434,64 +492,6 @@ | |||
216 | 434 | .error_type = OFONO_ERROR_TYPE_FAILURE, | 492 | .error_type = OFONO_ERROR_TYPE_FAILURE, |
217 | 435 | }; | 493 | }; |
218 | 436 | 494 | ||
219 | 437 | /* Declarations && Re-implementations of core functions. */ | ||
220 | 438 | void ril_call_barring_exit(void); | ||
221 | 439 | void ril_call_barring_init(void); | ||
222 | 440 | |||
223 | 441 | struct ofono_call_barring { | ||
224 | 442 | void *driver_data; | ||
225 | 443 | const struct cb_data *cbd; | ||
226 | 444 | }; | ||
227 | 445 | |||
228 | 446 | struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem, | ||
229 | 447 | unsigned int vendor, | ||
230 | 448 | const char *driver, | ||
231 | 449 | void *data) | ||
232 | 450 | { | ||
233 | 451 | struct rilmodem_cb_data *rsd = data; | ||
234 | 452 | struct ofono_call_barring *cb = g_new0(struct ofono_call_barring, 1); | ||
235 | 453 | int retval; | ||
236 | 454 | |||
237 | 455 | retval = cbdriver->probe(cb, OFONO_RIL_VENDOR_AOSP, rsd->ril); | ||
238 | 456 | g_assert(retval == 0); | ||
239 | 457 | |||
240 | 458 | return cb; | ||
241 | 459 | } | ||
242 | 460 | |||
243 | 461 | int ofono_call_barring_driver_register(const struct ofono_call_barring_driver *d) | ||
244 | 462 | { | ||
245 | 463 | if (cbdriver == NULL) | ||
246 | 464 | cbdriver = d; | ||
247 | 465 | |||
248 | 466 | return 0; | ||
249 | 467 | } | ||
250 | 468 | |||
251 | 469 | void ofono_call_barring_set_data(struct ofono_call_barring *cb, void *data) | ||
252 | 470 | { | ||
253 | 471 | cb->driver_data = data; | ||
254 | 472 | } | ||
255 | 473 | |||
256 | 474 | void *ofono_call_barring_get_data(struct ofono_call_barring *cb) | ||
257 | 475 | { | ||
258 | 476 | return cb->driver_data; | ||
259 | 477 | } | ||
260 | 478 | |||
261 | 479 | void ofono_call_barring_register(struct ofono_call_barring *cb) | ||
262 | 480 | { | ||
263 | 481 | } | ||
264 | 482 | |||
265 | 483 | void ofono_call_barring_driver_unregister(const struct ofono_call_barring_driver *d) | ||
266 | 484 | { | ||
267 | 485 | } | ||
268 | 486 | |||
269 | 487 | /* | ||
270 | 488 | * As all our architectures are little-endian except for | ||
271 | 489 | * PowerPC, and the Binder wire-format differs slightly | ||
272 | 490 | * depending on endian-ness, the following guards against test | ||
273 | 491 | * failures when run on PowerPC. | ||
274 | 492 | */ | ||
275 | 493 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
276 | 494 | |||
277 | 495 | static void server_connect_cb(gpointer data) | 495 | static void server_connect_cb(gpointer data) |
278 | 496 | { | 496 | { |
279 | 497 | struct rilmodem_cb_data *rsd = data; | 497 | struct rilmodem_cb_data *rsd = data; |
280 | @@ -577,7 +577,7 @@ | |||
281 | 577 | &testdata_query_invalid_3, | 577 | &testdata_query_invalid_3, |
282 | 578 | test_call_barring_func); | 578 | test_call_barring_func); |
283 | 579 | g_test_add_data_func("/testrilmodemcallbarring/query/invalid/4", | 579 | g_test_add_data_func("/testrilmodemcallbarring/query/invalid/4", |
285 | 580 | &testdata_query_invalid_3, | 580 | &testdata_query_invalid_4, |
286 | 581 | test_call_barring_func); | 581 | test_call_barring_func); |
287 | 582 | g_test_add_data_func("/testrilmodemcallbarring/set/valid/1", | 582 | g_test_add_data_func("/testrilmodemcallbarring/set/valid/1", |
288 | 583 | &testdata_set_valid_1, | 583 | &testdata_set_valid_1, |
289 | 584 | 584 | ||
290 | === modified file 'unit/test-rilmodem-cs.c' | |||
291 | --- unit/test-rilmodem-cs.c 2016-03-10 10:48:53 +0000 | |||
292 | +++ unit/test-rilmodem-cs.c 2016-08-19 11:05:27 +0000 | |||
293 | @@ -42,10 +42,6 @@ | |||
294 | 42 | #include "ril_constants.h" | 42 | #include "ril_constants.h" |
295 | 43 | #include "rilmodem-test-server.h" | 43 | #include "rilmodem-test-server.h" |
296 | 44 | 44 | ||
297 | 45 | static GMainLoop *mainloop; | ||
298 | 46 | |||
299 | 47 | static const struct ofono_call_settings_driver *csdriver; | ||
300 | 48 | |||
301 | 49 | struct rilmodem_cs_data { | 45 | struct rilmodem_cs_data { |
302 | 50 | GRil *ril; | 46 | GRil *ril; |
303 | 51 | struct ofono_modem *modem; | 47 | struct ofono_modem *modem; |
304 | @@ -67,6 +63,67 @@ | |||
305 | 67 | gint cb_int2; | 63 | gint cb_int2; |
306 | 68 | }; | 64 | }; |
307 | 69 | 65 | ||
308 | 66 | static const struct ofono_call_settings_driver *csdriver; | ||
309 | 67 | |||
310 | 68 | /* Declarations && Re-implementations of core functions. */ | ||
311 | 69 | void ril_call_settings_exit(void); | ||
312 | 70 | void ril_call_settings_init(void); | ||
313 | 71 | |||
314 | 72 | struct ofono_call_settings { | ||
315 | 73 | void *driver_data; | ||
316 | 74 | }; | ||
317 | 75 | |||
318 | 76 | struct ofono_call_settings *ofono_call_settings_create(struct ofono_modem *modem, | ||
319 | 77 | unsigned int vendor, | ||
320 | 78 | const char *driver, | ||
321 | 79 | void *data) | ||
322 | 80 | { | ||
323 | 81 | struct rilmodem_cs_data *rcd = data; | ||
324 | 82 | struct ofono_call_settings *cs = g_new0(struct ofono_call_settings, 1); | ||
325 | 83 | int retval; | ||
326 | 84 | |||
327 | 85 | retval = csdriver->probe(cs, OFONO_RIL_VENDOR_AOSP, rcd->ril); | ||
328 | 86 | g_assert(retval == 0); | ||
329 | 87 | |||
330 | 88 | return cs; | ||
331 | 89 | } | ||
332 | 90 | |||
333 | 91 | int ofono_call_settings_driver_register(const struct ofono_call_settings_driver *d) | ||
334 | 92 | { | ||
335 | 93 | if (csdriver == NULL) | ||
336 | 94 | csdriver = d; | ||
337 | 95 | |||
338 | 96 | return 0; | ||
339 | 97 | } | ||
340 | 98 | |||
341 | 99 | void ofono_call_settings_set_data(struct ofono_call_settings *cs, void *data) | ||
342 | 100 | { | ||
343 | 101 | cs->driver_data = data; | ||
344 | 102 | } | ||
345 | 103 | |||
346 | 104 | void *ofono_call_settings_get_data(struct ofono_call_settings *cs) | ||
347 | 105 | { | ||
348 | 106 | return cs->driver_data; | ||
349 | 107 | } | ||
350 | 108 | |||
351 | 109 | void ofono_call_settings_register(struct ofono_call_settings *cs) | ||
352 | 110 | { | ||
353 | 111 | } | ||
354 | 112 | |||
355 | 113 | void ofono_call_settings_driver_unregister(const struct ofono_call_settings_driver *d) | ||
356 | 114 | { | ||
357 | 115 | } | ||
358 | 116 | |||
359 | 117 | /* | ||
360 | 118 | * As all our architectures are little-endian except for | ||
361 | 119 | * PowerPC, and the Binder wire-format differs slightly | ||
362 | 120 | * depending on endian-ness, the following guards against test | ||
363 | 121 | * failures when run on PowerPC. | ||
364 | 122 | */ | ||
365 | 123 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
366 | 124 | |||
367 | 125 | static GMainLoop *mainloop; | ||
368 | 126 | |||
369 | 70 | static void status_query_callback(const struct ofono_error *error, int status, | 127 | static void status_query_callback(const struct ofono_error *error, int status, |
370 | 71 | gpointer data) | 128 | gpointer data) |
371 | 72 | { | 129 | { |
372 | @@ -387,63 +444,6 @@ | |||
373 | 387 | .error_type = OFONO_ERROR_TYPE_FAILURE, | 444 | .error_type = OFONO_ERROR_TYPE_FAILURE, |
374 | 388 | }; | 445 | }; |
375 | 389 | 446 | ||
376 | 390 | /* Declarations && Re-implementations of core functions. */ | ||
377 | 391 | void ril_call_settings_exit(void); | ||
378 | 392 | void ril_call_settings_init(void); | ||
379 | 393 | |||
380 | 394 | struct ofono_call_settings { | ||
381 | 395 | void *driver_data; | ||
382 | 396 | }; | ||
383 | 397 | |||
384 | 398 | struct ofono_call_settings *ofono_call_settings_create(struct ofono_modem *modem, | ||
385 | 399 | unsigned int vendor, | ||
386 | 400 | const char *driver, | ||
387 | 401 | void *data) | ||
388 | 402 | { | ||
389 | 403 | struct rilmodem_cs_data *rcd = data; | ||
390 | 404 | struct ofono_call_settings *cs = g_new0(struct ofono_call_settings, 1); | ||
391 | 405 | int retval; | ||
392 | 406 | |||
393 | 407 | retval = csdriver->probe(cs, OFONO_RIL_VENDOR_AOSP, rcd->ril); | ||
394 | 408 | g_assert(retval == 0); | ||
395 | 409 | |||
396 | 410 | return cs; | ||
397 | 411 | } | ||
398 | 412 | |||
399 | 413 | int ofono_call_settings_driver_register(const struct ofono_call_settings_driver *d) | ||
400 | 414 | { | ||
401 | 415 | if (csdriver == NULL) | ||
402 | 416 | csdriver = d; | ||
403 | 417 | |||
404 | 418 | return 0; | ||
405 | 419 | } | ||
406 | 420 | |||
407 | 421 | void ofono_call_settings_set_data(struct ofono_call_settings *cs, void *data) | ||
408 | 422 | { | ||
409 | 423 | cs->driver_data = data; | ||
410 | 424 | } | ||
411 | 425 | |||
412 | 426 | void *ofono_call_settings_get_data(struct ofono_call_settings *cs) | ||
413 | 427 | { | ||
414 | 428 | return cs->driver_data; | ||
415 | 429 | } | ||
416 | 430 | |||
417 | 431 | void ofono_call_settings_register(struct ofono_call_settings *cs) | ||
418 | 432 | { | ||
419 | 433 | } | ||
420 | 434 | |||
421 | 435 | void ofono_call_settings_driver_unregister(const struct ofono_call_settings_driver *d) | ||
422 | 436 | { | ||
423 | 437 | } | ||
424 | 438 | |||
425 | 439 | /* | ||
426 | 440 | * As all our architectures are little-endian except for | ||
427 | 441 | * PowerPC, and the Binder wire-format differs slightly | ||
428 | 442 | * depending on endian-ness, the following guards against test | ||
429 | 443 | * failures when run on PowerPC. | ||
430 | 444 | */ | ||
431 | 445 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
432 | 446 | |||
433 | 447 | static void server_connect_cb(gpointer data) | 447 | static void server_connect_cb(gpointer data) |
434 | 448 | { | 448 | { |
435 | 449 | struct rilmodem_cs_data *rcd = data; | 449 | struct rilmodem_cs_data *rcd = data; |
436 | 450 | 450 | ||
437 | === modified file 'unit/test-rilmodem-sms.c' | |||
438 | --- unit/test-rilmodem-sms.c 2016-03-10 10:48:53 +0000 | |||
439 | +++ unit/test-rilmodem-sms.c 2016-08-19 11:05:27 +0000 | |||
440 | @@ -42,10 +42,6 @@ | |||
441 | 42 | #include "ril_constants.h" | 42 | #include "ril_constants.h" |
442 | 43 | #include "rilmodem-test-server.h" | 43 | #include "rilmodem-test-server.h" |
443 | 44 | 44 | ||
444 | 45 | static GMainLoop *mainloop; | ||
445 | 46 | |||
446 | 47 | static const struct ofono_sms_driver *smsdriver; | ||
447 | 48 | |||
448 | 49 | struct rilmodem_sms_data { | 45 | struct rilmodem_sms_data { |
449 | 50 | GRil *ril; | 46 | GRil *ril; |
450 | 51 | struct ofono_modem *modem; | 47 | struct ofono_modem *modem; |
451 | @@ -71,6 +67,84 @@ | |||
452 | 71 | gint mr; | 67 | gint mr; |
453 | 72 | }; | 68 | }; |
454 | 73 | 69 | ||
455 | 70 | static GMainLoop *mainloop; | ||
456 | 71 | |||
457 | 72 | static const struct ofono_sms_driver *smsdriver; | ||
458 | 73 | |||
459 | 74 | /* Declarations && Re-implementations of core functions. */ | ||
460 | 75 | void ril_sms_exit(void); | ||
461 | 76 | void ril_sms_init(void); | ||
462 | 77 | |||
463 | 78 | struct ofono_sms { | ||
464 | 79 | void *driver_data; | ||
465 | 80 | const struct sms_data *sd; | ||
466 | 81 | }; | ||
467 | 82 | |||
468 | 83 | struct ofono_sms *ofono_sms_create(struct ofono_modem *modem, | ||
469 | 84 | unsigned int vendor, | ||
470 | 85 | const char *driver, | ||
471 | 86 | void *data) | ||
472 | 87 | { | ||
473 | 88 | struct rilmodem_sms_data *rsd = data; | ||
474 | 89 | struct ofono_sms *sms = g_new0(struct ofono_sms, 1); | ||
475 | 90 | int retval; | ||
476 | 91 | |||
477 | 92 | retval = smsdriver->probe(sms, OFONO_RIL_VENDOR_AOSP, rsd->ril); | ||
478 | 93 | g_assert(retval == 0); | ||
479 | 94 | |||
480 | 95 | return sms; | ||
481 | 96 | } | ||
482 | 97 | |||
483 | 98 | int ofono_sms_driver_register(const struct ofono_sms_driver *d) | ||
484 | 99 | { | ||
485 | 100 | if (smsdriver == NULL) | ||
486 | 101 | smsdriver = d; | ||
487 | 102 | |||
488 | 103 | return 0; | ||
489 | 104 | } | ||
490 | 105 | |||
491 | 106 | void ofono_sms_set_data(struct ofono_sms *sms, void *data) | ||
492 | 107 | { | ||
493 | 108 | sms->driver_data = data; | ||
494 | 109 | } | ||
495 | 110 | |||
496 | 111 | void *ofono_sms_get_data(struct ofono_sms *sms) | ||
497 | 112 | { | ||
498 | 113 | return sms->driver_data; | ||
499 | 114 | } | ||
500 | 115 | |||
501 | 116 | void ofono_sms_register(struct ofono_sms *sms) | ||
502 | 117 | { | ||
503 | 118 | } | ||
504 | 119 | |||
505 | 120 | void ofono_sms_driver_unregister(const struct ofono_sms_driver *d) | ||
506 | 121 | { | ||
507 | 122 | } | ||
508 | 123 | |||
509 | 124 | void ofono_sms_deliver_notify(struct ofono_sms *sms, const unsigned char *pdu, | ||
510 | 125 | int len, int tpdu_len) | ||
511 | 126 | { | ||
512 | 127 | g_assert(sms->sd->pdu_len == len); | ||
513 | 128 | g_assert(sms->sd->tpdu_len == tpdu_len); | ||
514 | 129 | g_assert(!memcmp(pdu, sms->sd->pdu, len)); | ||
515 | 130 | |||
516 | 131 | g_main_loop_quit(mainloop); | ||
517 | 132 | } | ||
518 | 133 | |||
519 | 134 | void ofono_sms_status_notify(struct ofono_sms *sms, const unsigned char *pdu, | ||
520 | 135 | int len, int tpdu_len) | ||
521 | 136 | { | ||
522 | 137 | ofono_sms_deliver_notify(sms, pdu, len, tpdu_len); | ||
523 | 138 | } | ||
524 | 139 | |||
525 | 140 | /* | ||
526 | 141 | * As all our architectures are little-endian except for | ||
527 | 142 | * PowerPC, and the Binder wire-format differs slightly | ||
528 | 143 | * depending on endian-ness, the following guards against test | ||
529 | 144 | * failures when run on PowerPC. | ||
530 | 145 | */ | ||
531 | 146 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
532 | 147 | |||
533 | 74 | static void sca_query_callback(const struct ofono_error *error, | 148 | static void sca_query_callback(const struct ofono_error *error, |
534 | 75 | const struct ofono_phone_number *ph, | 149 | const struct ofono_phone_number *ph, |
535 | 76 | gpointer data) | 150 | gpointer data) |
536 | @@ -414,80 +488,6 @@ | |||
537 | 414 | .tpdu_len = 28, | 488 | .tpdu_len = 28, |
538 | 415 | }; | 489 | }; |
539 | 416 | 490 | ||
540 | 417 | /* Declarations && Re-implementations of core functions. */ | ||
541 | 418 | void ril_sms_exit(void); | ||
542 | 419 | void ril_sms_init(void); | ||
543 | 420 | |||
544 | 421 | struct ofono_sms { | ||
545 | 422 | void *driver_data; | ||
546 | 423 | const struct sms_data *sd; | ||
547 | 424 | }; | ||
548 | 425 | |||
549 | 426 | struct ofono_sms *ofono_sms_create(struct ofono_modem *modem, | ||
550 | 427 | unsigned int vendor, | ||
551 | 428 | const char *driver, | ||
552 | 429 | void *data) | ||
553 | 430 | { | ||
554 | 431 | struct rilmodem_sms_data *rsd = data; | ||
555 | 432 | struct ofono_sms *sms = g_new0(struct ofono_sms, 1); | ||
556 | 433 | int retval; | ||
557 | 434 | |||
558 | 435 | retval = smsdriver->probe(sms, OFONO_RIL_VENDOR_AOSP, rsd->ril); | ||
559 | 436 | g_assert(retval == 0); | ||
560 | 437 | |||
561 | 438 | return sms; | ||
562 | 439 | } | ||
563 | 440 | |||
564 | 441 | int ofono_sms_driver_register(const struct ofono_sms_driver *d) | ||
565 | 442 | { | ||
566 | 443 | if (smsdriver == NULL) | ||
567 | 444 | smsdriver = d; | ||
568 | 445 | |||
569 | 446 | return 0; | ||
570 | 447 | } | ||
571 | 448 | |||
572 | 449 | void ofono_sms_set_data(struct ofono_sms *sms, void *data) | ||
573 | 450 | { | ||
574 | 451 | sms->driver_data = data; | ||
575 | 452 | } | ||
576 | 453 | |||
577 | 454 | void *ofono_sms_get_data(struct ofono_sms *sms) | ||
578 | 455 | { | ||
579 | 456 | return sms->driver_data; | ||
580 | 457 | } | ||
581 | 458 | |||
582 | 459 | void ofono_sms_register(struct ofono_sms *sms) | ||
583 | 460 | { | ||
584 | 461 | } | ||
585 | 462 | |||
586 | 463 | void ofono_sms_driver_unregister(const struct ofono_sms_driver *d) | ||
587 | 464 | { | ||
588 | 465 | } | ||
589 | 466 | |||
590 | 467 | void ofono_sms_deliver_notify(struct ofono_sms *sms, const unsigned char *pdu, | ||
591 | 468 | int len, int tpdu_len) | ||
592 | 469 | { | ||
593 | 470 | g_assert(sms->sd->pdu_len == len); | ||
594 | 471 | g_assert(sms->sd->tpdu_len == tpdu_len); | ||
595 | 472 | g_assert(!memcmp(pdu, sms->sd->pdu, len)); | ||
596 | 473 | |||
597 | 474 | g_main_loop_quit(mainloop); | ||
598 | 475 | } | ||
599 | 476 | |||
600 | 477 | void ofono_sms_status_notify(struct ofono_sms *sms, const unsigned char *pdu, | ||
601 | 478 | int len, int tpdu_len) | ||
602 | 479 | { | ||
603 | 480 | ofono_sms_deliver_notify(sms, pdu, len, tpdu_len); | ||
604 | 481 | } | ||
605 | 482 | |||
606 | 483 | /* | ||
607 | 484 | * As all our architectures are little-endian except for | ||
608 | 485 | * PowerPC, and the Binder wire-format differs slightly | ||
609 | 486 | * depending on endian-ness, the following guards against test | ||
610 | 487 | * failures when run on PowerPC. | ||
611 | 488 | */ | ||
612 | 489 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
613 | 490 | |||
614 | 491 | static void server_connect_cb(gpointer data) | 491 | static void server_connect_cb(gpointer data) |
615 | 492 | { | 492 | { |
616 | 493 | struct rilmodem_sms_data *rsd = data; | 493 | struct rilmodem_sms_data *rsd = data; |
617 | 494 | 494 | ||
618 | === modified file 'unit/test-stkutil.c' | |||
619 | --- unit/test-stkutil.c 2012-11-02 19:17:17 +0000 | |||
620 | +++ unit/test-stkutil.c 2016-08-19 11:05:27 +0000 | |||
621 | @@ -16867,13 +16867,7 @@ | |||
622 | 16867 | }, | 16867 | }, |
623 | 16868 | }; | 16868 | }; |
624 | 16869 | 16869 | ||
625 | 16870 | static const unsigned char get_input_response_191b[] = { | ||
626 | 16871 | 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82, | ||
627 | 16872 | 0x81, 0x83, 0x01, 0x00, 0x8d, 0x00, | ||
628 | 16873 | }; | ||
629 | 16874 | |||
630 | 16875 | static const struct terminal_response_test get_input_response_data_191 = { | 16870 | static const struct terminal_response_test get_input_response_data_191 = { |
631 | 16876 | /* Either get_input_response_191a or get_input_response_191b is ok */ | ||
632 | 16877 | .pdu = get_input_response_191a, | 16871 | .pdu = get_input_response_191a, |
633 | 16878 | .pdu_len = sizeof(get_input_response_191a), | 16872 | .pdu_len = sizeof(get_input_response_191a), |
634 | 16879 | .response = { | 16873 | .response = { |
635 | @@ -17349,11 +17343,6 @@ | |||
636 | 17349 | 0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x00, 0x01, | 17343 | 0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x00, 0x01, |
637 | 17350 | }; | 17344 | }; |
638 | 17351 | 17345 | ||
639 | 17352 | static const unsigned char poll_interval_response_111b[] = { | ||
640 | 17353 | 0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x82, | ||
641 | 17354 | 0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x01, 0x3c, | ||
642 | 17355 | }; | ||
643 | 17356 | |||
644 | 17357 | static const struct terminal_response_test poll_interval_response_data_111a = { | 17346 | static const struct terminal_response_test poll_interval_response_data_111a = { |
645 | 17358 | /* Either poll_interval_response_111a or b is ok */ | 17347 | /* Either poll_interval_response_111a or b is ok */ |
646 | 17359 | .pdu = poll_interval_response_111a, | 17348 | .pdu = poll_interval_response_111a, |
647 | @@ -17476,26 +17465,6 @@ | |||
648 | 17476 | }, | 17465 | }, |
649 | 17477 | }; | 17466 | }; |
650 | 17478 | 17467 | ||
651 | 17479 | static const unsigned char refresh_response_131b[] = { | ||
652 | 17480 | 0x81, 0x03, 0x01, 0x01, 0x02, 0x82, 0x02, 0x82, | ||
653 | 17481 | 0x81, 0x83, 0x01, 0x03, | ||
654 | 17482 | }; | ||
655 | 17483 | |||
656 | 17484 | static const struct terminal_response_test refresh_response_data_131b = { | ||
657 | 17485 | .pdu = refresh_response_131b, | ||
658 | 17486 | .pdu_len = sizeof(refresh_response_131b), | ||
659 | 17487 | .response = { | ||
660 | 17488 | .number = 1, | ||
661 | 17489 | .type = STK_COMMAND_TYPE_REFRESH, | ||
662 | 17490 | .qualifier = 0x02, /* USIM Initialization & File Change */ | ||
663 | 17491 | .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL, | ||
664 | 17492 | .dst = STK_DEVICE_IDENTITY_TYPE_UICC, | ||
665 | 17493 | .result = { | ||
666 | 17494 | .type = STK_RESULT_TYPE_REFRESH_WITH_EFS, | ||
667 | 17495 | }, | ||
668 | 17496 | }, | ||
669 | 17497 | }; | ||
670 | 17498 | |||
671 | 17499 | static const unsigned char refresh_response_141a[] = { | 17468 | static const unsigned char refresh_response_141a[] = { |
672 | 17500 | 0x81, 0x03, 0x01, 0x01, 0x00, 0x82, 0x02, 0x82, | 17469 | 0x81, 0x03, 0x01, 0x01, 0x00, 0x82, 0x02, 0x82, |
673 | 17501 | 0x81, 0x83, 0x01, 0x00, | 17470 | 0x81, 0x83, 0x01, 0x00, |
674 | @@ -18338,9 +18307,6 @@ | |||
675 | 18338 | 0x06, 0x45, 0x91, 0xa4, 0x90, | 18307 | 0x06, 0x45, 0x91, 0xa4, 0x90, |
676 | 18339 | }; | 18308 | }; |
677 | 18340 | 18309 | ||
678 | 18341 | static const short bcch_channels_131[] = { | ||
679 | 18342 | }; | ||
680 | 18343 | |||
681 | 18344 | static const struct terminal_response_test | 18310 | static const struct terminal_response_test |
682 | 18345 | provide_local_info_response_data_131 = { | 18311 | provide_local_info_response_data_131 = { |
683 | 18346 | .pdu = provide_local_info_response_131, | 18312 | .pdu = provide_local_info_response_131, |
LGTM