Change in osmo-bts[master]: pcu_sock: warn about maximum transceiver number constraints

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Sun Aug 2 19:50:05 UTC 2020


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


Change subject: pcu_sock: warn about maximum transceiver number constraints
......................................................................

pcu_sock: warn about maximum transceiver number constraints

Change-Id: I600860b12758a73e1bba6d9d508cf67c3d88cf34
---
M src/common/pcu_sock.c
1 file changed, 15 insertions(+), 11 deletions(-)



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

diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 0125793..ca8dd15 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -215,13 +215,17 @@
 		info_ind->remote_ip[i] = nsvc->remote_ip;
 	}
 
-	for (i = 0; i < 8; i++) {
-		trx = gsm_bts_trx_num(bts, i);
-		if (!trx)
-			break;
-		info_ind->trx[i].pdch_mask = 0;
-		info_ind->trx[i].arfcn = trx->arfcn;
-		info_ind->trx[i].hlayer1 = trx_get_hlayer1(trx);
+	llist_for_each_entry(trx, &bts->trx_list, list) {
+		if (trx->nr >= ARRAY_SIZE(info_ind->trx)) {
+			LOGPTRX(trx, DPCU, LOGL_NOTICE, "PCU interface (version %u) "
+				"cannot handle more than %zu transceivers => skipped\n",
+				PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx));
+			continue;
+		}
+
+		info_ind->trx[trx->nr].pdch_mask = 0;
+		info_ind->trx[trx->nr].arfcn = trx->arfcn;
+		info_ind->trx[trx->nr].hlayer1 = trx_get_hlayer1(trx);
 		if (trx->mo.nm_state.operational != NM_OPSTATE_ENABLED ||
 		    trx->mo.nm_state.administrative != NM_STATE_UNLOCKED) {
 			    LOGPTRX(trx, DPCU, LOGL_INFO, "unavailable for PCU (op=%s adm=%s)\n",
@@ -233,14 +237,14 @@
 			ts = &trx->ts[j];
 			if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED
 			    && ts_should_be_pdch(ts)) {
-				info_ind->trx[i].pdch_mask |= (1 << j);
-				info_ind->trx[i].tsc[j] = gsm_ts_tsc(ts);
+				info_ind->trx[trx->nr].pdch_mask |= (1 << j);
+				info_ind->trx[trx->nr].tsc[j] = gsm_ts_tsc(ts);
 
 				LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: "
 					"available (tsc=%d arfcn=%d)\n",
 					trx->nr, ts->nr,
-					info_ind->trx[i].tsc[j],
-					info_ind->trx[i].arfcn);
+					info_ind->trx[trx->nr].tsc[j],
+					info_ind->trx[trx->nr].arfcn);
 			}
 		}
 	}

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I600860b12758a73e1bba6d9d508cf67c3d88cf34
Gerrit-Change-Number: 19510
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200802/30da1b8e/attachment.htm>


More information about the gerrit-log mailing list