[zaptel-commits] sruffell: branch 1.2 r3534 - in /branches/1.2: wctdm24xxp/ wcte12xp/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Wed Dec 19 14:03:33 CST 2007


Author: sruffell
Date: Wed Dec 19 14:03:33 2007
New Revision: 3534

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3534
Log:
Improve wcte12xp and wctdm24xxp drivers' tolerance to host system latencies.

Modified:
    branches/1.2/wctdm24xxp/GpakCust.c
    branches/1.2/wcte12xp/vpmadt032.c

Modified: branches/1.2/wctdm24xxp/GpakCust.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp/GpakCust.c?view=diff&rev=3534&r1=3533&r2=3534
==============================================================================
--- branches/1.2/wctdm24xxp/GpakCust.c (original)
+++ branches/1.2/wctdm24xxp/GpakCust.c Wed Dec 19 14:03:33 2007
@@ -202,11 +202,18 @@
 unsigned short wctdm_vpm150m_getreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data)
 {
 	unsigned short res;
-	wctdm_vpm150m_setpage(wc, addr >> 16);
-	if ((addr >> 16) != ((addr + len) >> 16))
-		printk("getreg: You found it!\n");
-	res = wctdm_vpm150m_getreg_full(wc, 0, len, addr & 0xffff, data);
-	return res;
+	unsigned short count=0;
+	unsigned short first_data=0;
+	do {
+		wctdm_vpm150m_setpage(wc, addr >> 16);
+		if ((addr >> 16) != ((addr + len) >> 16))
+			printk("getreg: You found it!\n");
+		if (count > 0) {
+			first_data = *data;
+		}
+		res = wctdm_vpm150m_getreg_full(wc, 0, len, addr & 0xffff, data);
+	} while(((0==count++) || (first_data != *data)) && (count < 100));
+ 	return res;
 }
 
 int wctdm_vpm150m_setreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data)

Modified: branches/1.2/wcte12xp/vpmadt032.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wcte12xp/vpmadt032.c?view=diff&rev=3534&r1=3533&r2=3534
==============================================================================
--- branches/1.2/wcte12xp/vpmadt032.c (original)
+++ branches/1.2/wcte12xp/vpmadt032.c Wed Dec 19 14:03:33 2007
@@ -403,10 +403,20 @@
 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;
 }
 




More information about the zaptel-commits mailing list