Module Name:    src
Committed By:   matt
Date:           Thu Jan 10 22:07:19 UTC 2013

Modified Files:
        src/sys/arch/arm/broadcom: bcm53xx_eth.c

Log Message:
Don't hard code the frequency used for INTRCVLAZY but grab the correct
frequency from the cpu_softc.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/broadcom/bcm53xx_eth.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.21 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.22
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.21	Wed Jan  9 18:19:09 2013
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Thu Jan 10 22:07:19 2013
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.21 2013/01/09 18:19:09 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.22 2013/01/10 22:07:19 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -551,8 +551,9 @@ bcmeth_ifinit(struct ifnet *ifp)
 	bcmeth_write_4(sc, GMAC_DEVCONTROL, devctl);
 
 	/* Setup lazy receive (at most 1ms). */
+	const struct cpu_softc * const cpu = curcpu()->ci_softc;
 	sc->sc_rcvlazy =  __SHIFTIN(4, INTRCVLAZY_FRAMECOUNT)
-	     | __SHIFTIN(125000000 / 1000, INTRCVLAZY_TIMEOUT);
+	     | __SHIFTIN(cpu->cpu_clk.clk_apb / 1000, INTRCVLAZY_TIMEOUT);
 	bcmeth_write_4(sc, GMAC_INTRCVLAZY, sc->sc_rcvlazy);
 
 	/* 11. Enable transmit queues in TQUEUE, and ensure that the transmit scheduling mode is correctly set in TCTRL. */

Reply via email to