diff options
author | silby <silby@FreeBSD.org> | 2003-06-02 05:16:42 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-06-02 05:16:42 +0000 |
commit | 855f61b550e96c1a378280bf549c72f367540611 (patch) | |
tree | 4c3dbd8bf6533b36518ec9c94b880f13282647b0 /sys/dev/fxp | |
parent | 0a83f298dbd53509061ef8c9c96a7862b580a88f (diff) | |
download | FreeBSD-src-855f61b550e96c1a378280bf549c72f367540611.zip FreeBSD-src-855f61b550e96c1a378280bf549c72f367540611.tar.gz |
Replace if_fxp's handrolled defrag function with m_defrag.
No actual bug with the existing code, just tidying things up.
Submitted by: hmp
Diffstat (limited to 'sys/dev/fxp')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 881101d..5b378b0 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1396,24 +1396,13 @@ fxp_start_body(struct ifnet *ifp) * mbuf chain first. Bail out if we can't get the * new buffers. */ - MGETHDR(mn, M_DONTWAIT, MT_DATA); + mn = m_defrag(mb_head, M_DONTWAIT); if (mn == NULL) { m_freem(mb_head); break; + } else { + mb_head = mn; } - if (mb_head->m_pkthdr.len > MHLEN) { - MCLGET(mn, M_DONTWAIT); - if ((mn->m_flags & M_EXT) == 0) { - m_freem(mn); - m_freem(mb_head); - break; - } - } - m_copydata(mb_head, 0, mb_head->m_pkthdr.len, - mtod(mn, caddr_t)); - mn->m_pkthdr.len = mn->m_len = mb_head->m_pkthdr.len; - m_freem(mb_head); - mb_head = mn; error = bus_dmamap_load_mbuf(sc->fxp_mtag, txp->tx_map, mb_head, fxp_dma_map_txbuf, sc, 0); if (error) { |