diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-10-11 12:55:35 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-08-04 08:59:16 +0200 |
commit | 723a751e5f9867878167b2958dcbebe930b30da0 (patch) | |
tree | 5d65e64ba77567466a220ed0a6f236c191349620 /openbsc/src/libbsc/abis_rsl.c | |
parent | 1011d5b50572ba2a90d7115247c6b9548be13545 (diff) |
dyn PDCH: Cleanup of rsl_chan_activate_lchan() and users
Timing advance is stored inside lchan structure, so it is removed from
arguments. This is useful, if other actions are required prior calling
rsl_chan_activate_lchan. (like deactivating PDCH first)
The "shifted TA value" that is required by BS11 is now calculated inside
rsl_chan_activate_lchan and not by each user.
[Rebased by Holger. So some hunks were skipped as the patch
depended on Jolly's HO code]
Diffstat (limited to 'openbsc/src/libbsc/abis_rsl.c')
-rw-r--r-- | openbsc/src/libbsc/abis_rsl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index d1930783c..d9fe92c96 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -476,12 +476,13 @@ int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr, #endif int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type, - uint8_t ta, uint8_t ho_ref) + uint8_t ho_ref) { struct abis_rsl_dchan_hdr *dh; struct msgb *msg; int rc; uint8_t *len; + uint8_t ta; uint8_t chan_nr = gsm_lchan2chan_nr(lchan); struct rsl_ie_chan_mode cm; @@ -491,6 +492,12 @@ int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type, if (rc < 0) return rc; + ta = lchan->rqd_ta; + + /* BS11 requires TA shifted by 2 bits */ + if (lchan->ts->trx->bts->type == GSM_BTS_TYPE_BS11) + ta <<= 2; + memset(&cd, 0, sizeof(cd)); gsm48_lchan2chan_desc(&cd, lchan); @@ -1469,10 +1476,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg) gsm_lchant_name(lchan->type), gsm_chreq_name(chreq_reason), rqd_ref->ra, rqd_ta); - /* BS11 requires TA shifted by 2 bits */ - if (bts->type == GSM_BTS_TYPE_BS11) - rqd_ta <<= 2; - rsl_chan_activate_lchan(lchan, 0x00, rqd_ta, 0); + rsl_chan_activate_lchan(lchan, 0x00, 0); return 0; } |