summaryrefslogtreecommitdiff
path: root/wcte12xp
diff options
context:
space:
mode:
authorsruffell <sruffell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-19 20:03:33 +0000
committersruffell <sruffell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-19 20:03:33 +0000
commit0525730accbcf75ce41cd30f3bc36a6392763c3b (patch)
tree5f01b2259dbb1919f25ae63624b95b431c3e0566 /wcte12xp
parent44d165a3e554a52be928b077c136e3d014fceb2f (diff)
Improve wcte12xp and wctdm24xxp drivers' tolerance to host system latencies.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3534 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcte12xp')
-rw-r--r--wcte12xp/vpmadt032.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/wcte12xp/vpmadt032.c b/wcte12xp/vpmadt032.c
index e6ff1cd..0b6a8a4 100644
--- a/wcte12xp/vpmadt032.c
+++ b/wcte12xp/vpmadt032.c
@@ -403,10 +403,20 @@ int t1_vpm150m_setreg(struct t1 *wc, unsigned int len, unsigned int addr, unsign
unsigned short t1_vpm150m_getreg(struct t1 *wc, unsigned int len, unsigned int addr, unsigned short *data)
{
unsigned short res;
- t1_vpm150m_setpage(wc, addr >> 16);
- if ((addr >> 16) != ((addr + len) >> 16))
- module_printk("getreg: You found it!\n");
- res = t1_vpm150m_getreg_full(wc, 0, len, addr & 0xffff, data);
+ unsigned short count=0;
+ unsigned short first_data=0;
+ do {
+ t1_vpm150m_setpage(wc, addr >> 16);
+ if ((addr >> 16) != ((addr + len) >> 16))
+ module_printk("getreg: You found it!\n");
+ if (count > 0) {
+ first_data = *data;
+ }
+ res = t1_vpm150m_getreg_full(wc, 0, len, addr & 0xffff, data);
+ } while (((0==count++) || (first_data != *data)) && (count < 100));
+ if (count >= 100) {
+ module_printk(" %s:%d\n", __FILE__, __LINE__);
+ }
return res;
}