summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wct4xxp
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2010-07-02 18:58:32 +0000
committerMatthew Fredrickson <creslin@digium.com>2010-07-02 18:58:32 +0000
commitaec3808dd892e5a54dab502269e8b17b61f2017c (patch)
treeeea5e15b802178340548c99ecc20b3c44f7b8009 /drivers/dahdi/wct4xxp
parent6895cb097ce32fffe7a8995fae3598b7864da59d (diff)
Add support for max_latency module parameter in wct4xxp
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8849 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wct4xxp')
-rw-r--r--drivers/dahdi/wct4xxp/base.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index de20706..4ce3a40 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -77,6 +77,9 @@
#define DEBUG_RBS (1 << 5)
#define DEBUG_FRAMER (1 << 6)
+/* Maximum latency to be used with Gen 5 */
+#define GEN5_MAX_LATENCY 127
+
#define T4_BASE_SIZE (DAHDI_MAX_CHUNKSIZE * 32 * 4)
#ifdef ENABLE_WORKQUEUES
@@ -176,6 +179,7 @@ static int alarmdebounce = 2500; /* LOF/LFA def to 2.5s AT&T TR54016*/
static int losalarmdebounce = 2500;/* LOS def to 2.5s AT&T TR54016*/
static int aisalarmdebounce = 2500;/* AIS(blue) def to 2.5s AT&T TR54016*/
static int yelalarmdebounce = 500;/* RAI(yellow) def to 0.5s AT&T devguide */
+static int max_latency = GEN5_MAX_LATENCY; /* Used to set a maximum latency (if you don't wish it to hard cap it at a certain value) in milliseconds */
static int extendedreset = 0;
#ifdef VPM_SUPPORT
static int vpmsupport = 1;
@@ -3483,6 +3487,7 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2)
if ((rxident != expected) && !test_bit(T4_IGNORE_LATENCY, &wc->checkflag)) {
int needed_latency;
+ int smallest_max;
if (debug & DEBUG_MAIN)
printk("!!! Missed interrupt. Expected ident of %d and got ident of %d\n", expected, rxident);
@@ -3498,9 +3503,11 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2)
needed_latency += 1;
- if (needed_latency >= 128) {
- printk("Truncating latency request to 127 instead of %d\n", needed_latency);
- needed_latency = 127;
+ smallest_max = (max_latency >= GEN5_MAX_LATENCY) ? GEN5_MAX_LATENCY : max_latency;
+
+ if (needed_latency > smallest_max) {
+ printk("Truncating latency request to %d instead of %d\n", smallest_max, needed_latency);
+ needed_latency = smallest_max;
}
if (needed_latency > wc->numbufs) {
@@ -4551,6 +4558,7 @@ module_param(alarmdebounce, int, 0600);
module_param(losalarmdebounce, int, 0600);
module_param(aisalarmdebounce, int, 0600);
module_param(yelalarmdebounce, int, 0600);
+module_param(max_latency, int, 0600);
module_param(j1mode, int, 0600);
module_param(sigmode, int, 0600);
module_param(latency, int, 0600);