summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-04-04 16:25:23 +0000
committerShaun Ruffell <sruffell@digium.com>2011-04-04 16:25:23 +0000
commitc86c8924bf1f9e23f8e4e70401feedbaedb47920 (patch)
tree2305fafaa852e7500ea330fab9e52e23cdc13055 /include
parentd662a171515a4cf3e58abde9c509bec6b644a635 (diff)
dahdi: Add in-hardirq versions of the dahdi_receive/transmit/ec_span.
Since cli/sti are expensive instructions, if the board drivers are calling receive/transmit/ec_span from interrupt context all local interrupts do not need to be disabled. The board drivers all still use the normal dahdi_receive and dahdi_transmit. _dahdi_receive and _dahdi_transmit are the "in-hardirq" versions of those functions. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Michael Spiceland <mspiceland@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9884 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index c289429..5b04918 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1048,12 +1048,32 @@ int dahdi_dynamic_register_driver(struct dahdi_dynamic_driver *driver);
/*! \brief Unregister a dynamic driver */
void dahdi_dynamic_unregister_driver(struct dahdi_dynamic_driver *driver);
+int _dahdi_receive(struct dahdi_span *span);
+
/*! Receive on a span. The DAHDI interface will handle all the calculations for
all member channels of the span, pulling the data from the readchunk buffer */
-int dahdi_receive(struct dahdi_span *span);
+static inline int dahdi_receive(struct dahdi_span *span)
+{
+ unsigned long flags;
+ int ret;
+ local_irq_save(flags);
+ ret = _dahdi_receive(span);
+ local_irq_restore(flags);
+ return ret;
+}
+
+int _dahdi_transmit(struct dahdi_span *span);
/*! Prepare writechunk buffers on all channels for this span */
-int dahdi_transmit(struct dahdi_span *span);
+static inline int dahdi_transmit(struct dahdi_span *span)
+{
+ unsigned long flags;
+ int ret;
+ local_irq_save(flags);
+ ret = _dahdi_transmit(span);
+ local_irq_restore(flags);
+ return ret;
+}
/*! Abort the buffer currently being receive with event "event" */
void dahdi_hdlc_abort(struct dahdi_chan *ss, int event);
@@ -1122,9 +1142,26 @@ struct dahdi_tone *dahdi_mf_tone(const struct dahdi_chan *chan, char digit, int
as possible. ECHO CANCELLATION IS NO LONGER AUTOMATICALLY DONE
AT THE DAHDI LEVEL. dahdi_ec_chunk will not echo cancel if it should
not be doing so. rxchunk is modified in-place */
+void _dahdi_ec_chunk(struct dahdi_chan *chan, unsigned char *rxchunk,
+ const unsigned char *txchunk);
-void dahdi_ec_chunk(struct dahdi_chan *chan, unsigned char *rxchunk, const unsigned char *txchunk);
-void dahdi_ec_span(struct dahdi_span *span);
+static inline void dahdi_ec_chunk(struct dahdi_chan *ss, unsigned char *rxchunk,
+ const unsigned char *txchunk)
+{
+ unsigned long flags;
+ local_irq_save(flags);
+ _dahdi_ec_chunk(ss, rxchunk, txchunk);
+ local_irq_restore(flags);
+}
+
+void _dahdi_ec_span(struct dahdi_span *span);
+static inline void dahdi_ec_span(struct dahdi_span *span)
+{
+ unsigned long flags;
+ local_irq_save(flags);
+ _dahdi_ec_span(span);
+ local_irq_restore(flags);
+}
extern struct file_operations *dahdi_transcode_fops;