Change in osmo-bts[master]: pcu_sock: send SI1, SI3 and SI3 via PCUIF

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Fri Jan 29 21:55:41 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/22541 )


Change subject: pcu_sock: send SI1, SI3 and SI3 via PCUIF
......................................................................

pcu_sock: send SI1, SI3 and SI3 via PCUIF

The new version (0x0b, 11) of the PCUIF extends the SAPI 4 that is used
to transfer SI16 only, so that it can transfer SI1 and SI3 as well.

The system information SI1, SI3 and SI16 is needed by the NACC RIM
application which runs inside osmo-pcu.

Depends: osmo-pcu I5138ab183793e7eee4dc494318d984e9f1f56932
Change-Id: Ib7aeb41e634ad6fcab3766a4667b0267c749436a
Related: SYS#5103
---
M include/osmo-bts/pcu_if.h
M include/osmo-bts/pcuif_proto.h
M src/common/pcu_sock.c
M src/common/rsl.c
4 files changed, 62 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/22541/1

diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index 1475a94..add37f8 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -4,7 +4,7 @@
 extern int pcu_direct;
 
 int pcu_tx_info_ind(void);
-int pcu_tx_si13(const struct gsm_bts *bts, bool enable);
+int pcu_tx_si(const struct gsm_bts *bts, enum osmo_sysinfo_type si_type, bool enable);
 int pcu_tx_app_info_req(struct gsm_bts *bts, uint8_t app_type, uint8_t len, const uint8_t *app_data);
 int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
 	uint16_t arfcn, uint8_t block_nr);
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index 8f72602..bcb7f4c 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -6,7 +6,7 @@
 
 #define PCU_SOCK_DEFAULT	"/tmp/pcu_bts"
 
-#define PCU_IF_VERSION		0x0a
+#define PCU_IF_VERSION		0x0b
 #define TXT_MAX_LEN	128
 
 /* msg_type */
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 0466698..a9d8ba3 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -725,17 +725,57 @@
 	return rc;
 }
 
-int pcu_tx_si13(const struct gsm_bts *bts, bool enable)
+int pcu_tx_si(const struct gsm_bts *bts, enum osmo_sysinfo_type si_type,
+	      bool enable)
 {
 	/* the SI is per-BTS so it doesn't matter which TRX we use */
 	struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 0);
 
+	uint8_t si_buf[1 + GSM_MACBLOCK_LEN];
+	uint8_t len;
+
+	si_buf[0] = si_type;
+	if (enable) {
+		memcpy(si_buf + 1, GSM_BTS_SI(bts, si_type), GSM_MACBLOCK_LEN);
+		len = 1 + GSM_MACBLOCK_LEN;
+		LOGP(DPCU, LOGL_DEBUG, "Updating SI%s to PCU: %s\n",
+		     get_value_string(osmo_sitype_strs, si_buf[0]),
+		     osmo_hexdump_nospc(si_buf + 1, GSM_MACBLOCK_LEN));
+	} else {
+		len = 1;
+		LOGP(DPCU, LOGL_DEBUG, "Revoking SI%s from PCU\n",
+		     get_value_string(osmo_sitype_strs, si_buf[0]));
+	}
+
 	/* The low-level data like FN, ARFCN etc will be ignored but we have to set lqual high enough to bypass
 	   the check at lower levels */
-	int rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, GSM_BTS_SI(bts, SYSINFO_TYPE_13),
-				 enable ? GSM_MACBLOCK_LEN : 0, 0, 0, 0, INT16_MAX);
+	int rc =
+	    pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, si_buf, len,
+			    0, 0, 0, INT16_MAX);
 	if (rc < 0)
