aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/measurement.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/measurement.c')
-rw-r--r--src/common/measurement.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 774962d4..f32adda6 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -207,11 +207,24 @@ int lchan_build_rsl_ul_meas(struct gsm_lchan *lchan, uint8_t *buf)
return 3;
}
+/* Copied from OpenBSC and enlarged to _GSM_PCHAN_MAX */
+static const uint8_t subslots_per_pchan[_GSM_PCHAN_MAX] = {
+ [GSM_PCHAN_NONE] = 0,
+ [GSM_PCHAN_CCCH] = 0,
+ [GSM_PCHAN_CCCH_SDCCH4] = 4,
+ [GSM_PCHAN_TCH_F] = 1,
+ [GSM_PCHAN_TCH_H] = 2,
+ [GSM_PCHAN_SDCCH8_SACCH8C] = 8,
+ /* FIXME: what about dynamic TCH_F_TCH_H ? */
+ [GSM_PCHAN_TCH_F_PDCH] = 1,
+};
+
static int ts_meas_check_compute(struct gsm_bts_trx_ts *ts, uint32_t fn)
{
int i;
+ const int num_subslots = subslots_per_pchan[ts->pchan];
- for (i = 0; i < ARRAY_SIZE(ts->lchan); i++) {
+ for (i = 0; i < num_subslots; ++i) {
struct gsm_lchan *lchan = &ts->lchan[i];
if (lchan->state != LCHAN_S_ACTIVE)