From e5beda8f83fcac0efaf783ba66e4409fa326a7c4 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 20 Jan 2014 13:08:21 +0100 Subject: ABIS: Support of multiple RSL connections for ABIS/ipaccess --- src/common/abis.c | 43 ++++++++++++++++++++++++++++--------------- src/common/oml.c | 4 ++-- src/osmo-bts-sysmo/main.c | 2 +- src/osmo-bts-trx/main.c | 2 +- 4 files changed, 32 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/common/abis.c b/src/common/abis.c index c0565800..1f234ff4 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -71,6 +71,8 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, enum e1inp_sign_type type) { struct e1inp_sign_link *sign_link = NULL; + struct gsm_bts_trx *trx; + uint8_t trx_nr; switch (type) { case E1INP_SIGN_OML: @@ -81,16 +83,22 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, sign_link->trx = g_bts->c0; bts_link_estab(g_bts); break; - case E1INP_SIGN_RSL: - LOGP(DABIS, LOGL_INFO, "RSL Signalling link up\n"); - sign_link = g_bts->c0->rsl_link = - e1inp_sign_link_create(&line->ts[E1INP_SIGN_RSL-1], - E1INP_SIGN_RSL, NULL, 0, 0); - /* FIXME: This assumes there is only one TRX! */ - sign_link->trx = g_bts->c0; - trx_link_estab(sign_link->trx); - break; default: + trx_nr = type - E1INP_SIGN_RSL; + LOGP(DABIS, LOGL_INFO, "RSL Signalling link for TRX %d up\n", + trx_nr); + trx = gsm_bts_trx_num(g_bts, trx_nr); + if (!trx) { + LOGP(DABIS, LOGL_ERROR, "TRX #%d does not exits\n", + trx_nr); + break; + } + e1inp_ts_config_sign(&line->ts[type-1], line); + sign_link = trx->rsl_link = + e1inp_sign_link_create(&line->ts[type-1], + E1INP_SIGN_RSL, NULL, 0, 0); + sign_link->trx = trx; + trx_link_estab(trx); break; } @@ -99,12 +107,16 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, static void sign_link_down(struct e1inp_line *line) { + struct gsm_bts_trx *trx; + LOGP(DABIS, LOGL_ERROR, "Signalling link down\n"); - if (g_bts->c0->rsl_link) { - e1inp_sign_link_destroy(g_bts->c0->rsl_link); - g_bts->c0->rsl_link = NULL; - trx_link_estab(g_bts->c0); + llist_for_each_entry(trx, &g_bts->trx_list, list) { + if (trx->rsl_link) { + e1inp_sign_link_destroy(trx->rsl_link); + trx->rsl_link = NULL; + trx_link_estab(trx); + } } if (g_bts->oml_link) @@ -225,9 +237,10 @@ static struct e1inp_line_ops line_ops = { * global initialization as well as the actual opening of the A-bis link * */ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, - const char *model_name) + const char *model_name, int trx_num) { struct e1inp_line *line; + int i; g_bts = bts; @@ -251,7 +264,7 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, return NULL; e1inp_line_bind_ops(line, &line_ops); e1inp_ts_config_sign(&line->ts[E1INP_SIGN_OML-1], line); - for (i = 0; i < num_trx; i++) + for (i = 0; i < trx_num; i++) e1inp_ts_config_sign(&line->ts[E1INP_SIGN_RSL-1+i], line); /* This is what currently starts both the outbound OML and RSL diff --git a/src/common/oml.c b/src/common/oml.c index dac61433..986076c5 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1041,8 +1041,8 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts_trx *trx, struct msgb *msg, } in.s_addr = htonl(ip); - LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", - inet_ntoa(in), port, stream_id); + LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT TRX=%d IP=%s PORT=%u " + "STREAM=0x%02x\n", trx->nr, inet_ntoa(in), port, stream_id); if (trx->rsl_link) { LOGP(DOML, LOGL_INFO, "Sign Link already up\n"); diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index 31eb1e1e..03637fbf 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -384,7 +384,7 @@ int main(int argc, char **argv) exit(1); } - line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS"); + line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS", 1); if (!line) { fprintf(stderr, "unable to connect to BSC\n"); exit(1); diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index c4a4c601..1a3e1c75 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -361,7 +361,7 @@ int main(int argc, char **argv) exit(1); } - line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS"); + line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS", trx_num); if (!line) { fprintf(stderr, "unable to connect to BSC\n"); exit(1); -- cgit v1.2.3