From ba34575e0e937839b09539d29ef2b0cf17550e4e Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 4 Apr 2011 16:24:54 +0000 Subject: wctdm24xxp, wcte12xp: Add voicebus_quiesce function. voicebus_quiesce is like voicebus_stop, except that it doesn't wait for any information to come back from the card. This prevents kexec from blocking waiting for information from a potentially dead card. Signed-off-by: Shaun Ruffell Acked-by: Michael Spiceland Acked-by: Kinsey Moore git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9880 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/voicebus/voicebus.c | 20 ++++++++++++++++++++ drivers/dahdi/voicebus/voicebus.h | 1 + 2 files changed, 21 insertions(+) (limited to 'drivers/dahdi/voicebus') diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c index 241d4a9..c98b64f 100644 --- a/drivers/dahdi/voicebus/voicebus.c +++ b/drivers/dahdi/voicebus/voicebus.c @@ -1154,6 +1154,26 @@ void voicebus_stop(struct voicebus *vb) } EXPORT_SYMBOL(voicebus_stop); +/** + * voicebus_quiesce - Halt the voicebus interface. + * @vb: The voicebus structure to quiet + * + * This ensures that the device is not engaged in any DMA transactions or + * interrupting. It does not grab any locks since it may be called by a dying + * kernel. + */ +void voicebus_quiesce(struct voicebus *vb) +{ + if (!vb) + return; + + /* Reset the device */ + __vb_disable_interrupts(vb); + __vb_setctl(vb, 0x0000, 0x1); + __vb_getctl(vb, 0x0000); +} +EXPORT_SYMBOL(voicebus_quiesce); + /*! * \brief Prepare the interface for module unload. * diff --git a/drivers/dahdi/voicebus/voicebus.h b/drivers/dahdi/voicebus/voicebus.h index aaf7c60..764a99b 100644 --- a/drivers/dahdi/voicebus/voicebus.h +++ b/drivers/dahdi/voicebus/voicebus.h @@ -177,6 +177,7 @@ int __voicebus_init(struct voicebus *vb, const char *board_name, void voicebus_release(struct voicebus *vb); int voicebus_start(struct voicebus *vb); void voicebus_stop(struct voicebus *vb); +void voicebus_quiesce(struct voicebus *vb); int voicebus_transmit(struct voicebus *vb, struct vbb *vbb); int voicebus_set_minlatency(struct voicebus *vb, unsigned int milliseconds); int voicebus_current_latency(struct voicebus *vb); -- cgit v1.2.3