diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-08-18 17:53:04 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-08-18 17:53:04 -0500 |
commit | 84bdd03683790f50e81ec6753c3655d5fef4199f (patch) | |
tree | 335f21c9a58f8dff36a971ca47d46a1423bf2544 /src/network.c | |
parent | e7c6ba28ad17d6c5d84ae98912aa878b479d8e56 (diff) | |
download | ofono-84bdd03683790f50e81ec6753c3655d5fef4199f.tar.bz2 |
netreg: Move code around to avoid forward decl
Diffstat (limited to 'src/network.c')
-rw-r--r-- | src/network.c | 102 |
1 files changed, 49 insertions, 53 deletions
diff --git a/src/network.c b/src/network.c index ee2c2742..06351441 100644 --- a/src/network.c +++ b/src/network.c @@ -85,10 +85,6 @@ struct ofono_netreg { struct ofono_atom *atom; }; -static void current_operator_callback(const struct ofono_error *error, - const struct ofono_network_operator *current, - void *data); - static void signal_strength_callback(const struct ofono_error *error, int strength, void *data); @@ -1171,55 +1167,6 @@ static void notify_status_watches(struct ofono_netreg *netreg) } } -void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status, - int lac, int ci, int tech) -{ - if (!netreg) - return; - - if (netreg->status != status) - set_registration_status(netreg, status); - - if (netreg->location != lac) - set_registration_location(netreg, lac); - - if (netreg->cellid != ci) - set_registration_cellid(netreg, ci); - - if (netreg->technology != tech) - set_registration_technology(netreg, tech); - - if (netreg->status == NETWORK_REGISTRATION_STATUS_REGISTERED || - netreg->status == NETWORK_REGISTRATION_STATUS_ROAMING) { - if (netreg->driver->current_operator) - netreg->driver->current_operator(netreg, - current_operator_callback, netreg); - } else { - struct ofono_error error; - - error.type = OFONO_ERROR_TYPE_NO_ERROR; - error.error = 0; - - current_operator_callback(&error, NULL, netreg); - __ofono_netreg_set_base_station_name(netreg, NULL); - - netreg->signal_strength = -1; - } - - notify_status_watches(netreg); -} - -void ofono_netreg_time_notify(struct ofono_netreg *netreg, - struct ofono_network_time *info) -{ - struct ofono_modem *modem = __ofono_atom_get_modem(netreg->atom); - - if (!info) - return; - - __ofono_nettime_info_received(modem, info); -} - static void current_operator_callback(const struct ofono_error *error, const struct ofono_network_operator *current, void *data) @@ -1329,6 +1276,55 @@ emit: notify_status_watches(netreg); } +void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status, + int lac, int ci, int tech) +{ + if (!netreg) + return; + + if (netreg->status != status) + set_registration_status(netreg, status); + + if (netreg->location != lac) + set_registration_location(netreg, lac); + + if (netreg->cellid != ci) + set_registration_cellid(netreg, ci); + + if (netreg->technology != tech) + set_registration_technology(netreg, tech); + + if (netreg->status == NETWORK_REGISTRATION_STATUS_REGISTERED || + netreg->status == NETWORK_REGISTRATION_STATUS_ROAMING) { + if (netreg->driver->current_operator) + netreg->driver->current_operator(netreg, + current_operator_callback, netreg); + } else { + struct ofono_error error; + + error.type = OFONO_ERROR_TYPE_NO_ERROR; + error.error = 0; + + current_operator_callback(&error, NULL, netreg); + __ofono_netreg_set_base_station_name(netreg, NULL); + + netreg->signal_strength = -1; + } + + notify_status_watches(netreg); +} + +void ofono_netreg_time_notify(struct ofono_netreg *netreg, + struct ofono_network_time *info) +{ + struct ofono_modem *modem = __ofono_atom_get_modem(netreg->atom); + + if (!info) + return; + + __ofono_nettime_info_received(modem, info); +} + static void registration_status_callback(const struct ofono_error *error, int status, int lac, int ci, int tech, void *data) |