summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/gsm322.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/layer23/src/mobile/gsm322.c')
-rw-r--r--src/host/layer23/src/mobile/gsm322.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index 92287275..807c6624 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -236,6 +236,7 @@ static int gsm322_sync_to_cell(struct gsm322_cellsel *cs)
{
struct osmocom_ms *ms = cs->ms;
struct gsm48_sysinfo *s = cs->si;
+ struct rx_meas_stat *meas = &ms->meas;
cs->ccch_state = GSM322_CCCH_ST_INIT;
if (s && s->si3) {
@@ -257,6 +258,8 @@ static int gsm322_sync_to_cell(struct gsm322_cellsel *cs)
cs->ccch_mode = CCCH_MODE_NONE;
}
+ meas->frames = meas->snr = meas->berr = meas->rxlev = 0;
+
l1ctl_tx_reset_req(ms, L1CTL_RES_T_FULL);
return l1ctl_tx_fbsb_req(ms, cs->arfcn,
L1CTL_FBSB_F_FB01SB, 100, 0,
@@ -443,30 +446,6 @@ void start_cs_timer(struct gsm322_cellsel *cs, int sec, int micro)
bsc_schedule_timer(&cs->timer, sec, micro);
}
-/* start loss timer */
-void start_loss_timer(struct gsm322_cellsel *cs, int sec, int micro)
-{
- /* update timer */
- cs->timer.cb = gsm322_cs_loss;
- cs->timer.data = cs;
- if (bsc_timer_pending(&cs->timer)) {
- struct timeval current_time;
- unsigned long long currentTime;
-
- gettimeofday(&current_time, NULL);
- currentTime = current_time.tv_sec * 1000000LL
- + current_time.tv_usec;
- currentTime += sec * 1000000LL + micro;
- cs->timer.timeout.tv_sec = currentTime / 1000000LL;
- cs->timer.timeout.tv_usec = currentTime % 1000000LL;
-
- return;
- }
-
- LOGP(DCS, LOGL_DEBUG, "Starting loss CS timer with %d seconds.\n", sec);
- bsc_schedule_timer(&cs->timer, sec, micro);
-}
-
/* stop cell selection timer */
static void stop_cs_timer(struct gsm322_cellsel *cs)
{
@@ -2465,6 +2444,10 @@ static int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
|| cs->state == GSM322_HPLMN_SEARCH)
start_cs_timer(cs, ms->support.scan_to, 0);
// TODO: timer depends on BCCH config
+
+ /* set downlink signalling failure criterion */
+ ms->meas.ds_fail = ms->meas.dsc = ms->settings.dsc_max;
+ LOGP(DRR, LOGL_INFO, "using DSC of %d\n", ms->meas.dsc);
}
break;
case S_L1CTL_FBSB_ERR:
@@ -2488,6 +2471,11 @@ static int gsm322_l1_signal(unsigned int subsys, unsigned int signal,
else
gsm322_cs_timeout(cs);
break;
+ case S_L1CTL_LOSS_IND:
+ ms = signal_data;
+ cs = &ms->cellsel;
+ gsm322_cs_loss(cs);
+ break;
case S_L1CTL_RESET:
ms = signal_data;
if (ms->mmlayer.power_off_idle) {