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,