summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wct4xxp/base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:01:34 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:01:34 +0000
commitcd419f86a583306c63a461b7e79a52e96c1e20bc (patch)
tree41b574bfc2b9ce4a87bbdfed680ed69895342198 /drivers/dahdi/wct4xxp/base.c
parente1359adcca7980a13988af0366455bb2f4cb0980 (diff)
dahdi: Allow dahdi_span_ops.[chan|span]config and startup to block.
This change ensures that the dahdi_span_ops callbacks are not called with any spinlocks held, and that the module is pinned in memory, and also passes the struct file * pointer to the callbacks. Passing the file pointer to the callbacks allows the board drivers to check any flags on the file descriptor used to configure the span/channel. The intent here is to allow dahdi_config to open the /dev/dahdi/ctl file in a non-blocking mode in case there is a lengthy processes that needs to happen as part of configuration. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9940 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wct4xxp/base.c')
-rw-r--r--drivers/dahdi/wct4xxp/base.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index 47c5ed3..f49fa43 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -416,7 +416,7 @@ static const struct dahdi_echocan_ops vpm_ec_ops = {
#endif
static void __set_clear(struct t4 *wc, int span);
-static int t4_startup(struct dahdi_span *span);
+static int t4_startup(struct file *file, struct dahdi_span *span);
static int t4_shutdown(struct dahdi_span *span);
static int t4_rbsbits(struct dahdi_chan *chan, int bits);
static int t4_maint(struct dahdi_span *span, int cmd);
@@ -1901,7 +1901,9 @@ static void t4_chan_set_sigcap(struct dahdi_span *span, int x)
}
}
-static int t4_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
+static int
+t4_spanconfig(struct file *file, struct dahdi_span *span,
+ struct dahdi_lineconfig *lc)
{
int i;
struct t4_span *ts = container_of(span, struct t4_span, span);
@@ -1943,14 +1945,15 @@ static int t4_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
/* If we're already running, then go ahead and apply the changes */
if (span->flags & DAHDI_FLAG_RUNNING)
- return t4_startup(span);
+ return t4_startup(file, span);
if (debug)
dev_info(&wc->dev->dev, "Done with spanconfig!\n");
return 0;
}
-static int t4_chanconfig(struct dahdi_chan *chan, int sigtype)
+static int
+t4_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype)
{
int alreadyrunning;
unsigned long flags;
@@ -2671,7 +2674,7 @@ static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
wc->numspans, unit + 1, framing, line, crc4);
}
-static int t4_startup(struct dahdi_span *span)
+static int t4_startup(struct file *file, struct dahdi_span *span)
{
#ifdef SUPPORT_GEN1
int i;