dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/38954?usp=email )
Change subject: pcuif: add comment on TXT_IND/PCU_VERSION BTS initialization behavior ......................................................................
pcuif: add comment on TXT_IND/PCU_VERSION BTS initialization behavior
The PCU sends a TXT_IND with the PCU_VERSION as the first message after the socket connection is established. The BTS/BSC uses those 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 works by chance for the BTS where the BTS number is always 0, in the case of the BSC there may be multiple BTS configured, so there may be arbitrary BTS numbers.
Let's fix this design error by agreeing that a TXT_IND that has the type PCU_VERSION is always addressing the receiving process as a whole and therefore the BTS number in the indication must be ignored.
Related: OS#6507 Change-Id: Ib3f340ae9450151549ce61d34b28253d499ae04a --- M src/pcu_l1_if.cpp 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/54/38954/1
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index fb44bd8..630c244 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -124,6 +124,13 @@ struct gsm_pcu_if_txt_ind *txt; va_list ap; char *rep; + + /* In case the caller sends a TXT indication of type PCU_VERSION, the bts_nr will always be 0. Also the receiver + * is expected to ignore the bts_nr when receiving a TXT indication of type PCU_VERSION. The rationale is that + * the information about the PCU version number is only useful to the receiving process as a whole (be it osmo-bsc + * or osmo-bts). */ + /* TODO: add support for sending other TXT indication types than PCU_VERSION */ + OSMO_ASSERT(t == PCU_VERSION); struct msgb *msg = pcu_msgb_alloc(PCU_IF_MSG_TXT_IND, 0); if (!msg) return -ENOMEM;