introduce trans_lchan_change() to update transaction about lchan change

This commit is contained in:
Harald Welte 2009-12-17 17:13:28 +01:00
parent 8d77b9540a
commit cc9beb5366
2 changed files with 24 additions and 0 deletions

View File

@ -65,4 +65,9 @@ void trans_free(struct gsm_trans *trans);
int trans_assign_trans_id(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t ti_flag);
/* update all transactions to use a different LCHAN, e.g.
* after handover has succeeded */
int trans_lchan_change(struct gsm_lchan *lchan_old,
struct gsm_lchan *lchan_new);
#endif

View File

@ -140,3 +140,22 @@ int trans_assign_trans_id(struct gsm_subscriber *subscr,
return -1;
}
/* update all transactions to use a different LCHAN, e.g.
* after handover has succeeded */
int trans_lchan_change(struct gsm_lchan *lchan_old,
struct gsm_lchan *lchan_new)
{
struct gsm_network *net = lchan_old->ts->trx->bts->network;
struct gsm_trans *trans;
int num = 0;
llist_for_each_entry(trans, &net->trans_list, entry) {
if (trans->lchan == lchan_old) {
trans->lchan = lchan_new;
num++;
}
}
return num;
}