aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c')
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
index a0ba6493..ac35f392 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
@@ -14,7 +14,7 @@
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -54,7 +54,7 @@ enum calib_result {
CALIB_FAIL_START,
CALIB_FAIL_GPS,
CALIB_FAIL_CTRL,
- CALIB_SUCESS,
+ CALIB_SUCCESS,
};
static inline int compat_gps_read(struct gps_data_t *data)
@@ -167,10 +167,8 @@ static void mgr_gps_open(struct sysmobts_mgr_instance *mgr)
#else
gps_stream(mgr->calib.gpsdata, WATCH_ENABLE, NULL);
#endif
- mgr->calib.gpsfd.data = mgr;
- mgr->calib.gpsfd.cb = mgr_gps_read;
- mgr->calib.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT;
- mgr->calib.gpsfd.fd = mgr->calib.gpsdata->gps_fd;
+ osmo_fd_setup(&mgr->calib.gpsfd, mgr->calib.gpsdata->gps_fd, OSMO_FD_READ | OSMO_FD_EXCEPT,
+ mgr_gps_read, mgr, 0);
if (osmo_fd_register(&mgr->calib.gpsfd) < 0) {
LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n");
calib_state_reset(mgr, CALIB_FAIL_GPS);
@@ -271,7 +269,7 @@ static void calib_state_reset(struct sysmobts_mgr_instance *mgr, int outcome)
* and in case of a failure in some minutes.
*/
int timeout = 2 * 60 * 60;
- if (outcome != CALIB_SUCESS)
+ if (outcome != CALIB_SUCCESS)
timeout = 5 * 60;
mgr->calib.calib_timeout.data = mgr;
@@ -390,7 +388,7 @@ static void handle_ctrl_set_cor(
LOGP(DCALIB, LOGL_NOTICE,
"Calibration process completed\n");
- calib_state_reset(mgr, CALIB_SUCESS);
+ calib_state_reset(mgr, CALIB_SUCCESS);
}
static void handle_ctrl(struct sysmobts_mgr_instance *mgr, struct msgb *msg)
@@ -459,7 +457,7 @@ static void bts_recon_timer_cb(void *data)
struct sysmobts_mgr_instance *mgr = data;
/* The connection failures are to be expected during boot */
- mgr->calib.bts_conn->ofd->when |= BSC_FD_WRITE;
+ osmo_fd_write_enable(mgr->calib.bts_conn->ofd);
rc = ipa_client_conn_open(mgr->calib.bts_conn);
if (rc < 0) {
LOGP(DLCTRL, LOGL_NOTICE, "Failed to connect to BTS.\n");
@@ -543,8 +541,8 @@ int sysmobts_mgr_calib_init(struct sysmobts_mgr_instance *mgr)
return 0;
}
- mgr->calib.bts_conn = ipa_client_conn_create(tall_mgr_ctx, NULL, 0,
- "localhost", 4238,
+ mgr->calib.bts_conn = ipa_client_conn_create2(tall_mgr_ctx, NULL, 0,
+ NULL, 0, "localhost", 4238,
bts_updown_cb, bts_read_cb,
NULL, mgr);
if (!mgr->calib.bts_conn) {