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

« back to all changes in this revision

Viewing changes to src/sim.c

  • Committer: Kalle Valo
  • Date: 2010-11-08 09:54:19 UTC
  • mfrom: (2738.1.1165)
  • Revision ID: kalle.valo@canonical.com-20101108095419-3u5fy1msw22i8ubt
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1290
1290
        if (!ok)
1291
1291
                goto out;
1292
1292
 
1293
 
        if (file_status == SIM_FILE_STATUS_VALID)
 
1293
        if (file_status & SIM_FILE_STATUS_VALID)
1294
1294
                sim_bdn_enabled(sim);
1295
1295
 
1296
1296
out:
1327
1327
        if (!ok)
1328
1328
                goto out;
1329
1329
 
1330
 
        if (file_status != SIM_FILE_STATUS_VALID)
 
1330
        if (!(file_status & SIM_FILE_STATUS_VALID))
1331
1331
                sim_fdn_enabled(sim);
1332
1332
 
1333
1333
out:
1381
1381
                                int record_length, void *userdata)
1382
1382
{
1383
1383
        struct ofono_sim *sim = userdata;
 
1384
        gboolean available;
1384
1385
 
1385
1386
        if (!ok)
1386
1387
                goto out;
1398
1399
         * (TS 31.102, Section 5.3.2: FDN capability request).
1399
1400
         * If FDN is activated, don't continue initialization routine.
1400
1401
         */
1401
 
        if (sim_est_is_active(sim->efest, sim->efest_length,
1402
 
                                SIM_EST_SERVICE_FDN))
 
1402
        available = sim_ust_is_available(sim->efust, sim->efust_length,
 
1403
                                                SIM_UST_SERVICE_FDN);
 
1404
        if (available && sim_est_is_active(sim->efest, sim->efest_length,
 
1405
                                                SIM_EST_SERVICE_FDN))
1403
1406
                sim_fdn_enabled(sim);
1404
1407
 
1405
1408
        /*
1407
1410
         * (TS 31.102, Section 5.3.2: BDN capability request).
1408
1411
         * If BDN service is enabled, halt the USIM initialization.
1409
1412
         */
1410
 
        if (sim_est_is_active(sim->efest, sim->efest_length,
1411
 
                                SIM_EST_SERVICE_BDN))
 
1413
        available = sim_ust_is_available(sim->efust, sim->efust_length,
 
1414
                                                SIM_UST_SERVICE_BDN);
 
1415
        if (available && sim_est_is_active(sim->efest, sim->efest_length,
 
1416
                                                SIM_EST_SERVICE_BDN))
1412
1417
                sim_bdn_enabled(sim);
1413
1418
 
1414
1419
out:
1434
1439
        sim->efust = g_memdup(data, length);
1435
1440
        sim->efust_length = length;
1436
1441
 
1437
 
        ofono_sim_read(sim, SIM_EFEST_FILEID,
1438
 
                        OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
1439
 
                        sim_efest_read_cb, sim);
 
1442
        /*
 
1443
         * Check whether the SIM provides EFest file
 
1444
         * According to 31.102, section 4.2.24 and 4.2.44 the EFest file
 
1445
         * must be present if EFfdn or EFbdn are present
 
1446
         */
 
1447
        if (sim_ust_is_available(sim->efust, sim->efust_length,
 
1448
                                SIM_UST_SERVICE_ENABLED_SERVICE_TABLE)) {
 
1449
                ofono_sim_read(sim, SIM_EFEST_FILEID,
 
1450
                                OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
 
1451
                                sim_efest_read_cb, sim);
1440
1452
 
1441
 
        return;
 
1453
                return;
 
1454
        }
1442
1455
 
1443
1456
out:
1444
1457
        sim_retrieve_imsi(sim);