summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-12-04 14:20:05 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2019-12-04 14:41:56 +0100
commit5b7fc0a8cc0247f8f956637833bbce70ed09b3f2 (patch)
tree676b9d07bb5d300bed88036ddd7fe20f67242bb6
parent7069dfc051d5096e9614a17234646a186de290c9 (diff)
trxcon: Use current MS Power on dummy meas reportsHEADmaster
backpointers are added in order to access the TRX, as advised in the existing comment. Change-Id: I975cfc5f5d63eb32a7f8932a7f6a544c9a12233c
-rw-r--r--src/host/trxcon/sched_prim.c11
-rw-r--r--src/host/trxcon/sched_trx.c6
-rw-r--r--src/host/trxcon/sched_trx.h5
3 files changed, 13 insertions, 9 deletions
diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c
index 50dfd6e9..fc0f05d5 100644
--- a/src/host/trxcon/sched_prim.c
+++ b/src/host/trxcon/sched_prim.c
@@ -171,25 +171,18 @@ static struct trx_ts_prim *prim_compose_mr(struct trx_lchan_state *lchan)
/* Compose a new Measurement Report primitive */
memcpy(prim->payload, mr_src_ptr, GSM_MACBLOCK_LEN);
-#if 0
/**
* Update the L1 SACCH pseudo-header (only for cached MRs)
*
- * FIXME: this would require having access to the trx_instance,
- * what can be achieved either by chain-passing the pointer
- * through sched_prim_dequeue(), or by adding some
- * back-pointers to the logical channel state.
- *
* TODO: filling of the actual values into cached Measurement
* Reports would break the distance spoofing feature. If it
* were known whether the spoofing is enabled or not, we could
* decide whether to update the cached L1 SACCH header here.
*/
if (!cached) {
- prim->payload[0] = trx->tx_power;
- prim->payload[1] = trx->ta;
+ prim->payload[0] = lchan->ts->trx->tx_power;
+ prim->payload[1] = lchan->ts->trx->ta;
}
-#endif
/* Inform about the cache usage count */
if (cached && lchan->sacch.mr_cache_usage > 5) {
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index eb6f3dc0..6bb662db 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -202,6 +202,9 @@ struct trx_ts *sched_trx_add_ts(struct trx_instance *trx, int tn)
/* Allocate a new one */
trx->ts_list[tn] = talloc_zero(trx, struct trx_ts);
+ /* Add backpointer */
+ trx->ts_list[tn]->trx = trx;
+
/* Assign TS index */
trx->ts_list[tn]->index = tn;
@@ -287,6 +290,9 @@ int sched_trx_configure_ts(struct trx_instance *trx, int tn,
if (!lchan)
return -ENOMEM;
+ /* set backpointer */
+ lchan->ts = ts;
+
/* Set channel type */
lchan->type = type;
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index f2089e88..8718ed69 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -237,6 +237,9 @@ struct trx_lchan_state {
uint8_t key_len;
uint8_t algo;
} a5;
+
+ /* TS that this lchan belongs to */
+ struct trx_ts *ts;
};
struct trx_ts {
@@ -251,6 +254,8 @@ struct trx_ts {
struct llist_head lchans;
/*! \brief Queue primitives for TX */
struct llist_head tx_prims;
+ /* backpointer to its TRX */
+ struct trx_instance *trx;
};
/* Represents one TX primitive in the queue of trx_ts */