aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2014-01-20 13:08:21 +0100
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-09-12 10:03:11 -0400
commit04444d9c0caff770f6afb18aa2e0d9a70b2ab10b (patch)
treefc096ae4e410a8247a7c873a530af4671a4f3fff
parentHACK: Make ABIS work when reestablishing (diff)
downloadOsmoBTS-04444d9c0caff770f6afb18aa2e0d9a70b2ab10b.tar.xz
OsmoBTS-04444d9c0caff770f6afb18aa2e0d9a70b2ab10b.zip
ABIS: Support of multiple RSL connections for ABIS/ipaccess
-rw-r--r--include/osmo-bts/abis.h4
-rw-r--r--src/common/abis.c45
-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, 35 insertions, 22 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h
index 62407ece..ede60cbe 100644
--- a/include/osmo-bts/abis.h
+++ b/include/osmo-bts/abis.h
@@ -17,8 +17,8 @@ enum {
};
void abis_init(struct gsm_bts *bts);
-struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host,
- char *model_name);
+struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
+ 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 1412e0de..6b853583 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;
+ uint8_t trx_nr;
switch (type) {
case E1INP_SIGN_OML:
@@ -83,16 +85,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;
}
@@ -101,12 +109,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)
@@ -207,10 +219,11 @@ void abis_init(struct gsm_bts *bts)
osmo_signal_register_handler(SS_L_INPUT, &inp_s_cbfn, bts);
}
-struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host,
- char *model_name)
+struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
+ const char *model_name, int trx_num)
{
struct e1inp_line *line;
+ int i;
/* patch in various data from VTY and othe sources */
line_ops.cfg.ipa.addr = dst_host;
@@ -229,7 +242,7 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, 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 will open the OML connection now */
diff --git a/src/common/oml.c b/src/common/oml.c
index 6de9055b..4ee6d9a6 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1055,8 +1055,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 bee5bda2..0eff16d8 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -401,7 +401,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(2);
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 6f2dd4bc..de954352 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -363,7 +363,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);