summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wctc4xxp
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-07-28 15:32:03 +0000
committerShaun Ruffell <sruffell@digium.com>2010-07-28 15:32:03 +0000
commitd1cee7988edd84a9284a110a297f51f852e2cbf6 (patch)
tree6a692a349dbde87f041d2e3efc96442d1a19116c /drivers/dahdi/wctc4xxp
parent4164ada24fa68cfd59d26d8409c1937a483ec2b4 (diff)
wctc4xxp: Add compile-time option to always poll the interface.
Added as a workaround for a system which was not routing interrupts properly and therefore is off by default. Candidate for reversion in a couple of years. DAHDI-627. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9037 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctc4xxp')
-rw-r--r--drivers/dahdi/wctc4xxp/base.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c
index 680470a..d5137b1 100644
--- a/drivers/dahdi/wctc4xxp/base.c
+++ b/drivers/dahdi/wctc4xxp/base.c
@@ -99,6 +99,13 @@ typedef unsigned gfp_t; /* Added in 2.6.14 */
#endif
#endif
+
+/* define CONFIG_WCTC4XXP_POLLING to operate in a pure polling mode. This is
+ * was placed in as a debugging tool for a particluar system that wasn't
+ * routing the interrupt properly. Therefore it is off by default and the
+ * driver must be recompiled to enable it. */
+#undef CONFIG_WCTC4XXP_POLLING
+
/* The total number of active channels over which the driver will start polling
* the card every 10 ms. */
#define POLLING_CALL_THRESHOLD 40
@@ -1896,10 +1903,13 @@ wctc4xxp_operation_release(struct dahdi_transcoder_channel *dtc)
#endif
atomic_dec(&wc->open_channels);
+
+#if !defined(CONFIG_WCTC4XXP_POLLING)
if (atomic_read(&wc->open_channels) < POLLING_CALL_THRESHOLD) {
if (test_bit(DTE_POLLING, &wc->flags))
wctc4xxp_disable_polling(wc);
}
+#endif
packets_received = atomic_read(&cpvt->stats.packets_received);
packets_sent = atomic_read(&cpvt->stats.packets_sent);
@@ -2868,6 +2878,10 @@ wctc4xxp_load_firmware(struct wcdte *wc, const struct firmware *firmware)
if (!cmd)
return -ENOMEM;
+#if defined(CONFIG_WCTC4XXP_POLLING)
+ wctc4xxp_enable_polling(wc);
+#endif
+
while (byteloc < (firmware->size-20)) {
last_byteloc = byteloc;
length = (firmware->data[byteloc] << 8) |
@@ -2883,14 +2897,24 @@ wctc4xxp_load_firmware(struct wcdte *wc, const struct firmware *firmware)
if (cmd->flags & DTE_CMD_TIMEOUT) {
free_cmd(cmd);
DTE_PRINTK(ERR, "Failed to load firmware.\n");
+#if defined(CONFIG_WCTC4XXP_POLLING)
+ wctc4xxp_disable_polling(wc);
+#endif
return -EIO;
}
}
free_cmd(cmd);
if (!wait_event_timeout(wc->waitq, wctc4xxp_is_ready(wc), 15*HZ)) {
DTE_PRINTK(ERR, "Failed to boot firmware.\n");
+#if defined(CONFIG_WCTC4XXP_POLLING)
+ wctc4xxp_disable_polling(wc);
+#endif
return -EIO;
}
+
+#if defined(CONFIG_WCTC4XXP_POLLING)
+ wctc4xxp_disable_polling(wc);
+#endif
return 0;
}
@@ -3567,6 +3591,9 @@ wctc4xxp_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (res)
goto error_exit_hwinit;
+#if defined(CONFIG_WCTC4XXP_POLLING)
+ wctc4xxp_enable_polling(wc);
+#endif
res = wctc4xxp_setup_channels(wc);
if (res)
goto error_exit_hwinit;
@@ -3589,6 +3616,9 @@ wctc4xxp_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
error_exit_hwinit:
+#if defined(CONFIG_WCTC4XXP_POLLING)
+ wctc4xxp_disable_polling(wc);
+#endif
wctc4xxp_stop_dma(wc);
wctc4xxp_cleanup_command_list(wc);
free_irq(pdev->irq, wc);