Change in osmo-bsc[master]: gsm48_lchan2chan_desc(): expose TSC as param

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

neels gerrit-no-reply at lists.osmocom.org
Tue Jun 1 17:29:45 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24368 )

Change subject: gsm48_lchan2chan_desc(): expose TSC as param
......................................................................

gsm48_lchan2chan_desc(): expose TSC as param

Expose the training sequence code used in the RSL Channel Description IE
as an input parameter.

So far the Channel Description IE is always composed with a training
sequence code from gsm_ts_tsc(). For RSL commands enabling VAMOS mode,
specific training sequence codes are required.

So far, all callers still use gsm_ts_tsc(), making this a patch without
any functional change. Upcoming patches will pass specific TSC as
configured for VAMOS instead, in specific places.

Related: SYS#5315 OS#4940
Change-Id: I49503a6f5d25bb3bc9a0505bd79ed1d5c4f50577
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/lcs_loc_req.c
M src/osmo-bsc/system_information.c
6 files changed, 21 insertions(+), 16 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 348735e..f469e41 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1003,8 +1003,10 @@
 				   enum gsm_phys_chan_config as_pchan);
 
 void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
-			   const struct gsm_lchan *lchan);
-void gsm48_lchan2chan_desc_as_configured(struct gsm48_chan_desc *cd, const struct gsm_lchan *lchan);
+			   const struct gsm_lchan *lchan,
+			   uint8_t tsc);
+void gsm48_lchan2chan_desc_as_configured(struct gsm48_chan_desc *cd, const struct gsm_lchan *lchan,
+					 uint8_t tsc);
 
 uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts);
 
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 1c2b1cd..c2a2005 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -528,7 +528,7 @@
 	}
 
 	memset(&cd, 0, sizeof(cd));
-	gsm48_lchan2chan_desc(&cd, lchan);
+	gsm48_lchan2chan_desc(&cd, lchan, gsm_ts_tsc(lchan->ts));
 
 	msg = rsl_msgb_alloc();
 	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
@@ -1801,7 +1801,7 @@
 	ia->proto_discr = GSM48_PDISC_RR;
 	ia->msg_type = GSM48_MT_RR_IMM_ASS;
 	ia->page_mode = GSM48_PM_SAME;
-	gsm48_lchan2chan_desc(&ia->chan_desc, lchan);
+	gsm48_lchan2chan_desc(&ia->chan_desc, lchan, gsm_ts_tsc(lchan->ts));
 
 	/* use request reference extracted from CHAN_RQD */
 	memcpy(&ia->req_ref, lchan->rqd_ref, sizeof(ia->req_ref));
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 302ea33..153f102 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -546,7 +546,7 @@
 
 	/* mandatory bits */
 	gsm48_cell_desc(&ho->cell_desc, new_lchan->ts->trx->bts);
-	gsm48_lchan2chan_desc(&ho->chan_desc, new_lchan);
+	gsm48_lchan2chan_desc(&ho->chan_desc, new_lchan, gsm_ts_tsc(new_lchan->ts));
 	ho->ho_ref = ho_ref;
 	ho->power_command = power_command;
 
@@ -618,7 +618,7 @@
 	 * the chan_desc. But as long as multi-slot configurations
 	 * are not used we seem to be fine.
 	 */
-	gsm48_lchan2chan_desc(&ass->chan_desc, new_lchan);
+	gsm48_lchan2chan_desc(&ass->chan_desc, new_lchan, gsm_ts_tsc(new_lchan->ts));
 	ass->power_command = power_command;
 
 	/* Cell Channel Description (freq. hopping), TV (see 3GPP TS 44.018, 10.5.2.1b) */
@@ -690,7 +690,7 @@
 
 	/* fill the channel information element, this code
 	 * should probably be shared with rsl_rx_chan_rqd() */
-	gsm48_lchan2chan_desc(&cmm->chan_desc, lchan);
+	gsm48_lchan2chan_desc(&cmm->chan_desc, lchan, gsm_ts_tsc(lchan->ts));
 	cmm->mode = mode;
 
 	/* in case of multi rate we need to attach a config */
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 0c85503..b676e2f 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -596,17 +596,18 @@
 	return conn->lchan->ts->trx->bts;
 }
 
