From 7f16bc070eb4649d536afb1de1c0594c91131709 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 4 Oct 2018 06:35:06 +0700 Subject: (WIP) misc/cbch_sacn: indicate CBCH cbits to L1/PHY Change-Id: If19f2b2ed645c0f6f5baf7ed853b41011603f1a0 --- src/host/layer23/src/misc/app_cbch_sniff.c | 10 ++++++++-- 1 file 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); } } -- cgit v1.2.3