summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-10-04 06:35:06 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-11-21 11:03:10 +0700
commit7f16bc070eb4649d536afb1de1c0594c91131709 (patch)
tree7693d57aa509a2c1998ceb3159c909d2f086e573 /src
parent6168f6a49968eb4eece5637b04c35b32e3bc8112 (diff)
(WIP) misc/cbch_sacn: indicate CBCH cbits to L1/PHY
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/src/misc/app_cbch_sniff.c10
1 files changed, 8 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 8256eaf6..4d50c156 100644
--- a/src/host/layer23/src/misc/app_cbch_sniff.c
+++ b/src/host/layer23/src/misc/app_cbch_sniff.c
@@ -48,6 +48,12 @@ static int try_cbch(struct osmocom_ms *ms, struct gsm48_sysinfo *s)
return 0;
}
+#define L1SAP_CHAN_IS_SDCCH4(chan_nr) ((chan_nr >> 3) & 3)
+#define L1SAP_CHAN_IS_SDCCH8(chan_nr) ((chan_nr >> 3) & 7)
+#define L1SAP_SDCCH_TO_CBCH(chan_nr) \
+ (L1SAP_CHAN_IS_SDCCH4(chan_nr) ? ((0x18 << 3) | (chan_nr & 0x07)) \
+ : L1SAP_CHAN_IS_SDCCH8(chan_nr) ? ((0x19 << 3) | (chan_nr & 0x07)) : 0x00)
+
if (s->h) {
LOGP(DRR, LOGL_INFO, "chan_nr = 0x%02x TSC = %d MAIO = %d "
"HSN = %d hseq (%d): %s\n",
@@ -56,13 +62,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,
+ L1SAP_SDCCH_TO_CBCH(s->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);
+ L1SAP_SDCCH_TO_CBCH(s->chan_nr), s->tsc, GSM48_CMODE_SIGN, 0);
}
}