-static void _chan_desc_fill_tail(struct gsm48_chan_desc *cd, const struct gsm_lchan *lchan)
+static void _chan_desc_fill_tail(struct gsm48_chan_desc *cd, const struct gsm_lchan *lchan,
+				 uint8_t tsc)
 {
 	if (!lchan->ts->hopping.enabled) {
 		uint16_t arfcn = lchan->ts->trx->arfcn & 0x3ff;
-		cd->h0.tsc = gsm_ts_tsc(lchan->ts);
+		cd->h0.tsc = tsc;
 		cd->h0.h = 0;
 		cd->h0.spare = 0;
 		cd->h0.arfcn_high = arfcn >> 8;
 		cd->h0.arfcn_low = arfcn & 0xff;
 	} else {
-		cd->h1.tsc = gsm_ts_tsc(lchan->ts);
+		cd->h1.tsc = tsc;
 		cd->h1.h = 1;
 		cd->h1.maio_high = lchan->ts->hopping.maio >> 2;
 		cd->h1.maio_low = lchan->ts->hopping.maio & 0x03;
@@ -615,20 +616,22 @@
 }
 
 void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
-			   const struct gsm_lchan *lchan)
+			   const struct gsm_lchan *lchan,
+			   uint8_t tsc)
 {
 	cd->chan_nr = gsm_lchan2chan_nr(lchan);
-	_chan_desc_fill_tail(cd, lchan);
+	_chan_desc_fill_tail(cd, lchan, tsc);
 }
 
 /* like gsm48_lchan2chan_desc() above, but use ts->pchan_from_config to
  * return a channel description based on what is configured, rather than
  * what the current state of the pchan type is */
 void gsm48_lchan2chan_desc_as_configured(struct gsm48_chan_desc *cd,
-					 const struct gsm_lchan *lchan)
+					 const struct gsm_lchan *lchan,
+					 uint8_t tsc)
 {
 	cd->chan_nr = gsm_pchan2chan_nr(lchan->ts->pchan_from_config, lchan->ts->nr, lchan->nr);
-	_chan_desc_fill_tail(cd, lchan);
+	_chan_desc_fill_tail(cd, lchan, tsc);
 }
 
 uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
diff --git a/src/osmo-bsc/lcs_loc_req.c b/src/osmo-bsc/lcs_loc_req.c
index 39bc341..ef9ee27 100644
--- a/src/osmo-bsc/lcs_loc_req.c
+++ b/src/osmo-bsc/lcs_loc_req.c
@@ -369,7 +369,7 @@
 				.cause = BSSLAP_CAUSE_INTRA_BSS_HO,
 			},
 		};
-		gsm48_lchan2chan_desc(&apdu->reset.chan_desc, lchan);
+		gsm48_lchan2chan_desc(&apdu->reset.chan_desc, lchan, gsm_ts_tsc(lchan->ts));
 	}
 
 	lcs_loc_req_send(lcs_loc_req, &bsslap);
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c
index 7ec613c..eddc650 100644
--- a/src/osmo-bsc/system_information.c
+++ b/src/osmo-bsc/system_information.c
@@ -1018,7 +1018,7 @@
 		struct gsm48_chan_desc cd;
 
 		/* 10.5.2.5 (TV) CBCH Channel Description IE */
-		gsm48_lchan2chan_desc_as_configured(&cd, cbch_lchan);
+		gsm48_lchan2chan_desc_as_configured(&cd, cbch_lchan, gsm_ts_tsc(cbch_lchan->ts));
 		tail = tv_fixed_put(tail, GSM48_IE_CBCH_CHAN_DESC,
 				    sizeof(cd), (uint8_t *) &cd);
 		l2_plen += 1 + sizeof(cd);

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I49503a6f5d25bb3bc9a0505bd79ed1d5c4f50577
Gerrit-Change-Number: 24368
Gerrit-PatchSet: 9
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210601/3edccdea/attachment.htm>


More information about the gerrit-log mailing list