[PATCH] osmo-bts[master]: Fix AGCH/PCH proportional static allocation

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

Max gerrit-no-reply at lists.osmocom.org
Thu Oct 13 11:17:46 UTC 2016


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1047

to look at the new patch set (#3).

Fix AGCH/PCH proportional static allocation

Do not assume that 1 == BS_AG_BLKS_RES but take that information from
SI3. Note: this implements static variant - changing BS_AG_BLKS_RES on
OpenBSC side will not affect BTS after initial value has been acquired.

Change-Id: Ib9e0705234ef53d2c70bea6b6dd542176e58145d
Related: OS#1575
---
M include/osmo-bts/bts.h
M src/common/l1sap.c
M src/common/paging.c
M src/common/sysinfo.c
M src/osmo-bts-litecell15/l1_if.c
M src/osmo-bts-litecell15/oml.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-sysmo/l1_if.c
M src/osmo-bts-sysmo/oml.c
9 files changed, 22 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/1047/3

diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index ec58edd..1e4ace8 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -36,7 +36,7 @@
 int lchan_init_lapdm(struct gsm_lchan *lchan);
 
 void load_timer_start(struct gsm_bts *bts);
-
+uint8_t num_agch(struct gsm_bts_trx *trx);
 void bts_update_status(enum bts_global_status which, int on);
 
 int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 0b9930e..ebb300a 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -205,7 +205,8 @@
 
 /* send primitive as gsmtap */
 static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type,
-			  uint8_t *ss, uint32_t fn, uint8_t **data, int *len)
+			  uint8_t *ss, uint32_t fn, uint8_t **data, int *len,
+			  uint8_t num_agch)
 {
 	struct msgb *msg = l1sap->oph.msg;
 	uint8_t chan_nr, link_id;
@@ -229,10 +230,9 @@
 	} else if (L1SAP_IS_CHAN_BCCH(chan_nr)) {
 		*chan_type = GSMTAP_CHANNEL_BCCH;
 	} else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) {
-#warning Set BS_AG_BLKS_RES
 		/* The sapi depends on DSP configuration, not
 		 * on the actual SYSTEM INFORMATION 3. */
-		if (L1SAP_FN2CCCHBLOCK(fn) >= 1)
+		if (L1SAP_FN2CCCHBLOCK(fn) >= num_agch)
 			*chan_type = GSMTAP_CHANNEL_PCH;
 		else
 			*chan_type = GSMTAP_CHANNEL_AGCH;
@@ -312,7 +312,7 @@
 					 &len);
 		else
 			rc = gsmtap_ph_data(l1sap, &chan_type, &ss, fn, &data,
-					    &len);
+					    &len, num_agch(trx));
 		break;
 	case OSMO_PRIM(PRIM_PH_RACH, PRIM_OP_INDICATION):
 		rc = gsmtap_ph_rach(l1sap, &chan_type, &tn, &ss, &fn, &data,
@@ -616,11 +616,10 @@
 			msgb_free(pp.oph.msg);
 		}
 	} else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) {
+		LOGP(DL1P, LOGL_ERROR, "AGCH/PCH: %d\n", num_agch(trx));
 		p = msgb_put(msg, GSM_MACBLOCK_LEN);
-#warning "TODO: Yet another assumption that BS_AG_BLKS_RES=1"
-		/* if CCCH block is 0, it is AGCH */
 		rc = bts_ccch_copy_msg(trx->bts, p, &g_time,
-			(L1SAP_FN2CCCHBLOCK(fn) < 1));
+			(L1SAP_FN2CCCHBLOCK(fn) < num_agch(trx)));
 		if (rc <= 0)
 			memcpy(p, fill_frame, GSM_MACBLOCK_LEN);
 	}
diff --git a/src/common/paging.c b/src/common/paging.c
index f75f12d..957d609 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -538,12 +538,6 @@
 		struct paging_state *ps = btsb->paging_state;
 		struct gsm48_system_information_type_3 *si3 = (void *) bts->si_buf[SYSINFO_TYPE_3];
 
