summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-09-12 03:09:35 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-09-12 03:09:35 +0000
commitc96f615c4420bee8da2ba102fbf7ca2612ac01d0 (patch)
tree19717a5317f696caeb8392063dbaa8cc4fa9dec2 /sys/arch
parentd502702aae091e3773c2edd3f1ec2c0f2569608e (diff)
use the amount of memory that was mapped to set the length of the packet
in the descriptors rather than a cribbed version of m_length().
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/armv7/omap/if_cpsw.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/sys/arch/armv7/omap/if_cpsw.c b/sys/arch/armv7/omap/if_cpsw.c
index 4fbe5b7c464..4b8fec1b208 100644
--- a/sys/arch/armv7/omap/if_cpsw.c
+++ b/sys/arch/armv7/omap/if_cpsw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cpsw.c,v 1.14 2013/09/12 02:55:03 dlg Exp $ */
+/* $OpenBSD: if_cpsw.c,v 1.15 2013/09/12 03:09:34 dlg Exp $ */
/* $NetBSD: if_cpsw.c,v 1.3 2013/04/17 14:36:34 bouyer Exp $ */
/*
@@ -201,24 +201,6 @@ struct cfdriver cpsw_cd = {
DV_IFNET
};
-/*
- * Return the number of bytes in the mbuf chain, m.
- */
-static __inline u_int
-m_length(const struct mbuf *m)
-{
- const struct mbuf *m0;
- u_int pktlen;
-
- if ((m->m_flags & M_PKTHDR) != 0)
- return m->m_pkthdr.len;
-
- pktlen = 0;
- for (m0 = m; m0 != NULL; m0 = m0->m_next)
- pktlen += m0->m_len;
- return pktlen;
-}
-
static inline u_int
cpsw_txdesc_adjust(u_int x, int y)
{
@@ -542,7 +524,7 @@ cpsw_start(struct ifnet *ifp)
continue;
}
- mlen = m_length(m);
+ mlen = dm->dm_mapsize;
pad = mlen < CPSW_PAD_LEN;
KASSERT(rdp->tx_mb[sc->sc_txnext] == NULL);