From: Pablo Neira Ayuso pablo@gnumonks.org
Hi Harald,
Please, review these patchset and let me know if this is enough to resolve the existing limitations that you found.
Thanks.
Pablo Neira Ayuso (2): ipaccess: bts: OML and RSL links may use different address bts: add E1INP_LINE_R_BTS_RSL_ONLY mode
include/osmocom/abis/e1_input.h | 8 +++++++- src/input/hsl.c | 4 ++-- src/input/ipaccess.c | 19 +++++++++++++++++-- tests/e1inp_ipa_bts_test.c | 7 ++++++- 4 files changed, 32 insertions(+), 6 deletions(-)
From: Pablo Neira Ayuso pablo@gnumonks.org
This patch allows you to set different addresses for the OML and RSL links.
You can set the RSL address anytime via line->ops->cfg.ipa.rsl.addr before the second call to e1inp_line_update() that brings the RSL link up. --- include/osmocom/abis/e1_input.h | 7 ++++++- src/input/hsl.c | 4 ++-- src/input/ipaccess.c | 4 ++-- tests/e1inp_ipa_bts_test.c | 7 ++++++- 4 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index 16e7f8b..fac7bac 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -140,8 +140,13 @@ struct e1inp_line_ops { union { struct { enum e1inp_line_role role; /* BSC or BTS mode. */ - const char *addr; /* IP address .*/ void *dev; /* device parameters. */ + struct { + const char *addr; /* IP address .*/ + } oml; + struct { + const char *addr; + } rsl; } ipa; struct { const char *port; /* e.g. /dev/ttyUSB0 */ diff --git a/src/input/hsl.c b/src/input/hsl.c index 1a60c2b..cfe7157 100644 --- a/src/input/hsl.c +++ b/src/input/hsl.c @@ -476,7 +476,7 @@ static int hsl_line_update(struct e1inp_line *line) LOGP(DLINP, LOGL_NOTICE, "enabling hsl BSC mode\n");
ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, - line->ops->cfg.ipa.addr, + line->ops->cfg.ipa.oml.addr, HSL_TCP_PORT, OSMO_SOCK_F_BIND); if (ret < 0) return ret; @@ -499,7 +499,7 @@ static int hsl_line_update(struct e1inp_line *line) link = ipa_client_conn_create(tall_hsl_ctx, &line->ts[E1INP_SIGN_OML-1], E1INP_SIGN_OML, - line->ops->cfg.ipa.addr, + line->ops->cfg.ipa.oml.addr, HSL_TCP_PORT, hsl_bts_connect, hsl_bts_process, diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index b8c1e7a..0fce15e 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -901,7 +901,7 @@ static int ipaccess_bts_oml_link_up(struct e1inp_line *line) link = ipa_client_conn_create(tall_ipa_ctx, &line->ts[E1INP_SIGN_OML-1], E1INP_SIGN_OML, - line->ops->cfg.ipa.addr, + line->ops->cfg.ipa.oml.addr, IPA_TCP_PORT_OML, NULL, ipaccess_bts_cb, @@ -930,7 +930,7 @@ static int ipaccess_bts_rsl_link_up(struct e1inp_line *line) rsl_link = ipa_client_conn_create(tall_ipa_ctx, &line->ts[E1INP_SIGN_RSL-1], E1INP_SIGN_RSL, - line->ops->cfg.ipa.addr, + line->ops->cfg.ipa.rsl.addr, IPA_TCP_PORT_RSL, NULL, ipaccess_bts_cb, diff --git a/tests/e1inp_ipa_bts_test.c b/tests/e1inp_ipa_bts_test.c index 112af65..46c6483 100644 --- a/tests/e1inp_ipa_bts_test.c +++ b/tests/e1inp_ipa_bts_test.c @@ -282,8 +282,13 @@ int main(void) .cfg = { .ipa = { .role = E1INP_LINE_R_BTS, - .addr = "127.0.0.1", .dev = &bts_dev_info, + .oml = { + .addr = "127.0.0.1", + }, + .rsl = { + .addr = "127.0.0.1", + }, }, }, .sign_link_up = sign_link_up,
From: Pablo Neira Ayuso pablo@gnumonks.org
This patch adds the E1INP_LINE_R_BTS_RSL_ONLY that brings the RSL link without the OML link. This mode is useful for the multi-TRX BTS setup. --- include/osmocom/abis/e1_input.h | 1 + src/input/ipaccess.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+)
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index fac7bac..037e353 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -123,6 +123,7 @@ enum e1inp_line_role { E1INP_LINE_R_NONE, E1INP_LINE_R_BSC, E1INP_LINE_R_BTS, + E1INP_LINE_R_BTS_RSL_ONLY, E1INP_LINE_R_MAX };
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 0fce15e..0f995e7 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -1044,6 +1044,21 @@ static int ipaccess_line_update(struct e1inp_line *line) break; } } + case E1INP_LINE_R_BTS_RSL_ONLY: + switch(il->state) { + case NONE: + LOGP(DLINP, LOGL_NOTICE, "enabling ipaccess BTS mode " + "in RSL mode only\n"); + ret = ipaccess_bts_rsl_link_up(line); + il->state = ALL_UP; + break; + default: + LOGP(DLINP, LOGL_ERROR, "ipaccess BTS RSL link already " + "up and running\n"); + ret = -EBUSY; + break; + break; + } default: break; }