diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2010-10-12 08:26:48 +0000 |
---|---|---|
committer | Andreas.Eversberg <jolly@eversberg.eu> | 2010-10-12 08:26:48 +0000 |
commit | 6d4915b91b13fa879e0dd75d2c275e82b5a5634c (patch) | |
tree | e385c97e0fecc0591ec6d7f17bf3925ec2fae258 /src/host/layer23/src/mobile/gsm322.c | |
parent | 86f4d80b7ffab98efeb8fb28b393d743de897806 (diff) |
[layer23] Implementation of signal loss criteria as defined in TS 05.08
There are two criterions for lossing a signal, idle mode and dedicated mode.
A counter counts down when a frame is dropped, and counts up when a valid
frame is received on certain channel. The loss criterion is reached, if the
counter reaches 0. The values added to / removed from the counter and the
limits depend on the process.
Diffstat (limited to 'src/host/layer23/src/mobile/gsm322.c')
-rw-r--r-- | src/host/layer23/src/mobile/gsm322.c | 36 |
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(¤t_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) { |