diff options
author | mogorman <mogorman@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-12-12 20:10:44 +0000 |
---|---|---|
committer | mogorman <mogorman@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-12-12 20:10:44 +0000 |
commit | e47fdf539d3c44fe3b502022d32b15d0fc0e8b00 (patch) | |
tree | 85fef2c8edf22c35463bf0df3cc1897af1f6a24d /ztcodec_dte.c | |
parent | 2f198d98a8150963b7154c18930173b8b871f6c3 (diff) |
improved support for loading multiple cards.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1704 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'ztcodec_dte.c')
-rw-r--r-- | ztcodec_dte.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ztcodec_dte.c b/ztcodec_dte.c index da43dfe..31b400e 100644 --- a/ztcodec_dte.c +++ b/ztcodec_dte.c @@ -318,6 +318,7 @@ struct wcdte { unsigned int last_rcommand; unsigned int last_rparm2; unsigned int seq_num; + long timeout; unsigned int ztsnd_rtx; unsigned int ztsnd_0010_rtx; @@ -1158,18 +1159,15 @@ static void wcdte_disable_interrupts(struct wcdte *wc) wcdte_setctl(wc, 0x0084, 0x00000000); } - -static long timeout = 1 * HZ; /* 1 sec */ - static int wcdte_waitfor_csmencaps(struct wcdte *wc, unsigned int mask, int use_mask) { int ret; if (use_mask) - ret = wait_event_interruptible_timeout(wc->regq, (wc->rcvflags == mask), timeout); + ret = wait_event_interruptible_timeout(wc->regq, (wc->rcvflags == mask), wc->timeout); else - ret = wait_event_interruptible_timeout(wc->regq, (wc->last_rcommand == wc->last_command_sent), timeout); + ret = wait_event_interruptible_timeout(wc->regq, (wc->last_rcommand == wc->last_command_sent), wc->timeout); wc->rcvflags = 0; wc->last_rcommand = 0; wc->last_command_sent = 0; @@ -1266,7 +1264,7 @@ static int wcdte_boot_processor(struct wcdte *wc) } while (byteloc < sizeof(wcdte_firmware)-20); - /* Waitfor code to start */ + wc->timeout = 10 * HZ; if (wcdte_waitfor_csmencaps(wc, RCV_CSMENCAPS, 1)) return(1); @@ -1309,7 +1307,6 @@ static int wcdte_create_channel(struct wcdte *wc, int simple, int complicated, i zt_send_cmd(wc, CMD_MSG_VOIP_INDCTRL(wc->seq_num++, chan2), CMD_MSG_VOIP_INDCTRL_LEN, 0x8084); zt_send_cmd(wc, CMD_MSG_VOIP_VOPENA(wc->seq_num++, chan1, complicated), CMD_MSG_VOIP_VOPENA_LEN, 0x8000); zt_send_cmd(wc, CMD_MSG_VOIP_VOPENA(wc->seq_num++, chan2, simple), CMD_MSG_VOIP_VOPENA_LEN, 0x8000); - debug_packets = 0; *dte_chan1 = chan1; *dte_chan2 = chan2; @@ -1332,8 +1329,6 @@ static int wcdte_destroy_channel(struct wcdte *wc, unsigned int chan1, unsigned zt_send_cmd(wc, CMD_MSG_DESTROY_CHANNEL(wc->seq_num++, chan1), CMD_MSG_DESTROY_CHANNEL_LEN, 0x0011); zt_send_cmd(wc, CMD_MSG_DESTROY_CHANNEL(wc->seq_num++, chan2), CMD_MSG_DESTROY_CHANNEL_LEN, 0x0011); - debug_packets=0; - return 1; } @@ -1371,7 +1366,7 @@ static int wcdte_setup_channels(struct wcdte *wc) zt_send_cmd(wc, CMD_MSG_TDM_OPT(wc->seq_num++), CMD_MSG_TDM_OPT_LEN, 0x0435); #endif - timeout = HZ/100 + 1; /* 10msec */ + wc->timeout = HZ/100 + 1; /* 10msec */ return(0); } @@ -1424,6 +1419,7 @@ static int __devinit wcdte_init_one(struct pci_dev *pdev, const struct pci_devic wc->cmdq_wndx = 0; wc->cmdq_rndx = 0; wc->seq_num = 6; + wc->timeout = 1 * HZ; /* 1 sec */ wc->ztsnd_rtx = 0; wc->ztsnd_0010_rtx = 0; |