bsc_api: Allocate the subscriber_connection dynamically
This is a big change to the way we use the subscriber
connection. From now on it is is dynamically allocated
and we will slowly move from a 1:1 lchan to conn to
having more than one lchan per connection.
This is the first commit, the subscr_con* methods will
move to gsm_data once the use_count is removed from the
connection, the freeing of the connection will also change.
diff --git a/openbsc/src/handover_logic.c b/openbsc/src/handover_logic.c
index b2ffe46..b75dc98 100644
--- a/openbsc/src/handover_logic.c
+++ b/openbsc/src/handover_logic.c
@@ -122,7 +122,7 @@
new_lchan->bs_power = old_lchan->bs_power;
new_lchan->rsl_cmode = old_lchan->rsl_cmode;
new_lchan->tch_mode = old_lchan->tch_mode;
- new_lchan->conn.subscr = subscr_get(old_lchan->conn.subscr);
+ new_lchan->conn->subscr = subscr_get(old_lchan->conn->subscr);
/* FIXME: do we have a better idea of the timing advance? */
rc = rsl_chan_activate_lchan(new_lchan, RSL_ACT_INTER_ASYNC, 0,
@@ -219,7 +219,7 @@
}
LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN "
- "%u->%u\n", subscr_name(ho->old_lchan->conn.subscr),
+ "%u->%u\n", subscr_name(ho->old_lchan->conn->subscr),
ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr,
ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn);
@@ -228,7 +228,7 @@
bsc_del_timer(&ho->T3103);
/* update lchan pointer of transaction */
- trans_lchan_change(&ho->old_lchan->conn, &new_lchan->conn);
+ trans_lchan_change(ho->old_lchan->conn, new_lchan->conn);
rsl_lchan_set_state(ho->old_lchan, LCHAN_S_INACTIVE);
lchan_auto_release(ho->old_lchan);
@@ -258,7 +258,7 @@
bsc_del_timer(&ho->T3103);
llist_del(&ho->list);
- conn = &ho->new_lchan->conn;
+ conn = ho->new_lchan->conn;
put_subscr_con(conn);
talloc_free(ho);