pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/34441?usp=email )

Change subject: Move trx->rsl_link to trx->bb_transc.rsl.link
......................................................................

Move trx->rsl_link to trx->bb_transc.rsl.link

The RSL link is configured/set up by the BBTRANSC NM object, hence move
it to the appropiate substruct.

Related: OS#5253
Change-Id: I62937cbd81c27274b9f5f70d454d5319a6898c7b
---
M include/osmo-bts/bts_trx.h
M src/common/abis.c
M src/common/nm_bb_transc_fsm.c
M src/common/nm_radio_carrier_fsm.c
M src/common/rsl.c
M src/common/vty.c
M src/osmo-bts-trx/trx_vty.c
M tests/handover/handover_test.c
8 files changed, 40 insertions(+), 28 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, approved




diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h
index 3ea017e..a098c3e 100644
--- a/include/osmo-bts/bts_trx.h
+++ b/include/osmo-bts/bts_trx.h
@@ -9,6 +9,7 @@
        struct {
                struct osmo_sockaddr_str rem_addrstr;
                uint8_t tei;
+               struct e1inp_sign_link *link;
        } rsl;
 };

@@ -22,8 +23,6 @@
        uint8_t nr;
        /* human readable name / description */
        char *description;
-       /* how do we talk RSL with this TRX? */
-       struct e1inp_sign_link *rsl_link;

        /* NM Radio Carrier and Baseband Transciever */
        struct gsm_abis_mo mo;
diff --git a/src/common/abis.c b/src/common/abis.c
index 9677c1f..18e6c63 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -225,9 +225,9 @@

        /* Then iterate over the RSL signalling links */
        llist_for_each_entry(trx, &bts->trx_list, list) {
-               if (trx->rsl_link) {
-                       e1inp_sign_link_destroy(trx->rsl_link);
-                       trx->rsl_link = NULL;
+               if (trx->bb_transc.rsl.link) {
+                       e1inp_sign_link_destroy(trx->bb_transc.rsl.link);
+                       trx->bb_transc.rsl.link = NULL;
                        if (trx == trx->bts->c0)
                                load_timer_stop(trx->bts);
                } else {
@@ -364,7 +364,7 @@

        /* osmo-bts uses msg->trx internally, but libosmo-abis uses
         * the signalling link at msg->dst */
-       msg->dst = msg->trx->rsl_link;
+       msg->dst = msg->trx->bb_transc.rsl.link;
        return abis_sendmsg(msg);
 }

@@ -404,10 +404,10 @@
                        break;
                }
                e1inp_ts_config_sign(sign_ts, line);
-               trx->rsl_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_RSL,
-                                                      trx, 
trx->bb_transc.rsl.tei, 0);
+               trx->bb_transc.rsl.link = e1inp_sign_link_create(sign_ts, 
E1INP_SIGN_RSL,
+                                                                trx, 
trx->bb_transc.rsl.tei, 0);
                trx_link_estab(trx);
-               return trx->rsl_link;
+               return trx->bb_transc.rsl.link;
        }
        return NULL;
 }
