summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-10-11 13:01:38 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-10-11 13:01:38 +0200
commit98c0d3515d6dadd667047aeb4c3f33233042c4df (patch)
tree1b14d5cd2dd66f5ce79d156a356cda3ea34c41a3
parentdb6e636da50947264234abbfa31dddd538e14037 (diff)
dyn PDCH: Add new_lchan argument to bsc_handover_start()
This is useful, if the user already allocated a new lchan. If NULL is given, the lchan is allocated by bsc_handover_start, as before.
-rw-r--r--openbsc/include/openbsc/handover.h4
-rw-r--r--openbsc/src/libbsc/handover_decision_1.c2
-rw-r--r--openbsc/src/libbsc/handover_decision_2.c4
-rw-r--r--openbsc/src/libbsc/handover_logic.c8
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c2
5 files changed, 10 insertions, 10 deletions
diff --git a/openbsc/include/openbsc/handover.h b/openbsc/include/openbsc/handover.h
index 587161893..f73291f82 100644
--- a/openbsc/include/openbsc/handover.h
+++ b/openbsc/include/openbsc/handover.h
@@ -13,8 +13,8 @@ void add_penalty_timer(struct gsm_subscriber_connection *conn,
/* Hand over the specified logical channel to the specified new BTS.
* This is the main entry point for the actual handover algorithm,
* after it has decided it wants to initiate HO to a specific BTS */
-int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts,
- int full_rate);
+int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
+ struct gsm_bts *bts, int full_rate);
/* clear any operation for this connection */
void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan);
diff --git a/openbsc/src/libbsc/handover_decision_1.c b/openbsc/src/libbsc/handover_decision_1.c
index 391a5c9a9..e1ebfd082 100644
--- a/openbsc/src/libbsc/handover_decision_1.c
+++ b/openbsc/src/libbsc/handover_decision_1.c
@@ -48,7 +48,7 @@ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan,
}
/* and actually try to handover to that cell */
- return bsc_handover_start(lchan, new_bts,
+ return bsc_handover_start(lchan, NULL, new_bts,
(lchan->type != GSM_LCHAN_TCH_H));
}
diff --git a/openbsc/src/libbsc/handover_decision_2.c b/openbsc/src/libbsc/handover_decision_2.c
index 7aba421d6..56ebd500c 100644
--- a/openbsc/src/libbsc/handover_decision_2.c
+++ b/openbsc/src/libbsc/handover_decision_2.c
@@ -535,13 +535,13 @@ static int trigger_handover_or_assignment(struct gsm_lchan *lchan,
LOGPC(DHODEC, LOGL_NOTICE, "Trigger assignment due to %s to "
"%s.\n", get_ho_reason_name(ho_reason),
(full_rate) ? "TCH/F" : "TCH/H");
- return bsc_handover_start(lchan, NULL, full_rate);
+ return bsc_handover_start(lchan, NULL, NULL, full_rate);
} else {
LOGPC(DHODEC, LOGL_NOTICE, "Trigger handover to BTS %d due to "
"%s to %s.\n", new_bts->nr,
get_ho_reason_name(ho_reason),
(full_rate) ? "TCH/F" : "TCH/H");
- return bsc_handover_start(lchan, new_bts, full_rate);
+ return bsc_handover_start(lchan, NULL, new_bts, full_rate);
}
return 0;
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index 2f1697cbb..c795d54c4 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -149,11 +149,10 @@ void add_penalty_timer(struct gsm_subscriber_connection *conn,
/* Hand over the specified logical channel to the specified new BTS.
* This is the main entry point for the actual handover algorithm,
* after it has decided it wants to initiate HO to a specific BTS */
-int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts,
- int full_rate)
+int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
+ struct gsm_bts *new_bts, int full_rate)
{
struct gsm_bts *old_bts = old_lchan->ts->trx->bts;
- struct gsm_lchan *new_lchan;
int chan_type;
struct bsc_handover *ho;
static uint8_t ho_ref;
@@ -180,7 +179,8 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts,
chan_type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H;
- new_lchan = lchan_alloc(new_bts, chan_type, 0);
+ if (!new_lchan)
+ new_lchan = lchan_alloc(new_bts, chan_type, 0);
if (!new_lchan) {
LOGP(DHO, LOGL_NOTICE, "No free channel\n");
osmo_counter_inc(new_bts->network->stats.handover.no_channel);
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index a166712d9..54ab1b97d 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -632,7 +632,7 @@ DEFUN(ena_subscr_handover,
}
/* now start the handover */
- ret = bsc_handover_start(conn->lchan, bts,
+ ret = bsc_handover_start(conn->lchan, NULL, bts,
(conn->lchan->type != GSM_LCHAN_TCH_H));
if (ret != 0) {
vty_out(vty, "%% Handover failed with errno %d.%s",