aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/chan_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/chan_alloc.c')
-rw-r--r--openbsc/src/chan_alloc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index 0e5c67952..fe16815c6 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -38,7 +38,7 @@ static void auto_release_channel(void *_lchan);
struct gsm_bts_trx_ts *ts_c0_alloc(struct gsm_bts *bts,
enum gsm_phys_chan_config pchan)
{
- struct gsm_bts_trx *trx = &bts->trx[0];
+ struct gsm_bts_trx *trx = bts->c0;
struct gsm_bts_trx_ts *ts = &trx->ts[0];
if (pchan != GSM_PCHAN_CCCH &&
@@ -68,7 +68,7 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts,
{
int i, j;
for (i = 0; i < bts->num_trx; i++) {
- struct gsm_bts_trx *trx = &bts->trx[i];
+ struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, i);
int from, to;
/* the following constraints are pure policy,
@@ -124,7 +124,7 @@ _lc_find(struct gsm_bts *bts, enum gsm_phys_chan_config pchan)
struct gsm_bts_trx_ts *ts;
int i, j, ss;
for (i = 0; i < bts->num_trx; i++) {
- trx = &bts->trx[i];
+ trx = gsm_bts_trx_num(bts, i);
for (j = 0; j < 8; j++) {
ts = &trx->ts[j];
if (ts->pchan != pchan)
@@ -239,13 +239,14 @@ static void auto_release_channel(void *_lchan)
}
struct gsm_lchan* lchan_find(struct gsm_bts *bts, struct gsm_subscriber *subscr) {
- int trx, ts_no, lchan_no;
+ struct gsm_bts_trx *trx;
+ int ts_no, lchan_no;
- for (trx = 0; trx < bts->num_trx; ++trx) {
+ llist_for_each_entry(trx, &bts->trx_list, list) {
for (ts_no = 0; ts_no < 8; ++ts_no) {
for (lchan_no = 0; lchan_no < TS_MAX_LCHAN; ++lchan_no) {
struct gsm_lchan *lchan =
- &bts->trx[trx].ts[ts_no].lchan[lchan_no];
+ &trx->ts[ts_no].lchan[lchan_no];
if (subscr == lchan->subscr)
return lchan;
}