diff --git a/src/common/nm_bb_transc_fsm.c b/src/common/nm_bb_transc_fsm.c
index 1dd2c85..12493e4 100644
--- a/src/common/nm_bb_transc_fsm.c
+++ b/src/common/nm_bb_transc_fsm.c
@@ -173,7 +173,7 @@
        if (trx->bts->variant != BTS_OSMO_OMLDUMMY) { /* In OMLDUMMY, phy=NULL 
*/
                struct phy_instance *pinst = trx_phy_instance(trx);
                phy_state_connected = phy_link_state_get(pinst->phy_link) == 
PHY_LINK_CONNECTED;
-               rsl_link_connected = !!trx->rsl_link;
+               rsl_link_connected = !!trx->bb_transc.rsl.link;
        } else {
                phy_state_connected = true;
                rsl_link_connected = true;
diff --git a/src/common/nm_radio_carrier_fsm.c 
b/src/common/nm_radio_carrier_fsm.c
index 4431eb5..0e37c87 100644
--- a/src/common/nm_radio_carrier_fsm.c
+++ b/src/common/nm_radio_carrier_fsm.c
@@ -153,7 +153,7 @@
        if (trx->bts->variant != BTS_OSMO_OMLDUMMY) { /* In OMLDUMMY, phy=NULL 
*/
                struct phy_instance *pinst = trx_phy_instance(trx);
                phy_state_connected = phy_link_state_get(pinst->phy_link) == 
PHY_LINK_CONNECTED;
-               rsl_link_connected = !!trx->rsl_link;
+               rsl_link_connected = !!trx->bb_transc.rsl.link;
        } else {
                phy_state_connected = true;
                rsl_link_connected = true;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5231765..f11ec0e 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2911,7 +2911,7 @@

 static char *get_rsl_local_ip(struct gsm_bts_trx *trx)
 {
-       struct e1inp_ts *ts = trx->rsl_link->ts;
+       struct e1inp_ts *ts = trx->bb_transc.rsl.link->ts;
        struct sockaddr_storage ss;
        socklen_t sa_len = sizeof(ss);
        static char hostbuf[256];
@@ -3054,7 +3054,7 @@
                 * address */
                if (connect_ip == 0) {
                        struct e1inp_sign_link *sign_link =
-                                               lchan->ts->trx->rsl_link;
+                                               
lchan->ts->trx->bb_transc.rsl.link;

                        ia.s_addr = htonl(get_signlink_remote_ip(sign_link));
                } else
diff --git a/src/common/vty.c b/src/common/vty.c
index 47e0ecd..f14cc92 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1659,7 +1659,7 @@

        vty_out(vty, "  NM State: ");
        net_dump_nmstate(vty, &trx->mo.nm_state);
-       vty_out(vty, "  RSL State: %s%s", trx->rsl_link? "connected" : 
"disconnected", VTY_NEWLINE);
+       vty_out(vty, "  RSL State: %s%s", trx->bb_transc.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->bb_transc.rsl.tei, 
VTY_NEWLINE);
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 9cc9805..998e9cb 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -90,7 +90,7 @@
                        vty_out(vty, " bsic   : undefined%s", VTY_NEWLINE);

                /* trx->ts[tn].priv is NULL in absence of the A-bis connection 
*/
-               if (trx->rsl_link == NULL)
+               if (trx->bb_transc.rsl.link == NULL)
                        continue;

                for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 3c46971..f1235f5 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -99,9 +99,9 @@
        OSMO_ASSERT(line);
        sign_ts = e1inp_line_ipa_rsl_ts(line, 0);
        e1inp_ts_config_sign(sign_ts, line);
-       trx->rsl_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_RSL, NULL, 
0, 0);
-       OSMO_ASSERT(trx->rsl_link);
-       trx->rsl_link->trx = trx;
+       trx->bb_transc.rsl.link = e1inp_sign_link_create(sign_ts, 
E1INP_SIGN_RSL, NULL, 0, 0);
+       OSMO_ASSERT(trx->bb_transc.rsl.link);
+       trx->bb_transc.rsl.link->trx = trx;

        fprintf(stderr, "test 1: without timeout\n");

@@ -114,9 +114,9 @@
        lchan->ho.active = HANDOVER_ENABLED;
        lchan->ho.ref = 23;
        l1sap_chan_act(lchan->ts->trx, 0x0a);
-       OSMO_ASSERT(msgb_dequeue(&trx->rsl_link->tx_list));
-       OSMO_ASSERT(msgb_dequeue(&trx->rsl_link->tx_list));
-       OSMO_ASSERT(!msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));
+       OSMO_ASSERT(msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));
+       OSMO_ASSERT(!msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));

        /* send access burst with wrong ref */
        memset(&nl1sap, 0, sizeof(nl1sap));
@@ -129,7 +129,7 @@

        /* expect no action */
        OSMO_ASSERT(modify_count == 0);
-       OSMO_ASSERT(!msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(!msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));

        /* send access burst with correct ref */
        nl1sap.u.rach_ind.ra = 23;
@@ -140,10 +140,10 @@
        expect_phys_info(&trx->ts[2].lchan[0].lapdm_ch.lapdm_dcch);

        /* expect exactly one HO.DET */
-       OSMO_ASSERT(msg = msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(msg = msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));
        rslh = msgb_l2(msg);
        OSMO_ASSERT(rslh->c.msg_type == RSL_MT_HANDO_DET);
-       OSMO_ASSERT(!msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(!msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));

        /* expect T3105 running */
        OSMO_ASSERT(osmo_timer_pending(&trx->ts[2].lchan[0].ho.t3105))
@@ -171,10 +171,10 @@
        expect_phys_info(&trx->ts[2].lchan[0].lapdm_ch.lapdm_dcch);

        /* expect exactly one HO.DET */
-       OSMO_ASSERT(msg = msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(msg = msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));
        rslh = msgb_l2(msg);
        OSMO_ASSERT(rslh->c.msg_type == RSL_MT_HANDO_DET);
-       OSMO_ASSERT(!msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(!msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));

        for (i = 0; i < bts->ny1 - 1; i++) {
                /* expect T3105 running */
@@ -196,10 +196,10 @@
        OSMO_ASSERT(!osmo_timer_pending(&trx->ts[2].lchan[0].ho.t3105))

        /* expect exactly one CONN.FAIL */
-       OSMO_ASSERT(msg = msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(msg = msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));
        rslh = msgb_l2(msg);
        OSMO_ASSERT(rslh->c.msg_type == RSL_MT_CONN_FAIL);
-       OSMO_ASSERT(!msgb_dequeue(&trx->rsl_link->tx_list));
+       OSMO_ASSERT(!msgb_dequeue(&trx->bb_transc.rsl.link->tx_list));

 #if 0
        while (!quit) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34441?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: I62937cbd81c27274b9f5f70d454d5319a6898c7b
Gerrit-Change-Number: 34441
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to