[asterisk-dev] Patch: wcfxo; Failed to initailize DAA, giving up...

Timothy Allen tallen at integsys.biz
Mon Jan 12 12:39:49 CST 2009

My apologies, in my exuberance I initially sent this to the two  
programmers at the top of the source listing having read all the code  
except the comment telling me not to do what I did.

After spending a week in a lab trying to track down what I thought was  
a hardware bug I have found that the driver fails to reset the DAA.  
Apparently the writer assumed, as did I until I reverse engineered the  
card, that bit 0 in WC_CNTL would reset the PCI interface as well as  
the DAA; however, for reasons I'm unclear on, the hardware designers  
wired the DAA's reset to AUX5; therefore, it is necessary to take AUX5  
low for a few ms and then high to reset the DAA.

Many people have varying levels of success with this card. This seems  
to be related to their power supplies. I have observed that some power  
supplies seem to have a higher likelihood of making the DAA come up in  
a running state (doesn't need a reset).

Anyway, here's the patch- hope I did it right, never made a patch  
before. Those of you trying this please keep an eye out for a spurious  
NMI the first time the driver loads. I saw it once or twice. Not sure  
what it is- it doesn't reoccur or crash my machine.

--- wcfxo.c	2008-08-13 20:58:36.000000000 -0400
+++ wcfxoNew.c	2009-01-11 11:24:51.000000000 -0500
@@ -696,6 +696,16 @@
  	/* Hardware stuff */
  	/* Reset PCI Interface chip and registers */
  	outb(0x0e, wc->ioaddr + WC_CNTL);
+	/* Set all to outputs except AUX 4, which is an input */
+	outb(0xef, wc->ioaddr + WC_AUXC);
+	/* Reset the DAA (DAA uses AUX5 for reset) */
+	outb(0x00, wc->ioaddr + WC_AUXD);
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(1 + HZ / 800);
+	/* Set hook state to on hook & un-reset the DAA */
  	if (wc->flags & FLAG_RESET_ON_AUX5) {
  		/* Set hook state to on hook for when we switch.
  		   Make sure reset is high */
@@ -704,9 +714,7 @@
  		/* Set hook state to on hook for when we switch */
  		outb(0x24, wc->ioaddr + WC_AUXD);
-	/* Set all to outputs except AUX 4, which is an input */
-	outb(0xef, wc->ioaddr + WC_AUXC);
  	/* Back to normal, with automatic DMA wrap around */
  	outb(0x01, wc->ioaddr + WC_CNTL);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090112/aab194e8/attachment.htm 

More information about the asterisk-dev mailing list