diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-05 00:11:47 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-05 00:11:47 +0000 |
commit | 47a482419ec58a2dc37f9d5eb036554e8e35b59e (patch) | |
tree | f3926c95569abbe68a9684084bf39e1b3cb5c9f4 /xpp/xpp_zap.c | |
parent | aa009acab2b144e47af7fcfad1f19b8fbfbd490c (diff) |
SPAN_REGISTERED() should not rely on zaptel ZT_FLAG_REGISTERED since
zaptel set it before registration is finished.
(right: xpp needs to replicate zaptel's bookkeeping here).
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1397 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/xpp_zap.c')
-rw-r--r-- | xpp/xpp_zap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c index b6bb618..d9d413d 100644 --- a/xpp/xpp_zap.c +++ b/xpp/xpp_zap.c @@ -523,6 +523,7 @@ xpd_t *xpd_alloc(size_t privsize, xbus_t *xbus, int xpd_num, const xproto_table_ xpd->idletxhookstate[i] = FXS_LINE_ENABLED; /* By default, don't send on hook */ } + atomic_set(&xpd->zt_registered, 0); atomic_set(&xpd->open_counter, 0); xpd->chans = kmalloc(sizeof(struct zt_chan)*xpd->channels, GFP_KERNEL); @@ -1295,6 +1296,7 @@ static int zaptel_unregister_xpd(xpd_t *xpd) spin_unlock_irqrestore(&xpd->lock, flags); return -EIDRM; } + atomic_dec(&xpd->zt_registered); if(sync_master == xpd) sync_master_is(NULL); // FIXME: it's better to elect a new prince update_xpd_status(xpd, ZT_ALARM_NOTOPEN); @@ -1370,6 +1372,7 @@ static int zaptel_register_xpd(xpd_t *xpd) ERR("%s/%s: Failed to zt_register span\n", xbus->busname, xpd->xpdname); return -ENODEV; } + atomic_inc(&xpd->zt_registered); xpd->xops->card_zaptel_postregistration(xpd, 1); return 0; } |