diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2014-01-20 13:08:21 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-01-22 09:09:02 +0100 |
commit | 69fc57b0286b78a628b330cf62c4b4991add01fd (patch) | |
tree | a10f94024f331524b69484a9c64e9eaf30ae0268 /src | |
parent | e60b9d1de641acdad88afaa0aa94767d74fc52d3 (diff) |
ABIS: Support for multiple RSL connections
Diffstat (limited to 'src')
-rw-r--r-- | src/common/abis.c | 38 | ||||
-rw-r--r-- | src/common/oml.c | 3 |
2 files changed, 26 insertions, 15 deletions
diff --git a/src/common/abis.c b/src/common/abis.c index 3b8a7af1..a08f9f3b 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -73,6 +73,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; + int trx_nr; switch (type) { case E1INP_SIGN_OML: @@ -84,17 +86,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"); - e1inp_ts_config_sign(&line->ts[E1INP_SIGN_RSL-1], line); - 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 exixt!\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; } @@ -103,12 +110,15 @@ 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) diff --git a/src/common/oml.c b/src/common/oml.c index 35973d7b..7795cc6e 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1116,7 +1116,8 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts_trx *trx, struct msgb *msg, LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", inet_ntoa(in), port, stream_id); - rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port); + rc = e1inp_ipa_bts_rsl_connect_n(oml_link->ts->line, inet_ntoa(in), port, + trx->nr); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Error in abis_open(RSL): %d\n", rc); return oml_fom_ack_nack(msg, NM_NACK_CANT_PERFORM); |