diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-09-15 13:22:42 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2023-09-19 09:15:08 +0000 |
commit | 9aaaacc7aa38f0206034b0b3a4158e64c0fff20a (patch) | |
tree | 7e7f31f83b7fa2b01efcd6de79721e12dbb35603 | |
parent | 9d9d9e2f27ebe0b4132f125dbc81197f77d752ea (diff) |
oml: Store RSL connect related fields in bb_transc
This is a preparation commit towards delaying connection of RSL tcp
socket until the BBTRANSC object is OPSTARTed, as it is the case already
in nanoBTS.
Related: OS#5253
Change-Id: Ia571ec19e9e8f8a6d7c2554642aab0afe1b4b917
-rw-r--r-- | include/osmo-bts/bts_trx.h | 7 | ||||
-rw-r--r-- | src/common/abis.c | 2 | ||||
-rw-r--r-- | src/common/oml.c | 14 | ||||
-rw-r--r-- | src/common/vty.c | 2 |
4 files changed, 18 insertions, 7 deletions
diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h index 72522eb1..3ea017e4 100644 --- a/include/osmo-bts/bts_trx.h +++ b/include/osmo-bts/bts_trx.h @@ -1,9 +1,15 @@ #pragma once +#include <osmocom/core/sockaddr_str.h> #include <osmo-bts/gsm_data.h> struct gsm_bts_bb_trx { struct gsm_abis_mo mo; + /* how do we talk RSL with this TRX? */ + struct { + struct osmo_sockaddr_str rem_addrstr; + uint8_t tei; + } rsl; }; /* One TRX in a BTS */ @@ -17,7 +23,6 @@ struct gsm_bts_trx { /* human readable name / description */ char *description; /* how do we talk RSL with this TRX? */ - uint8_t rsl_tei; struct e1inp_sign_link *rsl_link; /* NM Radio Carrier and Baseband Transciever */ diff --git a/src/common/abis.c b/src/common/abis.c index 10eeafff..9677c1fc 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -405,7 +405,7 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, } e1inp_ts_config_sign(sign_ts, line); trx->rsl_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_RSL, - trx, trx->rsl_tei, 0); + trx, trx->bb_transc.rsl.tei, 0); trx_link_estab(trx); return trx->rsl_link; } diff --git a/src/common/oml.c b/src/common/oml.c index 85ec5d7a..f78790aa 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1478,6 +1478,7 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts *bts, struct msgb *msg, struct e1inp_sign_link *oml_link = bts->oml_link; const struct abis_om_fom_hdr *foh = msgb_l3(msg); struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + struct gsm_bts_bb_trx *bb_transc; const char *trx_name; struct in_addr in; uint16_t port = IPA_TCP_PORT_RSL; @@ -1491,6 +1492,7 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts *bts, struct msgb *msg, if (TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP_PORT)) port = ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_DST_IP_PORT)); + if (TLVP_PRESENT(tp, NM_ATT_IPACC_STREAM_ID)) stream_id = *TLVP_VAL(tp, NM_ATT_IPACC_STREAM_ID); @@ -1501,17 +1503,21 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts *bts, struct msgb *msg, goto tx_ack_nack; } - trx_name = gsm_trx_name(trx); + bb_transc = &trx->bb_transc; + osmo_sockaddr_str_from_in_addr(&bb_transc->rsl.rem_addrstr, &in, port); + bb_transc->rsl.tei = stream_id; + trx_name = gsm_trx_name(trx); LOGP(DOML, LOGL_INFO, "%s: Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", - trx_name, inet_ntoa(in), port, stream_id); + trx_name, bb_transc->rsl.rem_addrstr.ip, bb_transc->rsl.rem_addrstr.port, + bb_transc->rsl.tei); if (bts->variant == BTS_OSMO_OMLDUMMY) { rc = 0; LOGP(DOML, LOGL_NOTICE, "%s: Not connecting RSL in OML-DUMMY!\n", trx_name); } else { - trx->rsl_tei = stream_id; - rc = e1inp_ipa_bts_rsl_connect_n(oml_link->ts->line, inet_ntoa(in), port, trx->nr); + rc = e1inp_ipa_bts_rsl_connect_n(oml_link->ts->line, bb_transc->rsl.rem_addrstr.ip, + bb_transc->rsl.rem_addrstr.port, trx->nr); if (rc < 0) { LOGP(DOML, LOGL_NOTICE, "%s: Error connecting IPA RSL: %d\n", trx_name, rc); rc = NM_NACK_CANT_PERFORM; diff --git a/src/common/vty.c b/src/common/vty.c index 31104c27..47e0ecd2 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -1662,7 +1662,7 @@ static void trx_dump_vty(struct vty *vty, const struct gsm_bts_trx *trx) vty_out(vty, " RSL State: %s%s", trx->rsl_link? "connected" : "disconnected", VTY_NEWLINE); vty_out(vty, " Baseband Transceiver NM State: "); net_dump_nmstate(vty, &trx->bb_transc.mo.nm_state); - vty_out(vty, " IPA stream ID: 0x%02x%s", trx->rsl_tei, VTY_NEWLINE); + vty_out(vty, " IPA stream ID: 0x%02x%s", trx->bb_transc.rsl.tei, VTY_NEWLINE); } static inline void print_all_trx(struct vty *vty, const struct gsm_bts *bts) |