dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38093?usp=email )
Change subject: pcuif: fix TXT_IND/PCU_VERSION BTS initialization behavior ......................................................................
pcuif: fix TXT_IND/PCU_VERSION BTS initialization behavior
The PCU sends a TXT_IND with the PCU_VERSION as first message after the socket connection is established. The BSC uses this messages to trigger some initialization (allocate BTS object inside the PCU, send SI to the PCU).
Unfortunately the PCU will send the TXT_IND with the PCU_VERSION always with to BTS 0. The 0 in this case is a hardcoded fake BTS number (There is no BTS object allocated under this number in the PCU at this point). However, the BTS/BSC will then do the initialization process for BTS 0, which is incorrect.
Let's fix this design error by introducing a broadcast BTS number, we then send the TXT_IND with the PCU_VERSION to that broadcast BTS number. The BTS/BSC will then do the initialization for all BTS objects it is aware of and use their correct BTS numbers.
Related: OS#6507 Change-Id: Idce13d55fc5bdbf5b366e3a60d9b46aacfc701a9 Depends: osmo-bsc.git Ie92f5833a80b06e78c6cec8f03f054e2e2625fad Depends: osmo-bts.git I5316d3b7cef416eb19bb256f4ccc1468b3efe1c6 Depends: osmo-pcu.git Id01966a1ee52d0f5e465dc2e0eaf85e5b7942f81 Depends: docker-playground.git I15f7150b51047379a557a1f8df6330eca597f2e3 --- M bts/BTS_Tests.default M bts/BTS_Tests.ttcn M library/PCUIF_Types.ttcn M pcu/PCUIF_Components.ttcn M pcu/PCU_Tests.default M pcu/PCU_Tests_NS.ttcn 6 files changed, 32 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/93/38093/1
diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index 578aa36..b4a1cf1 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -29,7 +29,7 @@
[MODULE_PARAMETERS] Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBTS"; -PCUIF_Types.mp_pcuif_version := 12; +PCUIF_Types.mp_pcuif_version := 13;
# Configuration for each individual transceiver BTS_Tests.mp_trx_pars := { diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 07e824a..2023f79 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -5446,7 +5446,15 @@ f_init(); map(self:PCU, system:PCU); f_init_pcu(PCU, testcasename(), g_pcu_conn_id, g_pcu_last_info); - PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, testcasename()))); + + if (mp_pcuif_version <= 12) { + /* Older PCU versions send the TXT indication with the PCU_VERSION to BTS 0, even though + * this message is technically not related to any specific BTS. */ + PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, testcasename()))); + } else { + PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(PCU_IF_BTS_NR_BCAST, + PCU_VERSION, testcasename()))); + } }
/* PDCH activation via PCU socket; check for presence of RTS.req */ diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn index 7083884..7e39b5c 100644 --- a/library/PCUIF_Types.ttcn +++ b/library/PCUIF_Types.ttcn @@ -17,11 +17,11 @@
modulepar { /* PCUIF version supported by the IUT */ - PCUIF_Version mp_pcuif_version := 12; + PCUIF_Version mp_pcuif_version := 13; };
const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts"; -type integer PCUIF_Version (11..12); /* supported versions */ +type integer PCUIF_Version (11..13); /* supported versions */
type enumerated PCUIF_MsgType { PCU_IF_MSG_DATA_REQ ('00'O), @@ -377,6 +377,8 @@ PCUIF_container container } with { variant "" };
+const uint8_t PCU_IF_BTS_NR_BCAST := 255; + type record PCUIF_Message { PCUIF_MsgType msg_type, uint8_t bts_nr, diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn index 6e956ba..d77a26f 100644 --- a/pcu/PCUIF_Components.ttcn +++ b/pcu/PCUIF_Components.ttcn @@ -492,6 +492,7 @@ var BTS_PDTCH_Block pcu_msg_pdtch; var BTS_PTCCH_Block pcu_msg_ptcch; var BTS_CCCH_Block pcu_msg_rr; + var uint8_t pcu_bts_nr_rx;
g_info_ind := info_ind;
@@ -502,9 +503,17 @@ /* Wait until the PCU is connected */ PCUIF.receive(tr_RAW_PCU_EV(PCU_EV_CONNECT));
+ if (mp_pcuif_version <= 12) { + /* Older PCU versions send the TXT indication with the PCU_VERSION to BTS 0, even though + * this message is technically not related to any specific BTS. */ + pcu_bts_nr_rx := 0; + } else { + pcu_bts_nr_rx := PCU_IF_BTS_NR_BCAST + } + alt { /* Wait for TXT.ind (PCU_VERSION) and respond with INFO.ind (SI13) */ - [] PCUIF.receive(tr_PCUIF_TXT_IND(bts_nr, PCU_VERSION, ?)) -> value pcu_msg { + [] PCUIF.receive(tr_PCUIF_TXT_IND(pcu_bts_nr_rx, PCU_VERSION, ?)) -> value pcu_msg { log("Rx TXT.ind from the PCU, version is ", pcu_msg.u.txt_ind.text);
/* Send System Information 13 to the PCU */ diff --git a/pcu/PCU_Tests.default b/pcu/PCU_Tests.default index c72720b..30c6c83 100644 --- a/pcu/PCU_Tests.default +++ b/pcu/PCU_Tests.default @@ -29,7 +29,7 @@ } }; Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoPCU"; -PCUIF_Types.mp_pcuif_version := 12; +PCUIF_Types.mp_pcuif_version := 13;
[TESTPORT_PARAMETERS] *.PCU.socket_type := "SEQPACKET" diff --git a/pcu/PCU_Tests_NS.ttcn b/pcu/PCU_Tests_NS.ttcn index eea8d3f..cb7529b 100644 --- a/pcu/PCU_Tests_NS.ttcn +++ b/pcu/PCU_Tests_NS.ttcn @@ -56,7 +56,13 @@ PCU.receive(UD_connected:?);
/* Wait for PCU_VERSION and return INFO_IND */ - PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?))); + if (mp_pcuif_version <= 12) { + /* Older PCU versions send the TXT indication with the PCU_VERSION to BTS 0, even though + * this message is technically not related to any specific BTS. */ + PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?))); + } else { + PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(PCU_IF_BTS_NR_BCAST, PCU_VERSION, ?))); + } /* FIXME: make sure to use parameters from mp_gb_cfg.bvc[0].cell_id in the PCU INFO IND */ var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, info_ind); PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg));