trxcon: Use current MS Power on dummy meas reports

backpointers are added in order to access the TRX, as advised in the
existing comment.

Change-Id: I975cfc5f5d63eb32a7f8932a7f6a544c9a12233c
This commit is contained in:
Pau Espin 2019-12-04 14:20:05 +01:00
parent 7069dfc051
commit 5b7fc0a8cc
3 changed files with 13 additions and 9 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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 */