summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-04-04 16:24:54 +0000
committerShaun Ruffell <sruffell@digium.com>2011-04-04 16:24:54 +0000
commit18fabdcaf495630add47f21c1c135f4244579ac9 (patch)
tree359de9dab533eb171baa4177f0bb800df41fb8fa /drivers
parent0ea3a95125cffd1fdb97de2cf316af7ad1088340 (diff)
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 <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@9880 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/voicebus/voicebus.c20
-rw-r--r--drivers/dahdi/voicebus/voicebus.h1
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c2
-rw-r--r--drivers/dahdi/wcte12xp/base.c6
4 files changed, 25 insertions, 4 deletions
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);
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index caa39c1..9a9ad87 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -4896,7 +4896,7 @@ static DEFINE_PCI_DEVICE_TABLE(wctdm_pci_tbl) = {
static void wctdm_shutdown(struct pci_dev *pdev)
{
struct wctdm *wc = pci_get_drvdata(pdev);
- voicebus_stop(&wc->vb);
+ voicebus_quiesce(&wc->vb);
}
#endif
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 88a3c13..4a290bc 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -2369,11 +2369,11 @@ static DEFINE_PCI_DEVICE_TABLE(te12xp_pci_tbl) = {
{ 0 }
};
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2, 6, 12)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
static void te12xp_shutdown(struct pci_dev *pdev)
{
struct t1 *wc = pci_get_drvdata(pdev);
- voicebus_stop(&wc->vb);
+ voicebus_quiesce(&wc->vb);
}
#endif
@@ -2383,7 +2383,7 @@ static struct pci_driver te12xp_driver = {
.name = "wcte12xp",
.probe = te12xp_init_one,
.remove = __devexit_p(te12xp_remove_one),
-#if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2, 6, 12)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
.shutdown = te12xp_shutdown,
#endif
.id_table = te12xp_pci_tbl,