aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-02 21:34:33 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-04 13:25:34 +0000
commit70c4dc8d706973c65e6bf088156f5862f4e036b4 (patch)
tree52b2afb28a49d7be2c2b967eb3ab604f818fcdb1
parentbe4a2088098a7b4fbfc1a5046e4c2ceb21ce1b1d (diff)
osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS
The upper layers (L1SAP, the common part of L1) *always* require frame numbers in the uplink direction to be reported as the frame number of the *first* burst, not the last burst of a given block. This is particularly important in the case of passing up measurement information, as we use this frame number to detect if the measurement interval for that specific timeslot has just ended (and hence we must process the measurements and send an uplink measurement report to the BSC. Before this patch, the measurement results were reported with the *last* frame number, which caused the common/measurement.c code never detect the end of a measurement window. On TS2, tons of the following log messages were observed: <0004> measurement.c:199 (bts=0,trx=0,ts=2,ss=0) no space for uplink measurement, num_ul_meas=104 With this patch, it behves as expected: the measurements of 25 blocks (= 100 bursts) are aggregated, after which point the report is computed and sent. Subsequently, num_ul_meas is reset to 0 and the cycle restarts. Related: OS#2329 Change-Id: I1065ae9c400bb5240a63ab8213aee59aeb9ceeff
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 05491564..d3928f1d 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -843,7 +843,7 @@ int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
l2_len = GSM_MACBLOCK_LEN;
/* Send uplink measurement information to L2 */
- l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr | tn,
+ l1if_process_meas_res(l1t->trx, tn, *first_fn, trx_chan_desc[chan].chan_nr | tn,
n_errors, n_bits_total, *rssi_sum / *rssi_num, *toa_sum / *toa_num);
ber10k = compute_ber10k(n_bits_total, n_errors);
return _sched_compose_ph_data_ind(l1t, tn, *first_fn, chan, l2, l2_len,
@@ -860,6 +860,7 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan];
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
+ uint32_t *first_fn = &chan_state->ul_first_fn;
uint8_t *mask = &chan_state->ul_mask;
float *rssi_sum = &chan_state->rssi_sum;
uint8_t *rssi_num = &chan_state->rssi_num;
@@ -884,6 +885,7 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
if (bid == 0) {
memset(*bursts_p, 0, GSM0503_EGPRS_BURSTS_NBITS);
*mask = 0x0;
+ *first_fn = fn;
*rssi_sum = 0;
*rssi_num = 0;
*toa_sum = 0;
@@ -937,7 +939,7 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
/* Send uplink measurement information to L2 */
- l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr | tn,
+ l1if_process_meas_res(l1t->trx, tn, *first_fn, trx_chan_desc[chan].chan_nr | tn,
n_errors, n_bits_total, *rssi_sum / *rssi_num, *toa_sum / *toa_num);
if (rc <= 0) {
@@ -959,6 +961,7 @@ int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan];
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
+ uint32_t *first_fn = &chan_state->ul_first_fn;
uint8_t *mask = &chan_state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
@@ -985,6 +988,7 @@ int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
if (bid == 0) {
memset(*bursts_p + 464, 0, 464);
*mask = 0x0;
+ *first_fn = fn;
}
/* update mask */
@@ -1047,7 +1051,7 @@ int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
memcpy(*bursts_p, *bursts_p + 464, 464);
/* Send uplink measurement information to L2 */
- l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr|tn,
+ l1if_process_meas_res(l1t->trx, tn, *first_fn, trx_chan_desc[chan].chan_nr|tn,
n_errors, n_bits_total, rssi, toa);
/* Check if the frame is bad */
@@ -1117,6 +1121,7 @@ int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *chan_state = &l1ts->chan_state[chan];
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
+ uint32_t *first_fn = &chan_state->ul_first_fn;
uint8_t *mask = &chan_state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
@@ -1148,6 +1153,7 @@ int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
if (bid == 0) {
memset(*bursts_p + 464, 0, 232);
*mask = 0x0;
+ *first_fn = fn;
}
/* update mask */
@@ -1221,7 +1227,7 @@ int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
memcpy(*bursts_p + 232, *bursts_p + 464, 232);
/* Send uplink measurement information to L2 */
- l1if_process_meas_res(l1t->trx, tn, fn, trx_chan_desc[chan].chan_nr|tn,
+ l1if_process_meas_res(l1t->trx, tn, *first_fn, trx_chan_desc[chan].chan_nr|tn,
n_errors, n_bits_total, rssi, toa);
/* Check if the frame is bad */