Change in osmocom-bb[master]: layer23/cbch-sniff: fix: use Osmocom specific RSL channel number

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Oct 7 20:38:59 UTC 2020


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/20476 )


Change subject: layer23/cbch-sniff: fix: use Osmocom specific RSL channel number
......................................................................

layer23/cbch-sniff: fix: use Osmocom specific RSL channel number

This way the layer1 can activate proper CBCH task and send us
CBCH block with proper RSL channel number, so they do not end
up being routed to LAPDm and rejected there.

Change-Id: Ib1d5c99587202a9d94aeb7b63de7ae8c4fb15af0
---
M src/host/layer23/src/misc/app_cbch_sniff.c
1 file changed, 13 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/76/20476/1

diff --git a/src/host/layer23/src/misc/app_cbch_sniff.c b/src/host/layer23/src/misc/app_cbch_sniff.c
index 58b3324..ed85cef 100644
--- a/src/host/layer23/src/misc/app_cbch_sniff.c
+++ b/src/host/layer23/src/misc/app_cbch_sniff.c
@@ -34,6 +34,8 @@
 #include <osmocom/core/signal.h>
 #include <osmocom/gsm/rsl.h>
 
+#include <osmocom/gsm/protocol/gsm_08_58.h>
+
 #include <l1ctl_proto.h>
 
 struct osmocom_ms *g_ms;
@@ -41,6 +43,8 @@
 
 static int try_cbch(struct osmocom_ms *ms, struct gsm48_sysinfo *s)
 {
+	uint8_t chan_nr;
+
 	if (!s->si1 || !s->si4)
 		return 0;
 	if (!s->chan_nr) {
@@ -48,6 +52,13 @@
 		return 0;
 	}
 
+	/* Convert received channel number to Osmocom specific one;
+	 * this way the layer1 can activate proper CBCH task. */
+	if (s->chan_nr != RSL_CHAN_SDCCH4_ACCH)
+		chan_nr = RSL_CHAN_OSMO_CBCH8 | (s->chan_nr & 0x07);
+	else
+		chan_nr = RSL_CHAN_OSMO_CBCH4;
+
 	if (s->h) {
 		LOGP(DRR, LOGL_INFO, "chan_nr = 0x%02x TSC = %d  MAIO = %d  "
 			"HSN = %d  hseq (%d): %s\n",
@@ -56,13 +67,13 @@
 			osmo_hexdump((unsigned char *) s->hopping, s->hopp_len * 2));
 		return l1ctl_tx_dm_est_req_h1(ms,
 			s->maio, s->hsn, s->hopping, s->hopp_len,
-			s->chan_nr, s->tsc,
+			chan_nr, s->tsc,
 			GSM48_CMODE_SIGN, 0);
 	} else {
 		LOGP(DRR, LOGL_INFO, "chan_nr = 0x%02x TSC = %d  ARFCN = %d\n",
 			s->chan_nr, s->tsc, s->arfcn);
 		return l1ctl_tx_dm_est_req_h0(ms, s->arfcn,
-			s->chan_nr, s->tsc, GSM48_CMODE_SIGN, 0);
+			chan_nr, s->tsc, GSM48_CMODE_SIGN, 0);
 	}
 }
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ib1d5c99587202a9d94aeb7b63de7ae8c4fb15af0
Gerrit-Change-Number: 20476
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201007/c0d69233/attachment.htm>


More information about the gerrit-log mailing list