rename lchan->rqd_ta to last_ta

Originally, the lchan stored only the Timing Advance from the initial
channel request, hence it was called rqd_ta.

Since quite a while now, rqd_ta also stores the most recent Timing
Advance from each received Measurement Report. So rename to last_ta.

This is cosmetic preparation for an upcoming patch that clarifies
whether the Timing Advance is already known for Channel Activation.

Change-Id: I1049526a173819baeb4978db5bf018ba3f1006a0
This commit is contained in:
Neels Hofmeyr 2021-01-27 23:45:48 +01:00
parent 71b1bc4964
commit 980a28fdcb
6 changed files with 14 additions and 12 deletions

View File

@ -657,7 +657,9 @@ struct gsm_lchan {
} ass_compl;
} abis_ip;
uint8_t rqd_ta;
/* At first, the Timing Advance from the initial Channel Request. Later, the Timing Advance value received from
* the most recent Measurement Report. */
uint8_t last_ta;
/* table of neighbor cell measurements */
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];

View File

@ -541,7 +541,7 @@ int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t ho_ref)
return rc;
}
ta = lchan->rqd_ta;
ta = lchan->last_ta;
/* BS11 requires TA shifted by 2 bits */
if (bts->type == GSM_BTS_TYPE_BS11)
@ -1147,8 +1147,8 @@ static int rsl_rx_meas_res(struct msgb *msg)
if (msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_BS11
|| msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE)
mr->ms_l1.ta >>= 2;
/* store TA for next assignment/handover */
mr->lchan->rqd_ta = mr->ms_l1.ta;
/* store TA for handover decision, and for intra-cell re-assignment */
mr->lchan->last_ta = mr->ms_l1.ta;
}
if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
msg->l3h = (uint8_t *) TLVP_VAL(&tp, RSL_IE_L3_INFO);
@ -1756,7 +1756,7 @@ void abis_rsl_chan_rqd_queue_poll(struct gsm_bts *bts)
OSMO_ASSERT(lchan->rqd_ref);
*(lchan->rqd_ref) = rqd->ref;
lchan->rqd_ta = rqd->ta;
lchan->last_ta = rqd->ta;
LOG_LCHAN(lchan, LOGL_DEBUG, "MS: Channel Request: reason=%s ra=0x%02x ta=%d\n",
gsm_chreq_name(rqd->reason), rqd->ref.ra, rqd->ta);
@ -1788,7 +1788,7 @@ int rsl_tx_imm_assignment(struct gsm_lchan *lchan)
/* use request reference extracted from CHAN_RQD */
memcpy(&ia->req_ref, lchan->rqd_ref, sizeof(ia->req_ref));
ia->timing_advance = lchan->rqd_ta;
ia->timing_advance = lchan->last_ta;
if (!lchan->ts->hopping.enabled) {
ia->mob_alloc_len = 0;
} else {

View File

@ -1543,10 +1543,10 @@ static void on_measurement_report(struct gsm_meas_rep *mr)
/* Max Distance */
if (lchan->meas_rep_count > 0
&& lchan->rqd_ta > ho_get_hodec2_max_distance(bts->ho)) {
&& lchan->last_ta > ho_get_hodec2_max_distance(bts->ho)) {
global_ho_reason = HO_REASON_MAX_DISTANCE;
LOGPHOLCHAN(lchan, LOGL_NOTICE, "TA is TOO HIGH: %u > %d\n",
lchan->rqd_ta, ho_get_hodec2_max_distance(bts->ho));
lchan->last_ta, ho_get_hodec2_max_distance(bts->ho));
/* start penalty timer to prevent coming back too
* early. it must be started before selecting a better cell,
* so there is no assignment selected, due to running

View File

@ -580,7 +580,7 @@ static void lchan_fsm_wait_ts_ready_onenter(struct osmo_fsm_inst *fi, uint32_t p
ms_power_dbm = ms_pwr_dbm(bts->band, old_lchan->ms_power);
lchan_update_ms_power_ctrl_level(lchan, ms_power_dbm >= 0 ? ms_power_dbm : bts->ms_max_power);
lchan->bs_power = old_lchan->bs_power;
lchan->rqd_ta = old_lchan->rqd_ta;
lchan->last_ta = old_lchan->last_ta;
} else {
lchan_update_ms_power_ctrl_level(lchan, bts->ms_max_power);
/* Upon last entering the UNUSED state, from lchan_reset():

View File

@ -313,7 +313,7 @@ static void lcs_loc_req_wait_loc_resp_onenter(struct osmo_fsm_inst *fi, uint32_t
plr.bssmap_le.perform_loc_req.apdu = (struct bsslap_pdu){
.msg_type = BSSLAP_MSGT_TA_LAYER3,
.ta_layer3 = {
.ta = lchan->rqd_ta,
.ta = lchan->last_ta,
},
};
} else {
@ -365,7 +365,7 @@ static void lcs_loc_req_handover_performed(struct lcs_loc_req *lcs_loc_req)
.msg_type = BSSLAP_MSGT_RESET,
.reset = {
.cell_id = lchan->ts->trx->bts->cell_identity,
.ta = lchan->rqd_ta,
.ta = lchan->last_ta,
.cause = BSSLAP_CAUSE_INTRA_BSS_HO,
},
};

View File

@ -210,7 +210,7 @@ void lcs_ta_req_got_ta_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
.msg_type = BSSLAP_MSGT_TA_RESPONSE,
.ta_response = {
.cell_id = lchan->ts->trx->bts->cell_identity,
.ta = lchan->rqd_ta,
.ta = lchan->last_ta,
},
},
},