huawei: Create sim atom for cdma modems
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Wed, 11 Jan 2012 16:28:34 +0000 (17:28 +0100)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 11 Jan 2012 12:46:38 +0000 (06:46 -0600)
Don't create atom if sim is embedded.
Atom will use "atmodem-noef" drivers to support PIN management
and IMSI retrieval.

plugins/huawei.c

index d57e795..e4deb76 100644 (file)
@@ -758,6 +758,18 @@ static void huawei_pre_sim(struct ofono_modem *modem)
                        ofono_sim_inserted_notify(sim, TRUE);
        } else if (data->have_cdma == TRUE) {
                ofono_devinfo_create(modem, 0, "cdmamodem", data->pcui);
+
+               /* Create SIM atom only if SIM is not embedded */
+               if (data->sim_state != SIM_STATE_ROMSIM) {
+                       struct ofono_sim *sim;
+
+                       /* Use sim drivers without Elementary File entries */
+                       sim = ofono_sim_create(modem, OFONO_VENDOR_HUAWEI,
+                                               "atmodem-noef", data->pcui);
+
+                       if (sim && data->have_sim == TRUE)
+                               ofono_sim_inserted_notify(sim, TRUE);
+               }
        }
 }