diff options
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/xhfc.c')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/xhfc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dahdi/wctdm24xxp/xhfc.c b/drivers/dahdi/wctdm24xxp/xhfc.c index 730d2e0..e0cc687 100644 --- a/drivers/dahdi/wctdm24xxp/xhfc.c +++ b/drivers/dahdi/wctdm24xxp/xhfc.c @@ -2183,11 +2183,19 @@ int b400m_spanconfig(struct file *file, struct dahdi_span *span, struct wctdm *wc; int te_mode, term; int pos; + int res; bspan = bspan_from_dspan(span); b4 = bspan->parent; wc = b4->wc; + if ((file->f_flags & O_NONBLOCK) && !wc->initialized) + return -EAGAIN; + + res = wctdm_wait_for_ready(wc); + if (res) + return res; + b400m_disable_workqueues(b4->wc); te_mode = (lc->lineconfig & DAHDI_CONFIG_NTTE) ? 0 : 1; @@ -2258,6 +2266,13 @@ int b400m_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype) struct b400m *b4 = bspan->parent; int res; + if ((file->f_flags & O_NONBLOCK) && !b4->wc->initialized) + return -EAGAIN; + + res = wctdm_wait_for_ready(b4->wc); + if (res) + return res; + alreadyrunning = bspan->wspan->span.flags & DAHDI_FLAG_RUNNING; if (DBG_FOPS) { |