diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-06-02 20:01:34 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-06-02 20:01:34 +0000 |
commit | cd419f86a583306c63a461b7e79a52e96c1e20bc (patch) | |
tree | 41b574bfc2b9ce4a87bbdfed680ed69895342198 /drivers/dahdi/wcb4xxp/base.c | |
parent | e1359adcca7980a13988af0366455bb2f4cb0980 (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/wcb4xxp/base.c')
-rw-r--r-- | drivers/dahdi/wcb4xxp/base.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c index b8c684b..f36660d 100644 --- a/drivers/dahdi/wcb4xxp/base.c +++ b/drivers/dahdi/wcb4xxp/base.c @@ -2277,7 +2277,7 @@ static int b4xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long return 0; } -static int b4xxp_startup(struct dahdi_span *span) +static int b4xxp_startup(struct file *file, struct dahdi_span *span) { struct b4xxp_span *bspan = container_of(span, struct b4xxp_span, span); struct b4xxp *b4 = bspan->parent; @@ -2310,7 +2310,8 @@ static void b4xxp_reset_span(struct b4xxp_span *bspan) } /* spanconfig for us means to set up the HFC FIFO and channel mapping */ -static int b4xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) +static int b4xxp_spanconfig(struct file *file, struct dahdi_span *span, + struct dahdi_lineconfig *lc) { int i; struct b4xxp_span *bspan = container_of(span, struct b4xxp_span, span); @@ -2347,7 +2348,7 @@ static int b4xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc b4xxp_reset_span(bspan); /* call startup() manually here, because DAHDI won't call the startup function unless it receives an IOCTL to do so, and dahdi_cfg doesn't. */ - b4xxp_startup(&bspan->span); + b4xxp_startup(file, &bspan->span); span->flags |= DAHDI_FLAG_RUNNING; @@ -2355,7 +2356,8 @@ static int b4xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc } /* chanconfig for us means to configure the HDLC controller, if appropriate */ -static int b4xxp_chanconfig(struct dahdi_chan *chan, int sigtype) +static int +b4xxp_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype) { int alreadyrunning; struct b4xxp *b4 = chan->pvt; @@ -2820,7 +2822,7 @@ static int b4xxp_proc_read(char *buf, char **start, off_t offset, int count, int static int b4xxp_startdefaultspan(struct b4xxp *b4) { struct dahdi_lineconfig lc = {0,}; - return b4xxp_spanconfig(&b4->spans[0].span, &lc); + return b4xxp_spanconfig(NULL, &b4->spans[0].span, &lc); } static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |