diff options
author | Harald Welte <laforge@gnumonks.org> | 2014-01-19 16:55:16 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-01-19 16:55:16 +0100 |
commit | cd4e74df95e0bbb18a46062d028f7e726f8916d4 (patch) | |
tree | 9417607629eecf127742089d9e12c1b3fc47c8e2 /openbsc/src/libbsc | |
parent | 1dc022cb620e4e30953cfe72fe743431853df466 (diff) |
Make gsm48_lchan2chan_desc() reflect a ts-specific TSC
If the TS has a specific, different TSC than the BTS (beacon),
we should use that with preference over the TSC of the BTS.
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r-- | openbsc/src/libbsc/gsm_04_08_utils.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c index a0e7e5d78..735997ef1 100644 --- a/openbsc/src/libbsc/gsm_04_08_utils.c +++ b/openbsc/src/libbsc/gsm_04_08_utils.c @@ -341,15 +341,21 @@ void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd, const struct gsm_lchan *lchan) { uint16_t arfcn = lchan->ts->trx->arfcn & 0x3ff; + uint8_t tsc; + + if (lchan->ts->tsc == -1) + tsc = lchan->ts->trx->bts->tsc; + else + tsc = lchan->ts->tsc; cd->chan_nr = gsm_lchan2chan_nr(lchan); if (!lchan->ts->hopping.enabled) { - cd->h0.tsc = lchan->ts->trx->bts->tsc; + cd->h0.tsc = tsc; cd->h0.h = 0; cd->h0.arfcn_high = arfcn >> 8; cd->h0.arfcn_low = arfcn & 0xff; } else { - cd->h1.tsc = lchan->ts->trx->bts->tsc; + 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; |