Change in osmo-bts[master]: [VAMOS] gsm_data.h: introduce and use BTS_TSC macro

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

laforge gerrit-no-reply at lists.osmocom.org
Sun May 23 10:09:27 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/24338 )

Change subject: [VAMOS] gsm_data.h: introduce and use BTS_TSC macro
......................................................................

[VAMOS] gsm_data.h: introduce and use BTS_TSC macro

Change-Id: I0cf915d2d3a640aa1442cf6abe9a314261b4a64e
Related: SYS#5315, OS#4940
---
M include/osmo-bts/gsm_data.h
M src/common/gsm_data.c
M src/common/l1sap.c
M src/common/oml.c
M src/osmo-bts-lc15/oml.c
M src/osmo-bts-oc2g/oml.c
M src/osmo-bts-octphy/l1_oml.c
M src/osmo-bts-sysmo/oml.c
8 files changed, 15 insertions(+), 14 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 69b18bc..3dfd5b7 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -520,6 +520,7 @@
 				   enum gsm_phys_chan_config as_pchan);
 
 #define BSIC2BCC(bsic) ((bsic) & 0x07)
+#define BTS_TSC(bts) BSIC2BCC((bts)->bsic)
 
 uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts);
 
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c
index f109722..f014acf 100644
--- a/src/common/gsm_data.c
+++ b/src/common/gsm_data.c
@@ -277,7 +277,7 @@
 	if (ts->tsc != -1)
 		return ts->tsc;
 	else
-		return ts->trx->bts->bsic & 7;
+		return BTS_TSC(ts->trx->bts);
 }
 
 /* determine logical channel based on TRX and channel number IE */
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index b74e0d3..45abe4e 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1975,10 +1975,10 @@
 
 		/* The PHY may not support using different TSCs */
 		if (!osmo_bts_has_feature(trx->bts->features, BTS_FEAT_MULTI_TSC)
-		    && cd->h0.tsc != (trx->bts->bsic & 7)) {
+		    && cd->h0.tsc != BTS_TSC(trx->bts)) {
 			LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "This PHY does not support "
 				  "lchan TSC %u != BSIC-TSC %u, sending NACK\n",
-				  cd->h0.tsc, trx->bts->bsic & 7);
+				  cd->h0.tsc, BTS_TSC(trx->bts));
 			return -RSL_ERR_SERV_OPT_UNIMPL;
 		}
 	}
diff --git a/src/common/oml.c b/src/common/oml.c
index c32260b..0bbe0a6 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -964,7 +964,7 @@
 		ts->tsc = *TLVP_VAL(&tp, NM_ATT_TSC);
 	} else {
 		/* If there is no TSC specified, use the BCC */
-		ts->tsc = BSIC2BCC(bts->bsic);
+		ts->tsc = BTS_TSC(bts);
 	}
 	LOGPFOH(DOML, LOGL_INFO, foh, "SET CHAN ATTR (TSC=%u pchan=%s",
 		ts->tsc, gsm_pchan_name(ts->pchan));
diff --git a/src/osmo-bts-lc15/oml.c b/src/osmo-bts-lc15/oml.c
index 39d0e5e..3010fe7 100644
--- a/src/osmo-bts-lc15/oml.c
+++ b/src/osmo-bts-lc15/oml.c
@@ -432,7 +432,7 @@
 	dev_par->freqBand = lc15_band;
 	dev_par->u16Arfcn = trx->arfcn;
 	dev_par->u16BcchArfcn = trx->bts->c0->arfcn;
