summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorRaphael Graf <rapha@cvs.openbsd.org>2013-07-15 17:30:23 +0000
committerRaphael Graf <rapha@cvs.openbsd.org>2013-07-15 17:30:23 +0000
commit6723143a97f07116636720ea856cf24a0e1c20e2 (patch)
tree2b58ced404590b383e72ec11fb92f75ecfc47aa1 /sys/arch
parent4fa82cf8b3271a68ada39b6d7716b5cb09d97db3 (diff)
Use bus_space_set_region_4 instead of looping over bus_space_write_4,
and remove some includes. ok patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/beagle/dev/if_cpsw.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/arch/beagle/dev/if_cpsw.c b/sys/arch/beagle/dev/if_cpsw.c
index 54438160414..cdd2319bb35 100644
--- a/sys/arch/beagle/dev/if_cpsw.c
+++ b/sys/arch/beagle/dev/if_cpsw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cpsw.c,v 1.4 2013/07/04 08:35:52 rapha Exp $ */
+/* $OpenBSD: if_cpsw.c,v 1.5 2013/07/15 17:30:22 rapha Exp $ */
/* $NetBSD: if_cpsw.c,v 1.3 2013/04/17 14:36:34 bouyer Exp $ */
/*
@@ -55,12 +55,8 @@
#include "bpfilter.h"
-#include <sys/cdefs.h>
-
#include <sys/param.h>
-#include <sys/endian.h>
#include <sys/systm.h>
-#include <sys/types.h>
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/queue.h>
@@ -72,8 +68,6 @@
#include <machine/bus.h>
#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_llc.h>
#include <net/if_media.h>
#include <netinet/in.h>
@@ -866,16 +860,16 @@ cpsw_init(struct ifnet *ifp)
cpsw_write_4(sc, CPSW_CPDMA_RX_CP(i), 0);
}
- for (i = 0; i < CPSW_CPPI_RAM_TXDESCS_SIZE/4; i++)
- bus_space_write_4(sc->sc_bst, sc->sc_bsh_txdescs, i*4, 0);
+ bus_space_set_region_4(sc->sc_bst, sc->sc_bsh_txdescs, 0, 0,
+ CPSW_CPPI_RAM_TXDESCS_SIZE/4);
sc->sc_txhead = 0;
sc->sc_txnext = 0;
cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), 0);
- for (i = 0; i < CPSW_CPPI_RAM_RXDESCS_SIZE/4; i++)
- bus_space_write_4(sc->sc_bst, sc->sc_bsh_rxdescs, i*4, 0);
+ bus_space_set_region_4(sc->sc_bst, sc->sc_bsh_rxdescs, 0, 0,
+ CPSW_CPPI_RAM_RXDESCS_SIZE/4);
/* Initialize RX Buffer Descriptors */
cpsw_set_rxdesc_next(sc, RXDESC_PREV(0), 0);