diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-05-22 20:26:58 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-05-22 20:26:58 +0200 |
commit | 8a183fb4235cdd51b660380f7e05de40713bdfa8 (patch) | |
tree | ead8f542ec53421d5109c5239303bef6ce8e65d1 | |
parent | 430f35194d1f0ed01f53bea6a8611ca0dae30065 (diff) |
[partial] port to new libosmocore-0.3 APIs
-rw-r--r-- | include/osmo-bts/abis.h | 8 | ||||
-rw-r--r-- | include/osmo-bts/bts.h | 5 | ||||
-rw-r--r-- | include/osmo-bts/logging.h | 2 | ||||
-rw-r--r-- | include/osmo-bts/rtp.h | 2 | ||||
-rw-r--r-- | src/common/abis.c | 26 | ||||
-rw-r--r-- | src/common/bts.c | 18 | ||||
-rw-r--r-- | src/common/oml.c | 2 | ||||
-rw-r--r-- | src/common/rtp.c | 2 | ||||
-rw-r--r-- | src/common/support.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-bb/l1ctl.c | 19 | ||||
-rw-r--r-- | src/osmo-bts-bb/main.c | 11 |
11 files changed, 47 insertions, 50 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h index 1862fd6d..a42f703f 100644 --- a/include/osmo-bts/abis.h +++ b/include/osmo-bts/abis.h @@ -1,8 +1,8 @@ #ifndef _ABIS_H #define _ABIS_H -#include <osmocore/select.h> -#include <osmocore/timer.h> +#include <osmocom/core/select.h> +#include <osmocom/core/timer.h> #define IPA_TCP_PORT_OML 3002 #define IPA_TCP_PORT_RSL 3003 @@ -47,8 +47,8 @@ struct ipabis_link { int state; struct osmocom_bts *bts; /* set, if OML link */ struct osmobts_trx *trx; /* set, if RSL link */ - struct bsc_fd bfd; - struct timer_list timer; + struct osmo_fd bfd; + struct osmo_timer_list timer; struct msgb *rx_msg; struct llist_head tx_queue; int ping, pong, id_resp; diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 3e37e0bf..70642207 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -62,7 +62,7 @@ struct osmobts_sysinfo { uint8_t flags[BTS_SI_NUM]; uint8_t si[BTS_SI_NUM][23]; - struct timer_list timer; + struct osmo_timer_list timer; }; struct osmobts_slot; @@ -71,7 +71,6 @@ struct osmobts_slot; struct osmobts_ms { struct llist_head entry; struct osmobts_trx *trx; - struct osmocom_ms ms; }; /* one logical channel instance */ @@ -79,7 +78,7 @@ struct osmobts_lchan { struct osmobts_slot *slot; uint8_t lchan_nr; uint8_t chan_nr; /* CBITS+TN */ - struct osmol2_entity l2_entity; + struct lapdm_channel lapdm_channel; struct osmobts_rtp rtp; }; diff --git a/include/osmo-bts/logging.h b/include/osmo-bts/logging.h index 775c969e..601fb2f5 100644 --- a/include/osmo-bts/logging.h +++ b/include/osmo-bts/logging.h @@ -2,7 +2,7 @@ #define _LOGGING_H #define DEBUG -#include <osmocore/logging.h> +#include <osmocom/core/logging.h> enum { DRSL, diff --git a/include/osmo-bts/rtp.h b/include/osmo-bts/rtp.h index 28800fa0..d104a6b4 100644 --- a/include/osmo-bts/rtp.h +++ b/include/osmo-bts/rtp.h @@ -11,7 +11,7 @@ struct osmobts_lchan *lchan; struct osmobts_udp { struct osmobts_rtp *rtp; - struct bsc_fd bfd; + struct osmo_fd bfd; struct sockaddr_in sin_local, sin_remote; struct llist_head tx_queue; }; diff --git a/src/common/abis.c b/src/common/abis.c index fc90f912..2e68d546 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -285,7 +285,7 @@ static void abis_timeout(void *arg) case LINK_STATE_RETRYING: ret = abis_open(link, link->ip); if (ret <= 0) - bsc_schedule_timer(&link->timer, OML_RETRY_TIMER, 0); + osmo_timer_schedule(&link->timer, OML_RETRY_TIMER, 0); break; case LINK_STATE_CONNECT: if (link->ping && !link->pong) { @@ -294,7 +294,7 @@ static void abis_timeout(void *arg) abis_close(link); ret = abis_open(link, link->ip); if (ret <= 0) { - bsc_schedule_timer(&link->timer, + osmo_timer_schedule(&link->timer, OML_RETRY_TIMER, 0); link->state = LINK_STATE_RETRYING; } @@ -304,12 +304,12 @@ static void abis_timeout(void *arg) link->pong = 0; LOGP(DABIS, LOGL_INFO, "PING\n"); abis_tx_ipa_pingpong(link, IPA_MSGT_PING); - bsc_schedule_timer(&link->timer, OML_PING_TIMER, 0); + osmo_timer_schedule(&link->timer, OML_PING_TIMER, 0); break; } } -static int abis_sock_cb(struct bsc_fd *bfd, unsigned int what) +static int abis_sock_cb(struct osmo_fd *bfd, unsigned int what) { struct ipabis_link *link = bfd->data; struct ipabis_head *hh; @@ -318,11 +318,11 @@ static int abis_sock_cb(struct bsc_fd *bfd, unsigned int what) if ((what & BSC_FD_WRITE) && link->state == LINK_STATE_CONNECTING) { if (link->bts) { - if (bsc_timer_pending(&link->timer)) - bsc_del_timer(&link->timer); -// bsc_schedule_timer(&link->timer, OML_PING_TIMER, 0); + if (osmo_timer_pending(&link->timer)) + osmo_timer_del(&link->timer); +// osmo_timer_schedule(&link->timer, OML_PING_TIMER, 0); #warning HACK - bsc_schedule_timer(&link->timer, 3, 0); + osmo_timer_schedule(&link->timer, 3, 0); link->ping = link->pong = 0; } LOGP(DABIS, LOGL_INFO, "Abis socket now connected.\n"); @@ -394,7 +394,7 @@ close: LOGP(DABIS, LOGL_INFO, "Connection to BSC failed, retrying in %d " "seconds.\n", OML_RETRY_TIMER); - bsc_schedule_timer(&link->timer, OML_RETRY_TIMER, 0); + osmo_timer_schedule(&link->timer, OML_RETRY_TIMER, 0); link->state = LINK_STATE_RETRYING; return 0; @@ -445,7 +445,7 @@ int abis_open(struct ipabis_link *link, uint32_t ip) link->timer.cb = abis_timeout; link->timer.data = link; - bsc_register_fd(&link->bfd); + osmo_fd_register(&link->bfd); LOGP(DABIS, LOGL_INFO, "Abis socket trying to reach BSC.\n"); @@ -476,13 +476,13 @@ void abis_close(struct ipabis_link *link) while ((msg = msgb_dequeue(&link->tx_queue))) msgb_free(msg); - bsc_unregister_fd(&link->bfd); + osmo_fd_unregister(&link->bfd); close(link->bfd.fd); link->bfd.fd = -1; /* -1 or 0 indicates: 'close' */ link->state = LINK_STATE_IDLE; - if (bsc_timer_pending(&link->timer)) - bsc_del_timer(&link->timer); + if (osmo_timer_pending(&link->timer)) + osmo_timer_del(&link->timer); } diff --git a/src/common/bts.c b/src/common/bts.c index ff23bdde..1c912f03 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -24,11 +24,11 @@ #include <sys/socket.h> #include <netinet/in.h> -#include <osmocore/select.h> -#include <osmocore/timer.h> -#include <osmocore/msgb.h> -#include <osmocore/talloc.h> -#include <osmocore/protocol/gsm_12_21.h> +#include <osmocom/core/select.h> +#include <osmocom/core/timer.h> +#include <osmocom/core/msgb.h> +#include <osmocom/core/talloc.h> +#include <osmocom/gsm/protocol/gsm_12_21.h> #include <osmo-bts/logging.h> //#include <osmocom/bb/common/osmocom_data.h> //#include <osmocom/bb/common/l1l2_interface.h> @@ -259,8 +259,8 @@ void destroy_bts(struct osmocom_bts *bts) struct osmobts_ms, entry); destroy_ms(ms); } - if (bsc_timer_pending(&bts->trx[i]->si.timer)) - bsc_del_timer(&bts->trx[i]->si.timer); + if (osmo_timer_pending(&bts->trx[i]->si.timer)) + osmo_timer_del(&bts->trx[i]->si.timer); talloc_free(bts->trx[i]); bts->trx[i] = NULL; } @@ -332,7 +332,7 @@ void bts_new_si(void *arg) struct osmobts_trx *trx = arg; int i; - if (bsc_timer_pending(&trx->si.timer)) + if (osmo_timer_pending(&trx->si.timer)) return; i = 0; @@ -353,7 +353,7 @@ void bts_new_si(void *arg) /* delay until next SI */ trx->si.timer.cb = bts_new_si; trx->si.timer.data = trx; - bsc_schedule_timer(&trx->si.timer, 0, 200000); + osmo_timer_schedule(&trx->si.timer, 0, 200000); } /* handle bts instance (including MS instances) */ diff --git a/src/common/oml.c b/src/common/oml.c index f873370f..bd8af570 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -27,7 +27,7 @@ #include <sys/types.h> #include <arpa/inet.h> -#include <osmocore/protocol/gsm_12_21.h> +#include <osmocom/core/protocol/gsm_12_21.h> #include <osmo-bts/logging.h> //#include <osmocom/bb/common/osmocom_data.h> #include <osmo-bts/support.h> diff --git a/src/common/rtp.c b/src/common/rtp.c index f62d7bd5..e8a7e7fc 100644 --- a/src/common/rtp.c +++ b/src/common/rtp.c @@ -31,7 +31,7 @@ #include <time.h> #include <string.h> -#include <osmocore/msgb.h> +#include <osmocom/core/msgb.h> #include <osmo-bts/logging.h> //#include <osmocom/bb/common/osmocom_data.h> diff --git a/src/common/support.c b/src/common/support.c index 45f33b88..36fc5ca3 100644 --- a/src/common/support.c +++ b/src/common/support.c @@ -20,7 +20,7 @@ #include <sys/types.h> #include <string.h> -#include <osmocore/protocol/gsm_12_21.h> +#include <osmocom/gsm/protocol/gsm_12_21.h> //#include <osmocom/bb/common/osmocom_data.h> #include <osmo-bts/support.h> diff --git a/src/osmo-bts-bb/l1ctl.c b/src/osmo-bts-bb/l1ctl.c index fe64752e..6f66150d 100644 --- a/src/osmo-bts-bb/l1ctl.c +++ b/src/osmo-bts-bb/l1ctl.c @@ -31,16 +31,15 @@ #include <l1ctl_proto.h> -#include <osmocore/signal.h> -#include <osmocore/logging.h> -#include <osmocore/timer.h> -#include <osmocore/msgb.h> -#include <osmocore/tlv.h> -#include <osmocore/gsm_utils.h> -#include <osmocore/gsmtap_util.h> -#include <osmocore/protocol/gsm_04_08.h> -#include <osmocore/protocol/gsm_08_58.h> -#include <osmocore/rsl.h> +#include <osmocom/core/signal.h> +#include <osmocom/core/timer.h> +#include <osmocom/core/msgb.h> +#include <osmocom/gsm/tlv.h> +#include <osmocom/gsm/gsm_utils.h> +#include <osmocom/gsm/gsmtap_util.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> +#include <osmocom/gsm/protocol/gsm_08_58.h> +#include <osmocom/gsm/rsl.h> #include <osmocom/bb/common/l1ctl.h> #include <osmocom/bb/common/osmocom_data.h> diff --git a/src/osmo-bts-bb/main.c b/src/osmo-bts-bb/main.c index 076a6538..7300b682 100644 --- a/src/osmo-bts-bb/main.c +++ b/src/osmo-bts-bb/main.c @@ -19,11 +19,10 @@ */ #include <netinet/in.h> -#include <osmocore/talloc.h> -#include <osmocore/signal.h> -#include <osmocore/timer.h> -#include <osmocore/select.h> -#include <osmocore/signal.h> +#include <osmocom/core/talloc.h> +#include <osmocom/core/signal.h> +#include <osmocom/core/timer.h> +#include <osmocom/core/select.h> #include <osmo-bts/logging.h> //#include <osmocom/bb/common/osmocom_data.h> #include <osmo-bts/support.h> @@ -206,7 +205,7 @@ int main(int argc, char **argv) while (!quit) { work_bts(bts); - bsc_select_main(0); + osmo_select_main(0); } fail: |