Deleted Added
full compact
217,219d216
< /* For BPF. */
< caddr_t bpf; /* BPF "magic cookie" */
<
239,247c236
< /*
< * Some entry functions receive a "struct ifnet *" typed pointer as an
< * argument. It points to arpcom.ac_if of our softc. Remember arpcom.ac_if
< * is located at very first of the fe_softc struct. So, there is no
< * difference between "struct fe_softc *" and "struct ifnet *" at the machine
< * language level. We just cast to turn a "struct ifnet *" value into "struct
< * fe_softc * value". If this were C++, we would need no such cast at all.
< */
< #define IFNET2SOFTC(P) ( ( struct fe_softc * )(P) )
---
> #define IFNET2SOFTC(P) (P)->if_softc
274d262
< static void fe_setlinkaddr ( struct fe_softc * );
1063a1052
> sc->sc_if.if_softc = sc;
1125c1114
< fe_setlinkaddr( sc );
---
> ether_ifattach(&sc->sc_if);
1165,1166c1154
< bpfattach(&sc->bpf, &sc->sc_if, DLT_EN10MB,
< sizeof(struct ether_header));
---
> bpfattach(&sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
2102a2091
> #ifdef notdef
2117a2107
> #endif /* notdef */
2281,2282c2271,2272
< if ( sc->bpf ) {
< bpf_mtap( sc->bpf, m );
---
> if ( sc->sc_if.if_bpf ) {
> bpf_mtap( &sc->sc_if, m );
2683,2723d2672
< /*
< * Copy the physical (Ethernet) address into the "data link" address
< * entry of the address list for an interface.
< * This is (said to be) useful for netstat(1) to keep track of which
< * interface is which.
< *
< * What I'm not sure on this function is, why this is a driver's function.
< * Probably this should be moved to somewhere independent to a specific
< * hardware, such as if_ehtersubr.c. FIXME.
< */
< static void
< fe_setlinkaddr ( struct fe_softc * sc )
< {
< struct ifaddr *ifa;
< struct sockaddr_dl * sdl;
<
< /*
< * Search down the ifa address list looking for the AF_LINK type entry.
< */
< for ( ifa = sc->sc_if.if_addrlist; ifa != NULL; ifa = ifa->ifa_next ) {
< if ( ifa->ifa_addr != NULL
< && ifa->ifa_addr->sa_family == AF_LINK ) {
<
< /*
< * We have found an AF_LINK type entry.
< * Fill in the link-level address for this interface
< */
< sdl = (struct sockaddr_dl *) ifa->ifa_addr;
< sdl->sdl_type = IFT_ETHER;
< sdl->sdl_alen = ETHER_ADDR_LEN;
< sdl->sdl_slen = 0;
< bcopy(sc->sc_enaddr, LLADDR(sdl), ETHER_ADDR_LEN);
< #if FE_DEBUG >= 3
< log( LOG_INFO, "fe%d: link address set\n",
< sc->sc_unit );
< #endif
< return;
< }
< }
< }
<