aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2014-01-20 13:08:21 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2014-01-21 16:07:26 +0100
commit72ba533d34b0b1ff1824fe50748fe165f5562250 (patch)
treea171a09d7ee1fcc027ae5e9e11c91673f222954e
parent21b01f513ebbead4a3f2de1869097bbfcfd290aa (diff)
ABIS: Support of multiple RSL connections for ABIS/ipaccess
-rw-r--r--include/osmo-bts/abis.h2
-rw-r--r--src/common/abis.c43
-rw-r--r--src/common/oml.c4
-rw-r--r--src/osmo-bts-sysmo/main.c2
-rw-r--r--src/osmo-bts-trx/main.c2
5 files changed, 33 insertions, 20 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h
index fb0fbd76..99da17d9 100644
--- a/include/osmo-bts/abis.h
+++ b/include/osmo-bts/abis.h
@@ -17,7 +17,7 @@ enum {
};
struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
- const char *model_name);
+ const char *model_name, int trx_num);
int abis_oml_sendmsg(struct msgb *msg);
diff --git a/src/common/abis.c b/src/common/abis.c
index 27a61a59..f6fe76d2 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -69,6 +69,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:
@@ -79,16 +81,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;
}
@@ -97,12 +105,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)
@@ -223,9 +235,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;
@@ -249,7 +262,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 93dbf19f..9dd68590 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1044,8 +1044,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 443aa4e8..25c6374e 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);