~indicator-network-developers/ofono/trunk.packaging

« back to all changes in this revision

Viewing changes to drivers/atmodem/network-registration.c

  • Committer: Kalle Valo
  • Date: 2011-02-21 07:46:07 UTC
  • mfrom: (2738.1.2125)
  • Revision ID: kalle.valo@canonical.com-20110221074607-u4rocuj2p75kpht9
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
        struct netreg_data *nd = ofono_netreg_get_data(netreg);
187
187
        struct cb_data *cbd = cb_data_new(cb, data);
188
188
 
189
 
        if (cbd == NULL)
190
 
                goto error;
191
 
 
192
189
        cbd->user = nd;
193
190
 
194
191
        switch (nd->vendor) {
232
229
                                at_creg_cb, cbd, g_free) > 0)
233
230
                return;
234
231
 
235
 
error:
236
232
        g_free(cbd);
237
233
 
238
234
        CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, data);
361
357
        struct cb_data *cbd = cb_data_new(cb, data);
362
358
        gboolean ok;
363
359
 
364
 
        if (cbd == NULL)
365
 
                goto error;
366
 
 
367
360
        cbd->user = netreg;
368
361
 
369
362
        /* Nokia modems have a broken return value for the string
388
381
        if (ok)
389
382
                return;
390
383
 
391
 
error:
392
384
        g_free(cbd);
393
385
 
394
386
        CALLBACK_WITH_FAILURE(cb, NULL, data);
503
495
        struct netreg_data *nd = ofono_netreg_get_data(netreg);
504
496
        struct cb_data *cbd = cb_data_new(cb, data);
505
497
 
506
 
        if (cbd == NULL)
507
 
                goto error;
508
 
 
509
498
        if (g_at_chat_send(nd->chat, "AT+COPS=?", cops_prefix,
510
499
                                cops_list_cb, cbd, g_free) > 0)
511
500
                return;
512
501
 
513
 
error:
514
502
        g_free(cbd);
515
503
 
516
504
        CALLBACK_WITH_FAILURE(cb, 0, NULL, data);
533
521
        struct netreg_data *nd = ofono_netreg_get_data(netreg);
534
522
        struct cb_data *cbd = cb_data_new(cb, data);
535
523
 
536
 
        if (cbd == NULL)
537
 
                goto error;
538
 
 
539
524
        if (g_at_chat_send(nd->chat, "AT+COPS=0", none_prefix,
540
525
                                register_cb, cbd, g_free) > 0)
541
526
                return;
542
527
 
543
 
error:
544
528
        g_free(cbd);
545
529
 
546
530
        CALLBACK_WITH_FAILURE(cb, data);
554
538
        struct cb_data *cbd = cb_data_new(cb, data);
555
539
        char buf[128];
556
540
 
557
 
        if (cbd == NULL)
558
 
                goto error;
559
 
 
560
541
        snprintf(buf, sizeof(buf), "AT+COPS=1,2,\"%s%s\"", mcc, mnc);
561
542
 
562
543
        if (g_at_chat_send(nd->chat, buf, none_prefix,
563
544
                                register_cb, cbd, g_free) > 0)
564
545
                return;
565
546
 
566
 
error:
567
547
        g_free(cbd);
568
548
 
569
549
        CALLBACK_WITH_FAILURE(cb, data);
858
838
        struct netreg_data *nd = ofono_netreg_get_data(netreg);
859
839
        struct cb_data *cbd = cb_data_new(cb, data);
860
840
 
861
 
        if (cbd == NULL)
862
 
                goto error;
863
 
 
864
841
        cbd->user = nd;
865
842
 
866
843
        /*
877
854
                        return;
878
855
        }
879
856
 
880
 
error:
881
857
        g_free(cbd);
882
858
 
883
859
        CALLBACK_WITH_FAILURE(cb, -1, data);