summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp
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/xpp
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/xpp')
-rw-r--r--drivers/dahdi/xpp/card_bri.c16
-rw-r--r--drivers/dahdi/xpp/card_pri.c10
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c
index 7e4ae9a..f3b5565 100644
--- a/drivers/dahdi/xpp/card_bri.c
+++ b/drivers/dahdi/xpp/card_bri.c
@@ -162,9 +162,11 @@ static void bri_packet_dump(const char *msg, xpacket_t *pack);
#ifdef CONFIG_PROC_FS
static int proc_bri_info_read(char *page, char **start, off_t off, int count, int *eof, void *data);
#endif
-static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc);
-static int bri_chanconfig(struct dahdi_chan *chan, int sigtype);
-static int bri_startup(struct dahdi_span *span);
+static int bri_spanconfig(struct file *file, struct dahdi_span *span,
+ struct dahdi_lineconfig *lc);
+static int bri_chanconfig(struct file *file, struct dahdi_chan *chan,
+ int sigtype);
+static int bri_startup(struct file *file, struct dahdi_span *span);
static int bri_shutdown(struct dahdi_span *span);
#define PROC_REGISTER_FNAME "slics"
@@ -1165,7 +1167,8 @@ static int BRI_card_close(xpd_t *xpd, lineno_t pos)
/*
* Called only for 'span' keyword in /etc/dahdi/system.conf
*/
-static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
+static int bri_spanconfig(struct file *file, struct dahdi_span *span,
+ struct dahdi_lineconfig *lc)
{
struct phonedev *phonedev = container_of(span, struct phonedev, span);
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
@@ -1210,7 +1213,8 @@ static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
* Called from dahdi with spinlock held on chan. Must not call back
* dahdi functions.
*/
-static int bri_chanconfig(struct dahdi_chan *chan, int sigtype)
+static int bri_chanconfig(struct file *file, struct dahdi_chan *chan,
+ int sigtype)
{
DBG(GENERAL, "channel %d (%s) -> %s\n", chan->channo, chan->name, sig2str(sigtype));
// FIXME: sanity checks:
@@ -1222,7 +1226,7 @@ static int bri_chanconfig(struct dahdi_chan *chan, int sigtype)
/*
* Called only for 'span' keyword in /etc/dahdi/system.conf
*/
-static int bri_startup(struct dahdi_span *span)
+static int bri_startup(struct file *file, struct dahdi_span *span)
{
struct phonedev *phonedev = container_of(span, struct phonedev, span);
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
index a2f755f..8d7e76d 100644
--- a/drivers/dahdi/xpp/card_pri.c
+++ b/drivers/dahdi/xpp/card_pri.c
@@ -75,7 +75,7 @@ static bool is_sigtype_dchan(int sigtype)
static bool pri_packet_is_valid(xpacket_t *pack);
static void pri_packet_dump(const char *msg, xpacket_t *pack);
-static int pri_startup(struct dahdi_span *span);
+static int pri_startup(struct file *file, struct dahdi_span *span);
static int pri_shutdown(struct dahdi_span *span);
static int pri_rbsbits(struct dahdi_chan *chan, int bits);
static int pri_lineconfig(xpd_t *xpd, int lineconfig);
@@ -1033,7 +1033,8 @@ bad_lineconfig:
* Called only for 'span' keyword in /etc/dahdi/system.conf
*/
-static int pri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
+static int pri_spanconfig(struct file *file, struct dahdi_span *span,
+ struct dahdi_lineconfig *lc)
{
struct phonedev *phonedev = container_of(span, struct phonedev, span);
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
@@ -1068,7 +1069,8 @@ static int pri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
* Called from dahdi with spinlock held on chan. Must not call back
* dahdi functions.
*/
-static int pri_chanconfig(struct dahdi_chan *chan, int sigtype)
+static int pri_chanconfig(struct file *file, struct dahdi_chan *chan,
+ int sigtype)
{
struct phonedev *phonedev = container_of(chan->span, struct phonedev, span);
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
@@ -1455,7 +1457,7 @@ static int PRI_card_close(xpd_t *xpd, lineno_t pos)
/*
* Called only for 'span' keyword in /etc/dahdi/system.conf
*/
-static int pri_startup(struct dahdi_span *span)
+static int pri_startup(struct file *file, struct dahdi_span *span)
{
struct phonedev *phonedev = container_of(span, struct phonedev, span);
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);