diff options
author | dillon <dillon@FreeBSD.org> | 2002-02-05 02:00:56 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2002-02-05 02:00:56 +0000 |
commit | b3ddc72561f16866b59e6109d6803494f0d06caa (patch) | |
tree | ddce9732dedf55dfc29f00f3efed3b0ce5e9788e /sys/dev | |
parent | 0511c3ea5ba32c8d8794bbaecfb500020b2d7f0f (diff) | |
download | FreeBSD-src-b3ddc72561f16866b59e6109d6803494f0d06caa.zip FreeBSD-src-b3ddc72561f16866b59e6109d6803494f0d06caa.tar.gz |
Get rid of the twisted MFREE() macro entirely.
Reviewed by: dg, bmilekic
MFC after: 3 days
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cnw/if_cnw.c | 10 | ||||
-rw-r--r-- | sys/dev/lnc/if_lnc.c | 12 | ||||
-rw-r--r-- | sys/dev/vx/if_vx.c | 26 |
3 files changed, 23 insertions, 25 deletions
diff --git a/sys/dev/cnw/if_cnw.c b/sys/dev/cnw/if_cnw.c index fdfb903..4414fc5 100644 --- a/sys/dev/cnw/if_cnw.c +++ b/sys/dev/cnw/if_cnw.c @@ -869,12 +869,11 @@ cnw_start(ifp) * Transmit a packet. */ void -cnw_transmit(sc, m0) +cnw_transmit(sc, m) struct cnw_softc *sc; - struct mbuf *m0; + struct mbuf *m; { int buffer, bufsize, bufoffset, bufptr, bufspace, len, mbytes, n; - struct mbuf *m; u_int8_t *mptr; /* Get buffer info from card */ @@ -891,7 +890,7 @@ cnw_transmit(sc, m0) bufptr = sc->sc_memoff + buffer + bufoffset; bufspace = bufsize; len = 0; - for (m = m0; m; ) { + while (m) { mptr = mtod(m, u_int8_t *); mbytes = m->m_len; len += mbytes; @@ -914,8 +913,7 @@ cnw_transmit(sc, m0) mptr += n; mbytes -= n; } - MFREE(m, m0); - m = m0; + m = m_free(m); } /* Issue transmit command */ diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index 9028b98..1630928 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -833,9 +833,11 @@ lnc_tint(struct lnc_softc *sc) sc->mbuf_count++; start->buff.mbuf = 0; } else { - struct mbuf *junk; - MFREE(start->buff.mbuf, junk); - start->buff.mbuf = 0; + /* + * XXX should this be m_freem()? + */ + m_free(start->buff.mbuf); + start->buff.mbuf = NULL; } } sc->pending_transmits--; @@ -1308,8 +1310,8 @@ lnc_start(struct ifnet *ifp) m->m_len -= chunk; m->m_data += chunk; if (m->m_len <= 0) { - MFREE(m, head->m_next); - m = head->m_next; + m = m_free(m); + head->m_next = m; } } } diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index 21152ab..af0e7b0 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -390,7 +390,7 @@ vxstart(ifp) struct ifnet *ifp; { register struct vx_softc *sc = ifp->if_softc; - register struct mbuf *m, *m0; + register struct mbuf *m; int sh, len, pad; /* Don't transmit if interface is busy or not running */ @@ -399,14 +399,14 @@ vxstart(ifp) startagain: /* Sneak a peek at the next packet */ - m0 = ifp->if_snd.ifq_head; - if (m0 == 0) { + m = ifp->if_snd.ifq_head; + if (m == NULL) { return; } /* We need to use m->m_pkthdr.len, so require the header */ - if ((m0->m_flags & M_PKTHDR) == 0) + if ((m->m_flags & M_PKTHDR) == 0) panic("vxstart: no header mbuf"); - len = m0->m_pkthdr.len; + len = m->m_pkthdr.len; pad = (4 - len) & 3; @@ -418,8 +418,8 @@ startagain: if (len + pad > ETHER_MAX_LEN) { /* packet is obviously too large: toss it */ ++ifp->if_oerrors; - IF_DEQUEUE(&ifp->if_snd, m0); - m_freem(m0); + IF_DEQUEUE(&ifp->if_snd, m); + m_freem(m); goto readcheck; } VX_BUSY_WAIT; @@ -433,17 +433,16 @@ startagain: } } CSR_WRITE_2(sc, VX_COMMAND, SET_TX_AVAIL_THRESH | (8188 >> 2)); - IF_DEQUEUE(&ifp->if_snd, m0); - if (m0 == 0) { /* not really needed */ + IF_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) /* not really needed */ return; - } VX_BUSY_WAIT; CSR_WRITE_2(sc, VX_COMMAND, SET_TX_START_THRESH | ((len / 4 + sc->tx_start_thresh) >> 2)); if (sc->arpcom.ac_if.if_bpf) { - bpf_mtap(&sc->arpcom.ac_if, m0); + bpf_mtap(&sc->arpcom.ac_if, m); } /* @@ -454,7 +453,7 @@ startagain: CSR_WRITE_4(sc, VX_W1_TX_PIO_WR_1, len | TX_INDICATE); - for (m = m0; m != 0;) { + while (m) { if (m->m_len > 3) bus_space_write_multi_4(sc->vx_btag, sc->vx_bhandle, VX_W1_TX_PIO_WR_1, (u_int32_t *)mtod(m, caddr_t), m->m_len / 4); @@ -462,8 +461,7 @@ startagain: bus_space_write_multi_1(sc->vx_btag, sc->vx_bhandle, VX_W1_TX_PIO_WR_1, mtod(m, caddr_t) + (m->m_len & ~3) , m->m_len & 3); - MFREE(m, m0); - m = m0; + m = m_free(m); } while (pad--) CSR_WRITE_1(sc, VX_W1_TX_PIO_WR_1, 0); /* Padding */ |