From f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4 Mon Sep 17 00:00:00 2001 From: ru Date: Fri, 11 Nov 2005 16:04:59 +0000 Subject: - Store pointer to the link-level address right in "struct ifnet" rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead. --- sys/dev/de/if_de.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sys/dev/de') diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 46ec2da..7f1752c 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -260,8 +260,8 @@ tulip_txprobe(tulip_softc_t * const sc) /* * Construct a LLC TEST message which will point to ourselves. */ - bcopy(IFP2ENADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_dhost, 6); - bcopy(IFP2ENADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_shost, 6); + bcopy(IF_LLADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_dhost, 6); + bcopy(IF_LLADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_shost, 6); mtod(m, struct ether_header *)->ether_type = htons(3); mtod(m, unsigned char *)[14] = 0; mtod(m, unsigned char *)[15] = 0; @@ -3081,12 +3081,12 @@ tulip_addr_filter(tulip_softc_t * const sc) hash = tulip_mchash(ifp->if_broadcastaddr); sp[hash >> 4] |= htole32(1 << (hash & 0xF)); if (sc->tulip_flags & TULIP_WANTHASHONLY) { - hash = tulip_mchash(IFP2ENADDR(ifp)); + hash = tulip_mchash(IF_LLADDR(ifp)); sp[hash >> 4] |= htole32(1 << (hash & 0xF)); } else { - sp[39] = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[0]); - sp[40] = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[1]); - sp[41] = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[2]); + sp[39] = TULIP_SP_MAC(((u_int16_t *)IF_LLADDR(ifp))[0]); + sp[40] = TULIP_SP_MAC(((u_int16_t *)IF_LLADDR(ifp))[1]); + sp[41] = TULIP_SP_MAC(((u_int16_t *)IF_LLADDR(ifp))[2]); } } } @@ -3118,9 +3118,9 @@ tulip_addr_filter(tulip_softc_t * const sc) * Pad the rest with our hardware address */ for (; idx < 16; idx++) { - *sp++ = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[0]); - *sp++ = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[1]); - *sp++ = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[2]); + *sp++ = TULIP_SP_MAC(((u_int16_t *)IF_LLADDR(ifp))[0]); + *sp++ = TULIP_SP_MAC(((u_int16_t *)IF_LLADDR(ifp))[1]); + *sp++ = TULIP_SP_MAC(((u_int16_t *)IF_LLADDR(ifp))[2]); } } IF_ADDR_UNLOCK(ifp); -- cgit v1.1