From 0525730accbcf75ce41cd30f3bc36a6392763c3b Mon Sep 17 00:00:00 2001 From: sruffell Date: Wed, 19 Dec 2007 20:03:33 +0000 Subject: 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 --- wcte12xp/vpmadt032.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'wcte12xp') 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; } -- cgit v1.2.3