-#warning "TODO: Remove this when setting u8NbrOfAgch is implemented properly"
-		if (si3->control_channel_desc.bs_ag_blks_res != 1)
-			LOGP(DPAG, LOGL_ERROR,
-			     "Paging: BS_AG_BLKS_RES = %d != 1 not fully supported\n",
-			     si3->control_channel_desc.bs_ag_blks_res);
-
 		paging_si_update(ps, &si3->control_channel_desc);
 	}
 	return 0;
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index ee42da2..d47f392 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -132,6 +132,17 @@
 	return NULL;
 }
 
+uint8_t num_agch(struct gsm_bts_trx *trx)
+{
+	struct gsm_bts *b = trx->bts;
+	struct gsm48_system_information_type_3 *si3;
+	if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) {
+		si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3);
+		return si3->control_channel_desc.bs_ag_blks_res;
+	}
+	return 1;
+}
+
 uint8_t *lchan_sacch_get(struct gsm_lchan *lchan)
 {
 	uint32_t tmp;
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index f47634e..af50343 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -1107,22 +1107,6 @@
 	return l1if_handle_ind(fl1h, msg);
 }
 
-#if 0
-/* called by RSL if the BCCH SI has been modified */
-int sysinfo_has_changed(struct gsm_bts *bts, int si)
-{
-	/* FIXME: Determine BS_AG_BLKS_RES and 
-	 *  	* set cfgParams.u.agch.u8NbrOfAgch
-	 *	* determine implications on paging
-	 */
-	/* FIXME: Check for Extended BCCH presence */
-	/* FIXME: Check for CCCH_CONF */
-	/* FIXME: Check for BS_PA_MFRMS: update paging */
-
-	return 0;
-}
-#endif
-
 static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
 				void *data)
 {
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 634c236..8fdf136 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -1024,8 +1024,7 @@
 		lch_par->rach.u8Bsic = lchan->ts->trx->bts->bsic;
 		break;
 	case GsmL1_Sapi_Agch:
-#warning Set BS_AG_BLKS_RES
-		lch_par->agch.u8NbrOfAgch = 1;
+		lch_par->agch.u8NbrOfAgch = num_agch(lchan->ts->trx);
 		break;
 	case GsmL1_Sapi_TchH:
 	case GsmL1_Sapi_TchF:
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index c4105ac..2f28cd6 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -487,6 +487,8 @@
 		sapi = cOCTVC1_GSM_SAPI_ENUM_BCCH;
 	} else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) {
 #warning Set BS_AG_BLKS_RES
+		/* FIXME: how does octphy differentiate between AGCH and PCH?
+		   How to supply num_of_agch properly? */
 		sapi = cOCTVC1_GSM_SAPI_ENUM_PCH_AGCH;
 	} else {
 		LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d "
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index bef2d30..8ae2ff5 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1132,22 +1132,6 @@
 	return l1if_handle_ind(fl1h, msg);
 }
 
-#if 0
-/* called by RSL if the BCCH SI has been modified */
-int sysinfo_has_changed(struct gsm_bts *bts, int si)
-{
-	/* FIXME: Determine BS_AG_BLKS_RES and 
-	 *  	* set cfgParams.u.agch.u8NbrOfAgch
-	 *	* determine implications on paging
-	 */
-	/* FIXME: Check for Extended BCCH presence */
-	/* FIXME: Check for CCCH_CONF */
-	/* FIXME: Check for BS_PA_MFRMS: update paging */
-
-	return 0;
-}
-#endif
-
 static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
 				void *data)
 {
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index c1f1e0b..e7e7690 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -1039,8 +1039,7 @@
 		lch_par->rach.u8Bsic = lchan->ts->trx->bts->bsic;
 		break;
 	case GsmL1_Sapi_Agch:
-#warning Set BS_AG_BLKS_RES
-		lch_par->agch.u8NbrOfAgch = 1;
+		lch_par->agch.u8NbrOfAgch = num_agch(lchan->ts->trx);
 		break;
 	case GsmL1_Sapi_TchH:
 	case GsmL1_Sapi_TchF:

-- 
To view, visit https://gerrit.osmocom.org/1047
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib9e0705234ef53d2c70bea6b6dd542176e58145d
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list