-	dev_par->u8NbTsc = trx->bts->bsic & 7;
+	dev_par->u8NbTsc = BTS_TSC(trx->bts);
 
 	if (!trx_ms_pwr_ctrl_is_osmo(trx)) {
 		/* Target is in the middle between lower and upper RxLev thresholds */
@@ -1835,9 +1835,9 @@
 		 * channels with a different TSC!! */
 		if (TLVP_PRESENT(new_attr, NM_ATT_TSC) &&
 		    TLVP_LEN(new_attr, NM_ATT_TSC) >= 1 &&
-		    *TLVP_VAL(new_attr, NM_ATT_TSC) != (bts->bsic & 7)) {
+		    *TLVP_VAL(new_attr, NM_ATT_TSC) != BTS_TSC(bts)) {
 			LOGP(DOML, LOGL_ERROR, "Channel TSC %u != BSIC-TSC %u\n",
-				*TLVP_VAL(new_attr, NM_ATT_TSC), bts->bsic & 7);
+				*TLVP_VAL(new_attr, NM_ATT_TSC), BTS_TSC(bts));
 			return -NM_NACK_PARAM_RANGE;
 		}
 		break;
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index 8fd3688..151b92e 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -447,7 +447,7 @@
 	dev_par->freqBand = oc2g_band;
 	dev_par->u16Arfcn = trx->arfcn;
 	dev_par->u16BcchArfcn = trx->bts->c0->arfcn;
-	dev_par->u8NbTsc = trx->bts->bsic & 7;
+	dev_par->u8NbTsc = BTS_TSC(trx->bts);
 
 	if (!trx_ms_pwr_ctrl_is_osmo(trx)) {
 		/* Target is in the middle between lower and upper RxLev thresholds */
@@ -1844,9 +1844,9 @@
 		 * channels with a different TSC!! */
 		if (TLVP_PRESENT(new_attr, NM_ATT_TSC) &&
 		    TLVP_LEN(new_attr, NM_ATT_TSC) >= 1 &&
-		    *TLVP_VAL(new_attr, NM_ATT_TSC) != (bts->bsic & 7)) {
+		    *TLVP_VAL(new_attr, NM_ATT_TSC) != BTS_TSC(bts)) {
 			LOGP(DOML, LOGL_ERROR, "Channel TSC %u != BSIC-TSC %u\n",
-				*TLVP_VAL(new_attr, NM_ATT_TSC), bts->bsic & 7);
+				*TLVP_VAL(new_attr, NM_ATT_TSC), BTS_TSC(bts));
 			return -NM_NACK_PARAM_RANGE;
 		}
 		break;
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index b7f4935..9bd01f4 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1352,7 +1352,7 @@
 	}
 	oc->Config.usBcchArfcn = trx->bts->c0->arfcn;
 #endif
-	oc->Config.usTsc = trx->bts->bsic & 0x7;
+	oc->Config.usTsc = BTS_TSC(trx->bts);
 	oc->RfConfig.ulRxGainDb = plink->u.octphy.rx_gain_db;
 	/* FIXME: compute this based on nominal transmit power, etc. */
 	if (plink->u.octphy.tx_atten_flag) {
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index ac3176c..25c5651 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -427,7 +427,7 @@
 	dev_par->freqBand = femto_band;
 	dev_par->u16Arfcn = trx->arfcn;
 	dev_par->u16BcchArfcn = trx->bts->c0->arfcn;
-	dev_par->u8NbTsc = trx->bts->bsic & 7;
+	dev_par->u8NbTsc = BTS_TSC(trx->bts);
 
 	if (!trx_ms_pwr_ctrl_is_osmo(trx)) {
 		/* Target is in the middle between lower and upper RxLev thresholds */
@@ -1748,9 +1748,9 @@
 		 * one one TRX, so we need to make sure not to activate
 		 * channels with a different TSC!! */
 		if (TLVP_PRES_LEN(new_attr, NM_ATT_TSC, 1) &&
-		    *TLVP_VAL(new_attr, NM_ATT_TSC) != (bts->bsic & 7)) {
+		    *TLVP_VAL(new_attr, NM_ATT_TSC) != BTS_TSC(bts)) {
 			LOGP(DOML, LOGL_ERROR, "Channel TSC %u != BSIC-TSC %u\n",
-				*TLVP_VAL(new_attr, NM_ATT_TSC), bts->bsic & 7);
+				*TLVP_VAL(new_attr, NM_ATT_TSC), BTS_TSC(bts));
 			return -NM_NACK_PARAM_RANGE;
 		}
 		break;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I0cf915d2d3a640aa1442cf6abe9a314261b4a64e
Gerrit-Change-Number: 24338
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210523/17e0f31f/attachment.htm>


More information about the gerrit-log mailing list