From 731388e2754e02978e9144560e11a0795ed9a858 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 4 Apr 2011 16:25:09 +0000 Subject: [PATCH] wctdm24xxp, wcte12xp, wct4xxp, wcb4xxp, wctdm: Do not support suspend. These drivers (all DAHDI drivers) should explicitly block suspend if they are loaded. Signed-off-by: Shaun Ruffell Acked-by: Michael Spiceland Acked-by: Kinsey Moore git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9882 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wcb4xxp/base.c | 6 ++++++ drivers/dahdi/wct4xxp/base.c | 6 ++++++ drivers/dahdi/wctc4xxp/base.c | 6 ++++++ drivers/dahdi/wctdm.c | 8 ++++++-- drivers/dahdi/wctdm24xxp/base.c | 6 ++++++ drivers/dahdi/wcte12xp/base.c | 6 ++++++ include/dahdi/kernel.h | 2 +- 7 files changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c index ebe93b2..f10c652 100644 --- a/drivers/dahdi/wcb4xxp/base.c +++ b/drivers/dahdi/wcb4xxp/base.c @@ -3065,11 +3065,17 @@ static DEFINE_PCI_DEVICE_TABLE(b4xx_ids) = }; +static int b4xx_suspend(struct pci_dev *pdev, pm_message_t state) +{ + return -ENOSYS; +} + static struct pci_driver b4xx_driver = { .name = "wcb4xxp", .probe = b4xx_probe, .remove = __devexit_p(b4xxp_remove), .id_table = b4xx_ids, + .suspend = b4xx_suspend, }; static int __init b4xx_init(void) diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 923ed93..97a1f3c 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -4979,6 +4979,11 @@ static void _t4_shutdown(struct pci_dev *pdev) } #endif +static int t4_suspend(struct pci_dev *pdev, pm_message_t state) +{ + return -ENOSYS; +} + static struct pci_driver t4_driver = { .name = "wct4xxp", .probe = t4_init_one, @@ -4986,6 +4991,7 @@ static struct pci_driver t4_driver = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12) .shutdown = _t4_shutdown, #endif + .suspend = t4_suspend, .id_table = t4_pci_tbl, }; diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index 2f771f2..7264621 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -3721,11 +3721,17 @@ static DEFINE_PCI_DEVICE_TABLE(wctc4xxp_pci_tbl) = { MODULE_DEVICE_TABLE(pci, wctc4xxp_pci_tbl); +static int wctc4xxp_suspend(struct pci_dev *pdev, pm_message_t state) +{ + return -ENOSYS; +} + static struct pci_driver wctc4xxp_driver = { .name = "wctc4xxp", .probe = wctc4xxp_init_one, .remove = __devexit_p(wctc4xxp_remove_one), .id_table = wctc4xxp_pci_tbl, + .suspend = wctc4xxp_suspend, }; static int __init wctc4xxp_init(void) diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c index 411795c..9c56865 100644 --- a/drivers/dahdi/wctdm.c +++ b/drivers/dahdi/wctdm.c @@ -2765,12 +2765,16 @@ static DEFINE_PCI_DEVICE_TABLE(wctdm_pci_tbl) = { MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl); +static int wctdm_suspend(struct pci_dev *pdev, pm_message_t state) +{ + return -ENOSYS; +} + static struct pci_driver wctdm_driver = { .name = "wctdm", .probe = wctdm_init_one, .remove =__devexit_p(wctdm_remove_one), - .suspend = NULL, - .resume = NULL, + .suspend = wctdm_suspend, .id_table = wctdm_pci_tbl, }; diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 9a9ad87..003904d 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -4902,6 +4902,11 @@ static void wctdm_shutdown(struct pci_dev *pdev) MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl); +static int wctdm_suspend(struct pci_dev *pdev, pm_message_t state) +{ + return -ENOSYS; +} + static struct pci_driver wctdm_driver = { .name = "wctdm24xxp", .probe = wctdm_init_one, @@ -4909,6 +4914,7 @@ static struct pci_driver wctdm_driver = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12) .shutdown = wctdm_shutdown, #endif + .suspend = wctdm_suspend, .id_table = wctdm_pci_tbl, }; diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 4a290bc..987de9b 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -2377,6 +2377,11 @@ static void te12xp_shutdown(struct pci_dev *pdev) } #endif +static int te12xp_suspend(struct pci_dev *pdev, pm_message_t state) +{ + return -ENOSYS; +} + MODULE_DEVICE_TABLE(pci, te12xp_pci_tbl); static struct pci_driver te12xp_driver = { @@ -2386,6 +2391,7 @@ static struct pci_driver te12xp_driver = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12) .shutdown = te12xp_shutdown, #endif + .suspend = te12xp_suspend, .id_table = te12xp_pci_tbl, }; diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index bd39192..c289429 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -1312,7 +1312,7 @@ wait_for_completion_interruptible_timeout(struct completion *x, return timeout; } #endif - +typedef u32 __bitwise pm_message_t; #endif /* 2.6.11 */ #endif /* 2.6.12 */ #endif /* 2.6.14 */