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
This commit is contained in:
@@ -790,6 +790,8 @@ struct dahdi_count {
|
||||
#define DAHDI_FLAG_TXUNDERRUN DAHDI_FLAG(TXUNDERRUN)
|
||||
#define DAHDI_FLAG_RXOVERRUN DAHDI_FLAG(RXOVERRUN)
|
||||
|
||||
struct file;
|
||||
|
||||
struct dahdi_span_ops {
|
||||
struct module *owner; /*!< Which module is exporting this span. */
|
||||
|
||||
@@ -799,10 +801,11 @@ struct dahdi_span_ops {
|
||||
int (*setchunksize)(struct dahdi_span *span, int chunksize);
|
||||
|
||||
/*! Opt: Configure the span (if appropriate) */
|
||||
int (*spanconfig)(struct dahdi_span *span, struct dahdi_lineconfig *lc);
|
||||
int (*spanconfig)(struct file *file, struct dahdi_span *span,
|
||||
struct dahdi_lineconfig *lc);
|
||||
|
||||
/*! Opt: Start the span */
|
||||
int (*startup)(struct dahdi_span *span);
|
||||
int (*startup)(struct file *file, struct dahdi_span *span);
|
||||
|
||||
/*! Opt: Shutdown the span */
|
||||
int (*shutdown)(struct dahdi_span *span);
|
||||
@@ -817,7 +820,8 @@ struct dahdi_span_ops {
|
||||
#endif
|
||||
/* ==== Channel Callback Operations ==== */
|
||||
/*! Opt: Set signalling type (if appropriate) */
|
||||
int (*chanconfig)(struct dahdi_chan *chan, int sigtype);
|
||||
int (*chanconfig)(struct file *file, struct dahdi_chan *chan,
|
||||
int sigtype);
|
||||
|
||||
/*! Opt: Prepare a channel for I/O */
|
||||
int (*open)(struct dahdi_chan *chan);
|
||||
|
||||
Reference in New Issue
Block a user