diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-01-30 14:13:22 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-01-30 14:13:22 +0000 |
commit | 5ad21bfc23dc09b0e2acd0763e83b107b4e1dc80 (patch) | |
tree | 6d7227b24ce89922524346671222a1801e826fcf /drivers/dahdi/xpp/xbus-pcm.c | |
parent | 486c84923571900ad0f99f9db04b6dad3bdcb998 (diff) |
xpp: More adaptations for non-PHONEDEV XPDs
* Add IS_PHONEDEV(xpd) macro
* Reject dahdi_register_xpd()/dahdi_unregister_xpd() for non-PHONEDEV
* Make sysfs 'offhook' attribute contain '\n' if empty (no channels)
* Skip PHONEDEV related xbus_tick() parts -- we still want to process
the end of it for the card_tick() calls.
* Remove BUG_ON() for missing phoneops
(also remove old duplicate test for XBUS_IS...)
* Call XPD_STATE method only for PHONEDEV XPD's
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9705 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xbus-pcm.c')
-rw-r--r-- | drivers/dahdi/xpp/xbus-pcm.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c index e63e533..843a411 100644 --- a/drivers/dahdi/xpp/xbus-pcm.c +++ b/drivers/dahdi/xpp/xbus-pcm.c @@ -628,7 +628,7 @@ void elect_syncer(const char *msg) xpd_t *xpd = xpd_of(xbus, j); int prio; - if(!xpd || !xpd->card_present) + if(!xpd || !xpd->card_present || !IS_PHONEDEV(xpd)) continue; prio = PHONE_METHOD(xpd, card_timing_priority)(xbus, xpd); if (prio < 0) { @@ -1045,12 +1045,13 @@ static void xbus_tick(xbus_t *xbus) * Fill xframes */ for(i = 0; i < MAX_XPDS; i++) { - size_t pcm_len; - if((xpd = xpd_of(xbus, i)) == NULL) continue; - pcm_len = PHONEDEV(xpd).pcm_len; + if (!IS_PHONEDEV(xpd)) + continue; if(SPAN_REGISTERED(xpd)) { + size_t pcm_len = PHONEDEV(xpd).pcm_len; + if(pcm_len && xpd->card_present) { do { // pack = NULL; /* FORCE single packet frames */ @@ -1118,11 +1119,13 @@ static void xbus_tick(xbus_t *xbus) xpd = xpd_of(xbus, i); if(!xpd || !xpd->card_present) continue; - if(SPAN_REGISTERED(xpd)) { - do_ec(xpd); - dahdi_receive(&PHONEDEV(xpd).span); + if (IS_PHONEDEV(xpd)) { + if(SPAN_REGISTERED(xpd)) { + do_ec(xpd); + dahdi_receive(&PHONEDEV(xpd).span); + } + PHONEDEV(xpd).silence_pcm = 0; /* silence was injected */ } - PHONEDEV(xpd).silence_pcm = 0; /* silence was injected */ xpd->timer_count = xbus->global_counter; /* * Must be called *after* tx/rx so |