-		LOGP(DPCU, LOGL_NOTICE, "Failed to send SI13 to PCU: %d\n", rc);
+		LOGP(DPCU, LOGL_NOTICE, "Failed to send SI%s to PCU: rc=%d\n",
+		     get_value_string(osmo_sitype_strs, si_type), rc);
+
+	return rc;
+}
+
+static int pcu_tx_si_all(struct gsm_bts *bts)
+{
+	enum osmo_sysinfo_type si_types[3] =
+	    { SYSINFO_TYPE_1, SYSINFO_TYPE_3, SYSINFO_TYPE_13 };
+	unsigned int i;
+	int rc;
+
+	for (i = 0; i < ARRAY_SIZE(si_types); i++) {
+		if (GSM_BTS_HAS_SI(bts, si_types[i])) {
+			rc = pcu_tx_si(bts, si_types[i], true);
+			if (rc < 0)
+				rc = -EINVAL;
+		} else
+			LOGP(DPCU, LOGL_INFO,
+			     "SI%s is not available on PCU connection\n",
+			     get_value_string(osmo_sitype_strs, si_types[i]));
+	}
 
 	return rc;
 }
@@ -743,6 +783,8 @@
 static int pcu_rx_txt_ind(struct gsm_bts *bts,
 			  struct gsm_pcu_if_txt_ind *txt)
 {
+	int rc;
+
 	switch (txt->type) {
 	case PCU_VERSION:
 		LOGP(DPCU, LOGL_INFO, "OsmoPCU version %s connected\n",
@@ -754,10 +796,10 @@
 		regenerate_si3_restoctets(bts);
 		regenerate_si4_restoctets(bts);
 
-		if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13))
-			return pcu_tx_si13(bts, true);
+		rc = pcu_tx_si_all(bts);
+		if (rc < 0)
+			return -EINVAL;
 
-		LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n");
 		break;
 	case PCU_OML_ALERT:
 		oml_tx_failure_event_rep(&bts->gprs.cell.mo, NM_SEVER_INDETERMINATE, OSMO_EVT_EXT_ALARM,
diff --git a/src/common/rsl.c b/src/common/rsl.c
index b4df22c..f85220e 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -379,6 +379,7 @@
 			/* patch out GPRS indicator from binary if PCU is not connected; will be enabled
 			 * after PCU connects */
 			regenerate_si3_restoctets(bts);
+			pcu_tx_si(trx->bts, SYSINFO_TYPE_3, true);
 		} else if (SYSINFO_TYPE_4 == osmo_si) {
 			/* decode original SI4 Rest Octets as sent by BSC */
 			const uint8_t *si4 = (uint8_t *) GSM_BTS_SI(bts, osmo_si);
@@ -394,7 +395,10 @@
 		}
 
 		if (SYSINFO_TYPE_13 == osmo_si)
-			pcu_tx_si13(trx->bts, true);
+			pcu_tx_si(trx->bts, SYSINFO_TYPE_13, true);
+
+		if (SYSINFO_TYPE_1 == osmo_si)
+			pcu_tx_si(trx->bts, SYSINFO_TYPE_1, true);
 
 	} else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
 		uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO);
@@ -411,9 +415,13 @@
 		LOGP(DRSL, LOGL_INFO, " RX RSL Disabling BCCH INFO (SI%s)\n",
 			get_value_string(osmo_sitype_strs, osmo_si));
 		if (SYSINFO_TYPE_13 == osmo_si)
-			pcu_tx_si13(trx->bts, false);
-		if (SYSINFO_TYPE_3 == osmo_si)
+			pcu_tx_si(trx->bts, SYSINFO_TYPE_13, false);
+		if (SYSINFO_TYPE_3 == osmo_si) {
 			memset(&bts->si3_ro_decoded, 0, sizeof(bts->si3_ro_decoded));
+			pcu_tx_si(trx->bts, SYSINFO_TYPE_3, false);
+		}
+		if (SYSINFO_TYPE_1 == osmo_si)
+			pcu_tx_si(trx->bts, SYSINFO_TYPE_1, false);
 	}
 	osmo_signal_dispatch(SS_GLOBAL, S_NEW_SYSINFO, bts);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/22541
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib7aeb41e634ad6fcab3766a4667b0267c749436a
Gerrit-Change-Number: 22541
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210129/30cac121/attachment.htm>


More information about the gerrit-log mailing list