pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bts/+/34440?usp=email )
Change subject: oml: Store RSL connect related fields in bb_transc
......................................................................
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
---
M include/osmo-bts/bts_trx.h
M src/common/abis.c
M src/common/oml.c
M src/common/vty.c
4 files changed, 32 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/34440/1
diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h
index 72522eb..3ea017e 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 @@
/* 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 10eeaff..9677c1f 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -405,7 +405,7 @@
}
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 4380258..d347388 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1534,6 +1534,7 @@
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;
@@ -1547,6 +1548,7 @@
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);
@@ -1557,17 +1559,21 @@
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 31104c2..47e0ecd 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1662,7 +1662,7 @@
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)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/34440?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia571ec19e9e8f8a6d7c2554642aab0afe1b4b917
Gerrit-Change-Number: 34440
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange