diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-01-27 23:45:48 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-02-05 20:24:43 +0100 |
commit | 980a28fdcbf37b180159d02dd494e89e302b3481 (patch) | |
tree | d5b264d8e57ab3cd2ccb1a8027696e0995d3132e | |
parent | 71b1bc49642518ac1e85447c9f59e44902f6875b (diff) |
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
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 4 | ||||
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 10 | ||||
-rw-r--r-- | src/osmo-bsc/handover_decision_2.c | 4 | ||||
-rw-r--r-- | src/osmo-bsc/lchan_fsm.c | 2 | ||||
-rw-r--r-- | src/osmo-bsc/lcs_loc_req.c | 4 | ||||
-rw-r--r-- | src/osmo-bsc/lcs_ta_req.c | 2 |
6 files changed, 14 insertions, 12 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 8b539028c..6cb3cf0a4 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -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]; diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index f45b507bc..edffd356d 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -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 { diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index 2cb7a54f3..134f50250 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -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 diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 5790b3fb4..7a75c0b96 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -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(): diff --git a/src/osmo-bsc/lcs_loc_req.c b/src/osmo-bsc/lcs_loc_req.c index ca5c7b93f..39bc3418a 100644 --- a/src/osmo-bsc/lcs_loc_req.c +++ b/src/osmo-bsc/lcs_loc_req.c @@ -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, }, }; diff --git a/src/osmo-bsc/lcs_ta_req.c b/src/osmo-bsc/lcs_ta_req.c index 97d6eb5c8..3b859a7d3 100644 --- a/src/osmo-bsc/lcs_ta_req.c +++ b/src/osmo-bsc/lcs_ta_req.c @@ -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, }, }, }, |