diff options
author | brooks <brooks@FreeBSD.org> | 2005-06-10 16:49:24 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-06-10 16:49:24 +0000 |
commit | 567ba9b00a248431e7c1147c4e079fd7a11b9ecf (patch) | |
tree | f65b6d7834b40dfcd48534829a0a1e9529ab87ee /sys/dev/patm/if_patm_rx.c | |
parent | 3eaa67c3ad947d85be5350e0e184cd6ee5b93a52 (diff) | |
download | FreeBSD-src-567ba9b00a248431e7c1147c4e079fd7a11b9ecf.zip FreeBSD-src-567ba9b00a248431e7c1147c4e079fd7a11b9ecf.tar.gz |
Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.
This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.
Other changes of note:
- Struct arpcom is no longer referenced in normal interface code.
Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
To enforce this ac_enaddr has been renamed to _ac_enaddr.
- The second argument to ether_ifattach is now always the mac address
from driver private storage rather than sometimes being ac_enaddr.
Reviewed by: sobomax, sam
Diffstat (limited to 'sys/dev/patm/if_patm_rx.c')
-rw-r--r-- | sys/dev/patm/if_patm_rx.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/patm/if_patm_rx.c b/sys/dev/patm/if_patm_rx.c index 01c3243..1a012a9 100644 --- a/sys/dev/patm/if_patm_rx.c +++ b/sys/dev/patm/if_patm_rx.c @@ -244,7 +244,7 @@ patm_rx(struct patm_softc *sc, struct idt_rsqe *rsqe) m->m_len = cells * 48; m->m_pkthdr.len = m->m_len; - m->m_pkthdr.rcvif = &sc->ifatm.ifnet; + m->m_pkthdr.rcvif = sc->ifp; } else if (vcc->vcc.aal == ATMIO_AAL_34) { /* XXX AAL3/4 */ @@ -253,7 +253,7 @@ patm_rx(struct patm_softc *sc, struct idt_rsqe *rsqe) } else if (vcc->vcc.aal == ATMIO_AAL_5) { if (stat & IDT_RSQE_CRC) { - sc->ifatm.ifnet.if_ierrors++; + sc->ifp->if_ierrors++; if (vcc->chain != NULL) { m_freem(vcc->chain); vcc->chain = vcc->last = NULL; @@ -267,7 +267,7 @@ patm_rx(struct patm_softc *sc, struct idt_rsqe *rsqe) return; m->m_len = cells * 48; m->m_pkthdr.len = m->m_len; - m->m_pkthdr.rcvif = &sc->ifatm.ifnet; + m->m_pkthdr.rcvif = sc->ifp; vcc->chain = vcc->last = m; } else { if ((m = patm_rcv_mbuf(sc, buf, h, 0)) == NULL) @@ -311,9 +311,9 @@ patm_rx(struct patm_softc *sc, struct idt_rsqe *rsqe) } #endif - sc->ifatm.ifnet.if_ipackets++; + sc->ifp->if_ipackets++; /* this is in if_atmsubr.c */ - /* sc->ifatm.ifnet.if_ibytes += m->m_pkthdr.len; */ + /* sc->ifp->if_ibytes += m->m_pkthdr.len; */ vcc->ibytes += m->m_pkthdr.len; vcc->ipackets++; @@ -326,10 +326,10 @@ patm_rx(struct patm_softc *sc, struct idt_rsqe *rsqe) if (!(vcc->vcc.flags & ATMIO_FLAG_NG) && (vcc->vcc.aal == ATMIO_AAL_5) && (vcc->vcc.flags & ATM_PH_LLCSNAP)) - BPF_MTAP(&sc->ifatm.ifnet, m); + BPF_MTAP(sc->ifp, m); #endif - atm_input(&sc->ifatm.ifnet, &aph, m, vcc->rxhand); + atm_input(sc->ifp, &aph, m, vcc->rxhand); } /* @@ -463,7 +463,7 @@ patm_rx_raw(struct patm_softc *sc, u_char *cell) sc->stats.raw_no_buf++; return; } - m->m_pkthdr.rcvif = &sc->ifatm.ifnet; + m->m_pkthdr.rcvif = sc->ifp; switch (vcc->vflags & PATM_RAW_FORMAT) { @@ -510,9 +510,9 @@ patm_rx_raw(struct patm_softc *sc, u_char *cell) break; } - sc->ifatm.ifnet.if_ipackets++; + sc->ifp->if_ipackets++; /* this is in if_atmsubr.c */ - /* sc->ifatm.ifnet.if_ibytes += m->m_pkthdr.len; */ + /* sc->ifp->if_ibytes += m->m_pkthdr.len; */ vcc->ibytes += m->m_pkthdr.len; vcc->ipackets++; @@ -521,5 +521,5 @@ patm_rx_raw(struct patm_softc *sc, u_char *cell) ATM_PH_VPI(&aph) = vcc->vcc.vpi; ATM_PH_SETVCI(&aph, vcc->vcc.vci); - atm_input(&sc->ifatm.ifnet, &aph, m, vcc->rxhand); + atm_input(sc->ifp, &aph, m, vcc->rxhand); } |