diff options
Diffstat (limited to 'openbsc/src/chan_alloc.c')
-rw-r--r-- | openbsc/src/chan_alloc.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c index 2e885241c..b5497bcb8 100644 --- a/openbsc/src/chan_alloc.c +++ b/openbsc/src/chan_alloc.c @@ -33,8 +33,6 @@ #include <openbsc/debug.h> #include <openbsc/signal.h> -static void auto_release_channel(void *_lchan); - static int ts_is_usable(struct gsm_bts_trx_ts *ts) { /* FIXME: How does this behave for BS-11 ? */ @@ -260,10 +258,9 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type) /* clear multi rate config */ memset(&lchan->mr_conf, 0, sizeof(lchan->mr_conf)); - /* Configure the time and start it so it will be closed */ - lchan->release_timer.cb = auto_release_channel; - lchan->release_timer.data = lchan; - bsc_schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); + /* clear any msc reference */ + lchan->msc_data = NULL; + } return lchan; @@ -286,8 +283,6 @@ void lchan_free(struct gsm_lchan *lchan) lchan->use_count = 0; } - /* stop the timer */ - bsc_del_timer(&lchan->release_timer); bsc_del_timer(&lchan->T3101); /* clear cached measuement reports */ @@ -298,7 +293,6 @@ void lchan_free(struct gsm_lchan *lchan) } for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++) lchan->neigh_meas[i].arfcn = 0; - lchan->silent_call = 0; /* FIXME: ts_free() the timeslot, if we're the last logical @@ -306,15 +300,18 @@ void lchan_free(struct gsm_lchan *lchan) } /* Consider releasing the channel now */ -int lchan_auto_release(struct gsm_lchan *lchan) +int _lchan_release(struct gsm_lchan *lchan) { if (lchan->use_count > 0) { + DEBUGP(DRLL, "BUG: _lchan_release called without zero use_count.\n"); return 0; } /* Assume we have GSM04.08 running and send a release */ if (lchan->subscr) { + ++lchan->use_count; gsm48_send_rr_release(lchan); + --lchan->use_count; } /* spoofed? message */ @@ -327,15 +324,6 @@ int lchan_auto_release(struct gsm_lchan *lchan) return 1; } -/* Auto release the channel when the use count is zero */ -static void auto_release_channel(void *_lchan) -{ - struct gsm_lchan *lchan = _lchan; - - if (!lchan_auto_release(lchan)) - bsc_schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); -} - struct gsm_lchan* lchan_find(struct gsm_bts *bts, struct gsm_subscriber *subscr) { struct gsm_bts_trx *trx; int ts_no, lchan_no; |