This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/6464
HO: cosmetic: bsc_handover_start_lchan_change(): tweak local vars
To keep this cosmetic change apart from subsequent functional changes:
have a local do_assigment flag and a local network pointer.
Change-Id: I09684dcf2a00e3d930e058cc1c925ad6e59b1468
---
M src/libbsc/handover_logic.c
1 file changed, 11 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/64/6464/1
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index 013377e..cf7684b 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -99,10 +99,12 @@
int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts,
enum gsm_chan_t new_lchan_type)
{
+ struct gsm_network *network;
struct gsm_lchan *new_lchan;
struct bsc_handover *ho;
static uint8_t ho_ref = 0;
int rc;
+ bool do_assignment = false;
/* don't attempt multiple handovers for the same lchan at
* the same time */
@@ -112,8 +114,14 @@
DEBUGP(DHO, "Beginning with handover operation"
"(old_lchan on BTS %u, new BTS %u) ...\n",
old_lchan->ts->trx->bts->nr, new_bts->nr);
+ /* No new BTS? Then it shall be assignment within the same BTS. */
+ if (!new_bts)
+ new_bts = old_lchan->ts->trx->bts;
+ do_assignment = (new_bts == old_lchan->ts->trx->bts);
- rate_ctr_inc(&new_bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]);
+ network = new_bts->network;
+
+ rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]);
if (!old_lchan->conn) {
LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n");
@@ -123,7 +131,7 @@
new_lchan = lchan_alloc(new_bts, new_lchan_type, 0);
if (!new_lchan) {
LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type));
- rate_ctr_inc(&new_bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]);
+ rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]);
return -ENOSPC;
}
@@ -136,7 +144,7 @@
ho->old_lchan = old_lchan;
ho->new_lchan = new_lchan;
ho->ho_ref = ho_ref++;
- if (old_lchan->ts->trx->bts != new_bts) {
+ if (!do_assignment) {
ho->inter_cell = true;
ho->async = true;
}
--
To view, visit https://gerrit.osmocom.org/6464
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I09684dcf2a00e3d930e058cc1c925ad6e59b1468
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>