diff options
author | Holger Freyther <zecke@selfish.org> | 2008-12-30 19:18:21 +0000 |
---|---|---|
committer | Holger Freyther <zecke@selfish.org> | 2008-12-30 19:18:21 +0000 |
commit | c6ea9dbebaf2329be078f62723f2455bc010065a (patch) | |
tree | 360e823d4672e972875f886425521aabd09ca8d9 /include/openbsc/gsm_data.h | |
parent | 36cbeff164694dd3559636485f75a5dd7440a163 (diff) |
Recylce a gsm_lchan when the refcount drops to zero
When a channel is allocated, start a timeout, when a lchan_use
is used the timer will be restarted, when the timeout fires
we will try to recycle or restart the timer.
Diffstat (limited to 'include/openbsc/gsm_data.h')
-rw-r--r-- | include/openbsc/gsm_data.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index d9974a767..986f33127 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -13,6 +13,18 @@ #define HARDCODED_ARFCN 123 +/* + * Use the channel. As side effect the lchannel recycle timer + * will be started. + */ +#define LCHAN_RELEASE_TIMEOUT 4, 0 +#define use_lchan(lchan) \ + do { lchan->use_count++; \ + schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0); + +#define put_lchan(lchan) \ + do { lchan->use_count--; } while(0); + /* communications link with a BTS */ struct gsm_bts_link { struct gsm_bts *bts; @@ -79,8 +91,10 @@ struct gsm_lchan { enum gsm_chan_t type; /* To whom we are allocated at the moment */ struct gsm_subscriber *subscr; - /* Universal timer, undefined use ;) */ - struct timer_list timer; + + /* Timer started to release the channel */ + struct timer_list release_timer; + struct timer_list updating_timer; /* local end of a call, if any */ struct gsm_call call; |