diff options
author | Denis Kenzior <denkenz@gmail.com> | 2011-02-18 11:19:27 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-02-18 11:28:43 -0600 |
commit | 5d626b696785d2171bb22a8ff355510062e59c9d (patch) | |
tree | 416798ffeeac5e449a5f736209c2336a9ca3de4b /src/sim.c | |
parent | 5c84a23515a1ac2ee053e3bbce45312aecf6afd4 (diff) | |
download | ofono-5d626b696785d2171bb22a8ff355510062e59c9d.tar.bz2 |
sim: move stuff around
Diffstat (limited to 'src/sim.c')
-rw-r--r-- | src/sim.c | 98 |
1 files changed, 49 insertions, 49 deletions
@@ -1641,55 +1641,6 @@ static void sim_initialize_after_pin(struct ofono_sim *sim) sim_cphs_information_read_cb, sim); } -static void sim_pin_query_cb(const struct ofono_error *error, - enum ofono_sim_password_type pin_type, - void *data) -{ - struct ofono_sim *sim = data; - DBusConnection *conn = ofono_dbus_get_connection(); - const char *path = __ofono_atom_get_path(sim->atom); - const char *pin_name; - - if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { - ofono_error("Querying PIN authentication state failed"); - - goto checkdone; - } - - if (sim->pin_type != pin_type) { - sim->pin_type = pin_type; - pin_name = sim_passwd_name(pin_type); - - if (pin_type != OFONO_SIM_PASSWORD_NONE && - password_is_pin(pin_type) == FALSE) - pin_type = puk2pin(pin_type); - - if (pin_type != OFONO_SIM_PASSWORD_INVALID) - sim->locked_pins[pin_type] = TRUE; - - ofono_dbus_signal_property_changed(conn, path, - OFONO_SIM_MANAGER_INTERFACE, - "PinRequired", DBUS_TYPE_STRING, - &pin_name); - } - - sim_pin_retries_check(sim); - -checkdone: - if (pin_type == OFONO_SIM_PASSWORD_NONE) - sim_initialize_after_pin(sim); -} - -static void sim_pin_check(struct ofono_sim *sim) -{ - if (sim->driver->query_passwd_state == NULL) { - sim_initialize_after_pin(sim); - return; - } - - sim->driver->query_passwd_state(sim, sim_pin_query_cb, sim); -} - static void sim_efli_read_cb(int ok, int length, int record, const unsigned char *data, int record_length, void *userdata) @@ -2249,6 +2200,55 @@ static void sim_set_ready(struct ofono_sim *sim) } } +static void sim_pin_query_cb(const struct ofono_error *error, + enum ofono_sim_password_type pin_type, + void *data) +{ + struct ofono_sim *sim = data; + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = __ofono_atom_get_path(sim->atom); + const char *pin_name; + + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { + ofono_error("Querying PIN authentication state failed"); + + goto checkdone; + } + + if (sim->pin_type != pin_type) { + sim->pin_type = pin_type; + pin_name = sim_passwd_name(pin_type); + + if (pin_type != OFONO_SIM_PASSWORD_NONE && + password_is_pin(pin_type) == FALSE) + pin_type = puk2pin(pin_type); + + if (pin_type != OFONO_SIM_PASSWORD_INVALID) + sim->locked_pins[pin_type] = TRUE; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_SIM_MANAGER_INTERFACE, + "PinRequired", DBUS_TYPE_STRING, + &pin_name); + } + + sim_pin_retries_check(sim); + +checkdone: + if (pin_type == OFONO_SIM_PASSWORD_NONE) + sim_initialize_after_pin(sim); +} + +static void sim_pin_check(struct ofono_sim *sim) +{ + if (sim->driver->query_passwd_state == NULL) { + sim_initialize_after_pin(sim); + return; + } + + sim->driver->query_passwd_state(sim, sim_pin_query_cb, sim); +} + int ofono_sim_driver_register(const struct ofono_sim_driver *d) { DBG("driver: %p, name: %s", d, d->name); |