summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-08 03:35:38 +0700
committerlaforge <laforge@osmocom.org>2020-10-13 08:46:11 +0000
commite42e5a078926c63523235bdd8b0e84371effd592 (patch)
tree1202abd706802f7e92a16473470d766e44fba233 /src
parent3c39ba4b949c9bf696879a14e3bfced2e1daec11 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/src/misc/app_cbch_sniff.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/host/layer23/src/misc/app_cbch_sniff.c b/src/host/layer23/src/misc/app_cbch_sniff.c
index 58b33241..ed85cefe 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 @@ struct gsm48_sysinfo g_sysinfo = {};
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 @@ static int try_cbch(struct osmocom_ms *ms, struct gsm48_sysinfo *s)
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 @@ static int try_cbch(struct osmocom_ms *ms, struct gsm48_sysinfo *s)
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);
}
}