diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h index b488b6c44..f19a13ed2 100644 --- a/include/osmo-bts/scheduler.h +++ b/include/osmo-bts/scheduler.h @@ -276,6 +276,12 @@ enum sched_meas_avg_mode { SCHED_MEAS_AVG_M_OCTO, /* last 6 bursts (default for FACCH/H) */ SCHED_MEAS_AVG_M_SIX, + /* first 4 of last 8 bursts */ + SCHED_MEAS_AVG_M8_FIRST_QUAD, + /* first 2 of last 6 bursts */ + SCHED_MEAS_AVG_M6_FIRST_TWO, + /* middle 2 of last 6 bursts */ + SCHED_MEAS_AVG_M6_MIDDLE_TWO, }; void trx_sched_meas_push(struct l1sched_chan_state *chan_state, diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c index e29a47e23..9c5bfc22d 100644 --- a/src/osmo-bts-trx/sched_lchan_tchf.c +++ b/src/osmo-bts-trx/sched_lchan_tchf.c @@ -173,6 +173,17 @@ int rx_tchf_fn(struct l1sched_trx *l1t, enum trx_chan_type chan, break; } + switch (chan_state->amr_last_dtx) { + case AFS_SID_FIRST: + case AFS_SID_UPDATE_CN: + meas_avg_mode = SCHED_MEAS_AVG_M8_FIRST_QUAD; + break; + case AFS_SID_UPDATE: + case AFS_ONSET: + meas_avg_mode = SCHED_MEAS_AVG_M_QUAD; + break; + } + if (rc) trx_loop_amr_input(l1t, trx_chan_desc[chan].chan_nr | bi->tn, chan_state, diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c index 2a561e1ed..c400542ad 100644 --- a/src/osmo-bts-trx/sched_lchan_tchh.c +++ b/src/osmo-bts-trx/sched_lchan_tchh.c @@ -184,6 +184,20 @@ int rx_tchh_fn(struct l1sched_trx *l1t, enum trx_chan_type chan, break; } + switch (chan_state->amr_last_dtx) { + case AHS_SID_FIRST_P1: + case AHS_SID_FIRST_P2: + case AHS_SID_UPDATE: + case AHS_SID_UPDATE_CN: + case AHS_SID_FIRST_INH: + case AHS_SID_UPDATE_INH: + meas_avg_mode = SCHED_MEAS_AVG_M6_FIRST_TWO; + break; + case AHS_ONSET: + meas_avg_mode = SCHED_MEAS_AVG_M6_MIDDLE_TWO; + break; + } + if (rc) trx_loop_amr_input(l1t, trx_chan_desc[chan].chan_nr | bi->tn, chan_state, diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 3921280b8..c00032444 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -517,6 +517,18 @@ void trx_sched_meas_avg(const struct l1sched_chan_state *chan_state, case SCHED_MEAS_AVG_M_SIX: n = 6; shift = n; break; + /* first 4 of last 8 bursts */ + case SCHED_MEAS_AVG_M8_FIRST_QUAD: + n = 4; shift = 8; + break; + /* first 2 of last 6 bursts */ + case SCHED_MEAS_AVG_M6_FIRST_TWO: + n = 2; shift = 6; + break; + /* middle 2 of last 6 bursts */ + case SCHED_MEAS_AVG_M6_MIDDLE_TWO: + n = 2; shift = 4; + break; default: /* Shall not happen */ OSMO_ASSERT(false);