[Asterisk-cvs] zaptel wcfxs.c,1.77,1.78 zonedata.c,1.20,1.21

markster at lists.digium.com markster at lists.digium.com
Sun Jul 25 17:21:23 CDT 2004


Update of /usr/cvsroot/zaptel
In directory localhost.localdomain:/tmp/cvs-serv1198

Modified Files:
	wcfxs.c zonedata.c 
Log Message:
Unify sleep code in wcfxs, merge belgium tones (bug #2130)


Index: wcfxs.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxs.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- wcfxs.c	19 Jul 2004 20:43:54 -0000	1.77
+++ wcfxs.c	25 Jul 2004 21:07:29 -0000	1.78
@@ -1066,11 +1066,17 @@
 }
 #endif
 
-static int wcfxs_init_voicedaa(struct wcfxs *wc, int card, int fast, int manual, int sane)
+static void wait_just_a_bit(int foo)
 {
 	long newjiffies;
+	newjiffies = jiffies + foo;
+	while(jiffies < newjiffies);
+}
+
+static int wcfxs_init_voicedaa(struct wcfxs *wc, int card, int fast, int manual, int sane)
+{
 	unsigned char reg16=0, reg26=0, reg30=0, reg31=0;
-	
+	long newjiffies;
 	wc->modtype[card] = MOD_TYPE_FXO;
 	/* Sanity check the ProSLIC */
 	reset_spi(wc, card);
@@ -1081,8 +1087,7 @@
 	wcfxs_setreg(wc, card, 1, 0x80);
 
 	/* Wait just a bit */
-	newjiffies = jiffies + (HZ/10);
-	while(jiffies < newjiffies);
+	wait_just_a_bit(HZ/10);
 
 	/* Enable PCM, ulaw */
 	wcfxs_setreg(wc, card, 33, 0x28);
@@ -1121,7 +1126,8 @@
 	/* Wait 1000ms for ISO-cap to come up */
 	newjiffies = jiffies;
 	newjiffies += 2 * HZ;
-	while((jiffies < newjiffies) && !(wcfxs_getreg(wc, card, 11) & 0xf0));
+	while((jiffies < newjiffies) && !(wcfxs_getreg(wc, card, 11) & 0xf0))
+		wait_just_a_bit(HZ/10);
 
 	if (!(wcfxs_getreg(wc, card, 11) & 0xf0)) {
 		printk("VoiceDAA did not bring up ISO link properly!\n");
@@ -1724,7 +1730,6 @@
 static int wcfxs_hardware_init(struct wcfxs *wc)
 {
 	/* Hardware stuff */
-	long oldjiffies;
 	unsigned char ver;
 	unsigned char x,y;
 	int failed;
@@ -1779,8 +1784,7 @@
 	outb(0x4, wc->ioaddr + WC_AUXFUNC);
 	
 	/* Wait 1/4 of a sec */
-	oldjiffies = jiffies;
-	while(jiffies - oldjiffies < (HZ / 4) + 1);
+	wait_just_a_bit(HZ/4);
 
 	/* Back to normal, with automatic DMA wrap around */
 	outb(0x30 | 0x01, wc->ioaddr + WC_CNTL);
@@ -1807,8 +1811,7 @@
 	outb(0xff, wc->ioaddr + WC_INTSTAT);
 
 	/* Wait 1/4 of a second more */
-	oldjiffies = jiffies;
-	while(jiffies - oldjiffies < (HZ / 4) + 1);
+	wait_just_a_bit(HZ/4);
 
 	for (x=0;x<wc->cards;x++) {
 		int sane=0,ret=0;

Index: zonedata.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zonedata.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- zonedata.c	13 Jun 2004 03:53:51 -0000	1.20
+++ zonedata.c	25 Jul 2004 21:07:29 -0000	1.21
@@ -247,5 +247,20 @@
 		/*{ ZT_TONE_STUTTER, "425/320,0/20" },              Real swedish standard, not used for now */
 		{ ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" } },
 	},
+	{ 17, "be", "Belgium", { 1000, 3000 },
+	{
+		{ ZT_TONE_DIALTONE, "425" },
+		{ ZT_TONE_BUSY, "425/500,0/500" },
+		{ ZT_TONE_RINGTONE, "425/1000,0/3000" },
+		{ ZT_TONE_CONGESTION, "425/167,0/167" },
+		{ ZT_TONE_CALLWAIT, "1400/175,0/175,1400/175,0/3500" },
+		/* DIALRECALL - not specified */
+		{ ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" },
+		/* RECORDTONE - not specified */
+		{ ZT_TONE_RECORDTONE, "1400/500,0/15000" },
+		{ ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" },
+		/* STUTTER not specified */
+		{ ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" } },
+	},
 	{ -1 }		
 };




More information about the svn-commits mailing list