aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-06-21 19:03:01 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-06-25 15:56:09 +0200
commitf2271d0888e3f62b5d7b235f3b9d6bddb70825b7 (patch)
treec57bce3bb37547fac4d37145b3834c7b076618f4
parent5b9212d6c5562b805888c44f4dcf6829f01e178f (diff)
bts: Bypass T200 DCCH values for CCCH
Otherwise t200_ms_dcch array values are left uninitialized with random values, and passed later on to lapdm_channel_init2(). lapdm_channel_init2() will anyways fail during initial check on get_n200_dcch() and return -EINVAL, so let's not print garbage or call a function which will anyways simply return an error. Catched due to some strange values seen in log (see D0 and D3): osmo-bts/src/common/bts.c:421 (bts=0,trx=0,ts=0,ss=4) Setting T200 D0=1028672, D3=2, S0=520, S3=520 (all in ms) Related: OS#4066 Change-Id: I3d7e1883811acf97aac97325739f2ff97fc2aa08
-rw-r--r--src/common/bts.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index b912f33..f582ebd 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -405,6 +405,7 @@ static int t200_by_lchan(int *t200_ms_dcch, int *t200_ms_acch, struct gsm_lchan
t200_ms_dcch[DL_SAPI3] = bts->t200_ms[T200_FACCH_H] + fn_advance_ms;
break;
default:
+ /* Channels such as CCCH don't use lapdm DL, and hence no T200 is needed */
return -1;
}
return 0;
@@ -415,14 +416,16 @@ int lchan_init_lapdm(struct gsm_lchan *lchan)
struct lapdm_channel *lc = &lchan->lapdm_ch;
int t200_ms_dcch[_NR_DL_SAPI], t200_ms_acch[_NR_DL_SAPI];
- t200_by_lchan(t200_ms_dcch, t200_ms_acch, lchan);
-
- LOGPLCHAN(lchan, DLLAPD, LOGL_DEBUG, "Setting T200 D0=%u, D3=%u, S0=%u, S3=%u (all in ms)\n",
- t200_ms_dcch[DL_SAPI0], t200_ms_dcch[DL_SAPI3], t200_ms_acch[DL_SAPI0], t200_ms_acch[DL_SAPI3]);
-
- lapdm_channel_init2(lc, LAPDM_MODE_BTS, t200_ms_dcch, t200_ms_acch, lchan->type);
- lapdm_channel_set_flags(lc, LAPDM_ENT_F_POLLING_ONLY);
- lapdm_channel_set_l1(lc, NULL, lchan);
+ if (t200_by_lchan(t200_ms_dcch, t200_ms_acch, lchan) == 0) {
+ LOGPLCHAN(lchan, DLLAPD, LOGL_DEBUG,
+ "Setting T200 D0=%u, D3=%u, S0=%u, S3=%u (all in ms)\n",
+ t200_ms_dcch[DL_SAPI0], t200_ms_dcch[DL_SAPI3],
+ t200_ms_acch[DL_SAPI0], t200_ms_acch[DL_SAPI3]);
+ lapdm_channel_init2(lc, LAPDM_MODE_BTS, t200_ms_dcch, t200_ms_acch, lchan->type);
+ lapdm_channel_set_flags(lc, LAPDM_ENT_F_POLLING_ONLY);
+ lapdm_channel_set_l1(lc, NULL, lchan);
+ }
+ /* We still need to set Rx callback to receive RACH requests: */
lapdm_channel_set_l3(lc, lapdm_rll_tx_cb, lchan);
return 0;