summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/compat/ndis/subr_ndis.c8
-rw-r--r--sys/contrib/dev/oltr/if_oltr.c4
-rw-r--r--sys/dev/an/if_an.c5
-rw-r--r--sys/dev/arl/if_arl.c4
-rw-r--r--sys/dev/ath/if_ath.c2
-rw-r--r--sys/dev/bfe/if_bfe.c2
-rw-r--r--sys/dev/bge/if_bge.c8
-rw-r--r--sys/dev/dc/if_dc.c20
-rw-r--r--sys/dev/de/if_de.c18
-rw-r--r--sys/dev/ed/if_ed.c2
-rw-r--r--sys/dev/em/if_em.c2
-rw-r--r--sys/dev/ep/if_ep.c4
-rw-r--r--sys/dev/ex/if_ex.c4
-rw-r--r--sys/dev/fe/if_fe.c2
-rw-r--r--sys/dev/fxp/if_fxp.c2
-rw-r--r--sys/dev/gem/if_gem.c2
-rw-r--r--sys/dev/hme/if_hme.c2
-rw-r--r--sys/dev/ie/if_ie.c4
-rw-r--r--sys/dev/ixgb/if_ixgb.c2
-rw-r--r--sys/dev/lge/if_lge.c4
-rw-r--r--sys/dev/lnc/if_lnc.c4
-rw-r--r--sys/dev/lnc/if_lnc_cbus.c8
-rw-r--r--sys/dev/my/if_my.c2
-rw-r--r--sys/dev/nge/if_nge.c6
-rw-r--r--sys/dev/nve/if_nve.c2
-rw-r--r--sys/dev/owi/if_owi.c6
-rw-r--r--sys/dev/ray/if_ray.c2
-rw-r--r--sys/dev/re/if_re.c4
-rw-r--r--sys/dev/sbni/if_sbni.c6
-rw-r--r--sys/dev/sf/if_sf.c6
-rw-r--r--sys/dev/sk/if_sk.c10
-rw-r--r--sys/dev/snc/dp83932.c2
-rw-r--r--sys/dev/ti/if_ti.c2
-rw-r--r--sys/dev/tx/if_tx.c6
-rw-r--r--sys/dev/txp/if_txp.c12
-rw-r--r--sys/dev/usb/if_aue.c2
-rw-r--r--sys/dev/usb/if_axe.c2
-rw-r--r--sys/dev/usb/if_cue.c2
-rw-r--r--sys/dev/usb/if_kue.c2
-rw-r--r--sys/dev/usb/if_rue.c2
-rw-r--r--sys/dev/usb/if_udav.c2
-rw-r--r--sys/dev/vge/if_vge.c2
-rw-r--r--sys/dev/vr/if_vr.c2
-rw-r--r--sys/dev/vx/if_vx.c6
-rw-r--r--sys/dev/wi/if_wi.c6
-rw-r--r--sys/dev/wl/if_wl.c4
-rw-r--r--sys/dev/xe/if_xe.c4
-rw-r--r--sys/net/if.c12
-rw-r--r--sys/net/if_arcsubr.c2
-rw-r--r--sys/net/if_arp.h2
-rw-r--r--sys/net/if_bridge.c2
-rw-r--r--sys/net/if_ef.c6
-rw-r--r--sys/net/if_ethersubr.c15
-rw-r--r--sys/net/if_fddisubr.c18
-rw-r--r--sys/net/if_fwsubr.c2
-rw-r--r--sys/net/if_iso88025subr.c20
-rw-r--r--sys/net/if_tap.c4
-rw-r--r--sys/net/if_var.h9
-rw-r--r--sys/net/if_vlan.c2
-rw-r--r--sys/net/route.c2
-rw-r--r--sys/net/rtsock.c15
-rw-r--r--sys/net80211/ieee80211_ioctl.c6
-rw-r--r--sys/netatalk/aarp.c9
-rw-r--r--sys/netatm/atm_if.c2
-rw-r--r--sys/netgraph/ng_ether.c4
-rw-r--r--sys/netgraph/ng_fec.c10
-rw-r--r--sys/netinet/ip_carp.c26
-rw-r--r--sys/netinet/ip_input.c3
-rw-r--r--sys/pci/if_de.c18
-rw-r--r--sys/pci/if_pcn.c6
-rw-r--r--sys/pci/if_rl.c4
-rw-r--r--sys/pci/if_sf.c6
-rw-r--r--sys/pci/if_sis.c12
-rw-r--r--sys/pci/if_sk.c10
-rw-r--r--sys/pci/if_ste.c2
-rw-r--r--sys/pci/if_ti.c2
-rw-r--r--sys/pci/if_tl.c4
-rw-r--r--sys/pci/if_vr.c2
-rw-r--r--sys/pci/if_wb.c2
-rw-r--r--sys/pci/if_xl.c6
-rw-r--r--sys/sys/param.h2
81 files changed, 220 insertions, 242 deletions
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c
index f2e1dc3..c151252 100644
--- a/sys/compat/ndis/subr_ndis.c
+++ b/sys/compat/ndis/subr_ndis.c
@@ -1407,15 +1407,15 @@ NdisReadNetworkAddress(status, addr, addrlen, adapter)
block = (ndis_miniport_block *)adapter;
sc = device_get_softc(block->nmb_physdeviceobj->do_devext);
-#ifdef IFP2ENADDR
- if (bcmp(IFP2ENADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0)
+#ifdef IF_LLADDR
+ if (bcmp(IF_LLADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0)
#else
if (bcmp(sc->arpcom.ac_enaddr, empty, ETHER_ADDR_LEN) == 0)
#endif
*status = NDIS_STATUS_FAILURE;
else {
-#ifdef IFP2ENADDR
- *addr = IFP2ENADDR(sc->ifp);
+#ifdef IF_LLADDR
+ *addr = IF_LLADDR(sc->ifp);
#else
*addr = sc->arpcom.ac_enaddr;
#endif
diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c
index b68c355..a5a72a0 100644
--- a/sys/contrib/dev/oltr/if_oltr.c
+++ b/sys/contrib/dev/oltr/if_oltr.c
@@ -41,7 +41,7 @@
#include <sys/socket.h>
#include <net/if.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/iso88025.h>
#include <net/if_media.h>
#include <net/if_types.h>
@@ -489,7 +489,7 @@ oltr_init(void * xsc)
/*
* Open the adapter
*/
- rc = TRlldOpen(sc->TRlldAdapter, IFP2ENADDR(sc->ifp), sc->GroupAddress,
+ rc = TRlldOpen(sc->TRlldAdapter, IF_LLADDR(sc->ifp), sc->GroupAddress,
sc->FunctionalAddress, 1552, sc->AdapterMode);
switch(rc) {
case TRLLD_OPEN_OK:
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index 18b75c3..cb22492 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -112,6 +112,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/ethernet.h>
#include <net/if_types.h>
#include <net/if_media.h>
@@ -1737,7 +1738,7 @@ an_setdef(struct an_softc *sc, struct an_req *areq)
case AN_RID_GENCONFIG:
cfg = (struct an_ltv_genconfig *)areq;
- bcopy((char *)&cfg->an_macaddr, IFP2ENADDR(sc->an_ifp),
+ bcopy((char *)&cfg->an_macaddr, IF_LLADDR(sc->an_ifp),
ETHER_ADDR_LEN);
bcopy((char *)cfg, (char *)&sc->an_config,
@@ -2494,7 +2495,7 @@ an_init(void *xsc)
}
/* Set our MAC address. */
- bcopy((char *)IFP2ENADDR(sc->an_ifp),
+ bcopy((char *)IF_LLADDR(sc->an_ifp),
(char *)&sc->an_config.an_macaddr, ETHER_ADDR_LEN);
if (ifp->if_flags & IFF_BROADCAST)
diff --git a/sys/dev/arl/if_arl.c b/sys/dev/arl/if_arl.c
index 60cb73b..8d038d6 100644
--- a/sys/dev/arl/if_arl.c
+++ b/sys/dev/arl/if_arl.c
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <net/if.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/ethernet.h>
@@ -989,7 +989,7 @@ arl_read(sc, buf, len)
* This test does not support multicasts.
*/
if ((ifp->if_flags & IFF_PROMISC)
- && bcmp(eh->ether_dhost, IFP2ENADDR(sc->arl_ifp),
+ && bcmp(eh->ether_dhost, IF_LLADDR(sc->arl_ifp),
sizeof(eh->ether_dhost)) != 0
&& bcmp(eh->ether_dhost, BROADCASTADDR,
sizeof(eh->ether_dhost)) != 0)
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index db36f00..0b54516 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1646,7 +1646,7 @@ ath_mode_init(struct ath_softc *sc)
*
* XXX should get from lladdr instead of arpcom but that's more work
*/
- IEEE80211_ADDR_COPY(ic->ic_myaddr, IFP2ENADDR(ifp));
+ IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp));
ath_hal_setmac(ah, ic->ic_myaddr);
/* calculate and install multicast filter */
diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c
index 8612a88..2a5cc73 100644
--- a/sys/dev/bfe/if_bfe.c
+++ b/sys/dev/bfe/if_bfe.c
@@ -873,7 +873,7 @@ bfe_set_rx_mode(struct bfe_softc *sc)
CSR_WRITE_4(sc, BFE_CAM_CTRL, 0);
- bfe_cam_write(sc, IFP2ENADDR(sc->bfe_ifp), i++);
+ bfe_cam_write(sc, IF_LLADDR(sc->bfe_ifp), i++);
if (ifp->if_flags & IFF_ALLMULTI)
val |= BFE_RXCONF_ALLMULTI;
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 9230a67..fd7908a 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -1562,9 +1562,9 @@ bge_blockinit(sc)
/* Set random backoff seed for TX */
CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF,
- IFP2ENADDR(sc->bge_ifp)[0] + IFP2ENADDR(sc->bge_ifp)[1] +
- IFP2ENADDR(sc->bge_ifp)[2] + IFP2ENADDR(sc->bge_ifp)[3] +
- IFP2ENADDR(sc->bge_ifp)[4] + IFP2ENADDR(sc->bge_ifp)[5] +
+ IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] +
+ IF_LLADDR(sc->bge_ifp)[2] + IF_LLADDR(sc->bge_ifp)[3] +
+ IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5] +
BGE_TX_BACKOFF_SEED_MASK);
/* Set inter-packet gap */
@@ -3430,7 +3430,7 @@ bge_init_locked(sc)
ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN);
/* Load our MAC address. */
- m = (u_int16_t *)&IFP2ENADDR(sc->bge_ifp)[0];
+ m = (u_int16_t *)IF_LLADDR(sc->bge_ifp);
CSR_WRITE_4(sc, BGE_MAC_ADDR1_LO, htons(m[0]));
CSR_WRITE_4(sc, BGE_MAC_ADDR1_HI, (htons(m[1]) << 16) | htons(m[2]));
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index 8742fa4..7dbb539 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -1126,9 +1126,9 @@ dc_setfilt_21143(struct dc_softc *sc)
}
/* Set our MAC address */
- sp[39] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[0]);
- sp[40] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[1]);
- sp[41] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[2]);
+ sp[39] = DC_SP_MAC(((u_int16_t *)IF_LLADDR(sc->dc_ifp))[0]);
+ sp[40] = DC_SP_MAC(((u_int16_t *)IF_LLADDR(sc->dc_ifp))[1]);
+ sp[41] = DC_SP_MAC(((u_int16_t *)IF_LLADDR(sc->dc_ifp))[2]);
sframe->dc_status = htole32(DC_TXSTAT_OWN);
CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
@@ -1155,8 +1155,8 @@ dc_setfilt_admtek(struct dc_softc *sc)
ifp = sc->dc_ifp;
/* Init our MAC address. */
- CSR_WRITE_4(sc, DC_AL_PAR0, *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[0]));
- CSR_WRITE_4(sc, DC_AL_PAR1, *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[4]));
+ CSR_WRITE_4(sc, DC_AL_PAR0, *(u_int32_t *)(&IF_LLADDR(sc->dc_ifp)[0]));
+ CSR_WRITE_4(sc, DC_AL_PAR1, *(u_int32_t *)(&IF_LLADDR(sc->dc_ifp)[4]));
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
@@ -1215,10 +1215,10 @@ dc_setfilt_asix(struct dc_softc *sc)
/* Init our MAC address */
CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR0);
CSR_WRITE_4(sc, DC_AX_FILTDATA,
- *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[0]));
+ *(u_int32_t *)(&IF_LLADDR(sc->dc_ifp)[0]));
CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR1);
CSR_WRITE_4(sc, DC_AX_FILTDATA,
- *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[4]));
+ *(u_int32_t *)(&IF_LLADDR(sc->dc_ifp)[4]));
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
@@ -1324,9 +1324,9 @@ dc_setfilt_xircom(struct dc_softc *sc)
}
/* Set our MAC address */
- sp[0] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[0]);
- sp[1] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[1]);
- sp[2] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[2]);
+ sp[0] = DC_SP_MAC(((u_int16_t *)IF_LLADDR(sc->dc_ifp))[0]);
+ sp[1] = DC_SP_MAC(((u_int16_t *)IF_LLADDR(sc->dc_ifp))[1]);
+ sp[2] = DC_SP_MAC(((u_int16_t *)IF_LLADDR(sc->dc_ifp))[2]);
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON);
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);
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 7b67939..39f0c3e 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -551,7 +551,7 @@ ed_init_locked(struct ed_softc *sc)
* Copy out our station address
*/
for (i = 0; i < ETHER_ADDR_LEN; ++i)
- ed_nic_outb(sc, ED_P1_PAR(i), IFP2ENADDR(sc->ifp)[i]);
+ ed_nic_outb(sc, ED_P1_PAR(i), IF_LLADDR(sc->ifp)[i]);
/*
* Set Current Page pointer to next_packet (initialized above)
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c
index a995213..41f2d9f 100644
--- a/sys/dev/em/if_em.c
+++ b/sys/dev/em/if_em.c
@@ -863,7 +863,7 @@ em_init_locked(struct adapter * adapter)
E1000_WRITE_REG(&adapter->hw, PBA, pba);
/* Get the latest mac address, User can use a LAA */
- bcopy(IFP2ENADDR(adapter->ifp), adapter->hw.mac_addr,
+ bcopy(IF_LLADDR(adapter->ifp), adapter->hw.mac_addr,
ETHER_ADDR_LEN);
/* Initialize the hardware */
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 0c6f65c..2fc25a5 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <net/if.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/ethernet.h>
@@ -406,7 +406,7 @@ epinit_locked(struct ep_softc *sc)
GO_WINDOW(sc, 2);
/* Reload the ether_addr. */
- ep_setup_station(sc, IFP2ENADDR(sc->ifp));
+ ep_setup_station(sc, IF_LLADDR(sc->ifp));
CSR_WRITE_2(sc, EP_COMMAND, RX_RESET);
CSR_WRITE_2(sc, EP_COMMAND, TX_RESET);
diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c
index 24425b6..83b988d 100644
--- a/sys/dev/ex/if_ex.c
+++ b/sys/dev/ex/if_ex.c
@@ -308,7 +308,7 @@ ex_init(void *xsc)
CSR_WRITE_1(sc, EEPROM_REG, temp_reg & ~Trnoff_Enable);
}
for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, I_ADDR_REG0 + i, IFP2ENADDR(sc->ifp)[i]);
+ CSR_WRITE_1(sc, I_ADDR_REG0 + i, IF_LLADDR(sc->ifp)[i]);
}
/*
* - Setup transmit chaining and discard bad received frames.
@@ -892,7 +892,7 @@ ex_setmulti(struct ex_softc *sc)
/* Program our MAC address as well */
/* XXX: Is this necessary? The Linux driver does this
* but the NetBSD driver does not */
- addr = (uint16_t*)(IFP2ENADDR(sc->ifp));
+ addr = (uint16_t*)IF_LLADDR(sc->ifp);
CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c
index 610e955..a22eb08 100644
--- a/sys/dev/fe/if_fe.c
+++ b/sys/dev/fe/if_fe.c
@@ -1043,7 +1043,7 @@ fe_init (void * xsc)
DELAY(200);
/* Feed the station address. */
- fe_outblk(sc, FE_DLCR8, IFP2ENADDR(sc->ifp), ETHER_ADDR_LEN);
+ fe_outblk(sc, FE_DLCR8, IF_LLADDR(sc->ifp), ETHER_ADDR_LEN);
/* Clear multicast address filter to receive nothing. */
fe_outb(sc, FE_DLCR7,
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 428fd53..1e734cd 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -2087,7 +2087,7 @@ fxp_init_body(struct fxp_softc *sc)
cb_ias->cb_status = 0;
cb_ias->cb_command = htole16(FXP_CB_COMMAND_IAS | FXP_CB_COMMAND_EL);
cb_ias->link_addr = 0xffffffff;
- bcopy(IFP2ENADDR(sc->ifp), cb_ias->macaddr, ETHER_ADDR_LEN);
+ bcopy(IF_LLADDR(sc->ifp), cb_ias->macaddr, ETHER_ADDR_LEN);
/*
* Start the IAS (Individual Address Setup) command/DMA.
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c
index 84033e3..5f9bae4 100644
--- a/sys/dev/gem/if_gem.c
+++ b/sys/dev/gem/if_gem.c
@@ -1046,7 +1046,7 @@ gem_init_regs(sc)
{
bus_space_tag_t t = sc->sc_bustag;
bus_space_handle_t h = sc->sc_h;
- const u_char *laddr = IFP2ENADDR(sc->sc_ifp);
+ const u_char *laddr = IF_LLADDR(sc->sc_ifp);
u_int32_t v;
/* These regs are not cleared on reset */
diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c
index 03ad83c..6af4257 100644
--- a/sys/dev/hme/if_hme.c
+++ b/sys/dev/hme/if_hme.c
@@ -729,7 +729,7 @@ hme_init_locked(struct hme_softc *sc)
HME_MAC_WRITE_4(sc, HME_MACI_TXSIZE, HME_MAX_FRAMESIZE);
/* Load station MAC address */
- ea = IFP2ENADDR(sc->sc_ifp);
+ ea = IF_LLADDR(sc->sc_ifp);
HME_MAC_WRITE_4(sc, HME_MACI_MACADDR0, (ea[0] << 8) | ea[1]);
HME_MAC_WRITE_4(sc, HME_MACI_MACADDR1, (ea[2] << 8) | ea[3]);
HME_MAC_WRITE_4(sc, HME_MACI_MACADDR2, (ea[4] << 8) | ea[5]);
diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c
index c3dcdee..bc57da3 100644
--- a/sys/dev/ie/if_ie.c
+++ b/sys/dev/ie/if_ie.c
@@ -599,7 +599,7 @@ check_eh(struct ie_softc *sc, struct ether_header *eh)
return (1);
/* Always accept packets directed at us */
- if (ether_equal(eh->ether_dhost, IFP2ENADDR(sc->ifp)))
+ if (ether_equal(eh->ether_dhost, IF_LLADDR(sc->ifp)))
return (1);
/* Must have IFF_ALLMULTI but not IFF_PROMISC set. The chip is
@@ -1530,7 +1530,7 @@ ieinit(xsc)
cmd->com.ie_cmd_cmd = IE_CMD_IASETUP | IE_CMD_LAST;
cmd->com.ie_cmd_link = 0xffff;
- bcopy((volatile char *)IFP2ENADDR(sc->ifp),
+ bcopy((volatile char *)IF_LLADDR(sc->ifp),
(volatile char *)&cmd->ie_address, sizeof cmd->ie_address);
scb->ie_command_list = MK_16(MEM(sc), cmd);
if (command_and_wait(sc, IE_CU_START, cmd, IE_STAT_COMPL)
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c
index eb7d8be..710ebec 100644
--- a/sys/dev/ixgb/if_ixgb.c
+++ b/sys/dev/ixgb/if_ixgb.c
@@ -665,7 +665,7 @@ ixgb_init_locked(struct adapter *adapter)
ixgb_stop(adapter);
/* Get the latest mac address, User can use a LAA */
- bcopy(IFP2ENADDR(adapter->ifp), adapter->hw.curr_mac_addr,
+ bcopy(IF_LLADDR(adapter->ifp), adapter->hw.curr_mac_addr,
IXGB_ETH_LENGTH_OF_ADDRESS);
/* Initialize the hardware */
diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c
index f41c61f..3163715 100644
--- a/sys/dev/lge/if_lge.c
+++ b/sys/dev/lge/if_lge.c
@@ -1245,8 +1245,8 @@ lge_init(xsc)
mii = device_get_softc(sc->lge_miibus);
/* Set MAC address */
- CSR_WRITE_4(sc, LGE_PAR0, *(u_int32_t *)(&IFP2ENADDR(sc->lge_ifp)[0]));
- CSR_WRITE_4(sc, LGE_PAR1, *(u_int32_t *)(&IFP2ENADDR(sc->lge_ifp)[4]));
+ CSR_WRITE_4(sc, LGE_PAR0, *(u_int32_t *)(&IF_LLADDR(sc->lge_ifp)[0]));
+ CSR_WRITE_4(sc, LGE_PAR1, *(u_int32_t *)(&IF_LLADDR(sc->lge_ifp)[4]));
/* Init circular RX list. */
if (lge_list_rx_init(sc) == ENOBUFS) {
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c
index 1d26ad6..dba091a 100644
--- a/sys/dev/lnc/if_lnc.c
+++ b/sys/dev/lnc/if_lnc.c
@@ -583,7 +583,7 @@ lnc_rint(struct lnc_softc *sc)
* drop it if it is from myself.
*/
if (bcmp(eh->ether_shost,
- IFP2ENADDR(sc->ifp), ETHER_ADDR_LEN) == 0) {
+ IF_LLADDR(sc->ifp), ETHER_ADDR_LEN) == 0) {
m_freem(head);
} else {
(*ifp->if_input)(ifp, head);
@@ -1008,7 +1008,7 @@ lnc_init(xsc)
sc->init_block->mode = sc->nic.mode;
for (i = 0; i < ETHER_ADDR_LEN; i++)
- sc->init_block->padr[i] = IFP2ENADDR(sc->ifp)[i];
+ sc->init_block->padr[i] = IF_LLADDR(sc->ifp)[i];
lnc_setladrf(sc);
diff --git a/sys/dev/lnc/if_lnc_cbus.c b/sys/dev/lnc/if_lnc_cbus.c
index 7132aff..1ce7f33 100644
--- a/sys/dev/lnc/if_lnc_cbus.c
+++ b/sys/dev/lnc/if_lnc_cbus.c
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
#include <net/ethernet.h>
#include <net/if.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <isa/isavar.h>
@@ -261,9 +261,9 @@ lnc_isa_attach(device_t dev)
*
* Contec uses 00 80 4c ?? ?? ??
*/
- if (IFP2ENADDR(sc->ifp)[0] == (u_char)0x00 &&
- IFP2ENADDR(sc->ifp)[1] == (u_char)0x80 &&
- IFP2ENADDR(sc->ifp)[2] == (u_char)0x4c) {
+ if (IF_LLADDR(sc->ifp)[0] == (u_char)0x00 &&
+ IF_LLADDR(sc->ifp)[1] == (u_char)0x80 &&
+ IF_LLADDR(sc->ifp)[2] == (u_char)0x4c) {
lnc_outw(sc->rap, MSRDA);
lnc_outw(CNET98S_IDP, 0x0006);
lnc_outw(sc->rap, MSWRA);
diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c
index bc5568e..ec51575 100644
--- a/sys/dev/my/if_my.c
+++ b/sys/dev/my/if_my.c
@@ -1154,7 +1154,7 @@ my_rxeof(struct my_softc * sc)
if (ifp->if_bpf) {
BPF_MTAP(ifp, m);
if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, IFP2ENADDR(sc->my_ifp),
+ (bcmp(eh->ether_dhost, IF_LLADDR(sc->my_ifp),
ETHER_ADDR_LEN) &&
(eh->ether_dhost[0] & 1) == 0)) {
m_freem(m);
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c
index af14a70..70d99bd 100644
--- a/sys/dev/nge/if_nge.c
+++ b/sys/dev/nge/if_nge.c
@@ -1668,13 +1668,13 @@ nge_init_locked(sc)
/* Set MAC address */
CSR_WRITE_4(sc, NGE_RXFILT_CTL, NGE_FILTADDR_PAR0);
CSR_WRITE_4(sc, NGE_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->nge_ifp))[0]);
+ ((u_int16_t *)IF_LLADDR(sc->nge_ifp))[0]);
CSR_WRITE_4(sc, NGE_RXFILT_CTL, NGE_FILTADDR_PAR1);
CSR_WRITE_4(sc, NGE_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->nge_ifp))[1]);
+ ((u_int16_t *)IF_LLADDR(sc->nge_ifp))[1]);
CSR_WRITE_4(sc, NGE_RXFILT_CTL, NGE_FILTADDR_PAR2);
CSR_WRITE_4(sc, NGE_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->nge_ifp))[2]);
+ ((u_int16_t *)IF_LLADDR(sc->nge_ifp))[2]);
/* Init circular RX list. */
if (nge_list_rx_init(sc) == ENOBUFS) {
diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c
index b36c3ad..c6f8a48 100644
--- a/sys/dev/nve/if_nve.c
+++ b/sys/dev/nve/if_nve.c
@@ -643,7 +643,7 @@ nve_init(void *xsc)
goto fail;
}
/* Set the MAC address */
- sc->hwapi->pfnSetNodeAddress(sc->hwapi->pADCX, IFP2ENADDR(sc->ifp));
+ sc->hwapi->pfnSetNodeAddress(sc->hwapi->pADCX, IF_LLADDR(sc->ifp));
sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX);
sc->hwapi->pfnStart(sc->hwapi->pADCX);
diff --git a/sys/dev/owi/if_owi.c b/sys/dev/owi/if_owi.c
index d788091..55f2685 100644
--- a/sys/dev/owi/if_owi.c
+++ b/sys/dev/owi/if_owi.c
@@ -1245,7 +1245,7 @@ wi_setdef(sc, wreq)
switch(wreq->wi_type) {
case WI_RID_MAC_NODE:
- bcopy((char *)&wreq->wi_val, (char *)IFP2ENADDR(sc->ifp),
+ bcopy(&wreq->wi_val, IF_LLADDR(sc->ifp),
ETHER_ADDR_LEN);
break;
case WI_RID_PORTTYPE:
@@ -1749,8 +1749,8 @@ wi_init(xsc)
/* Set our MAC address. */
mac.wi_len = 4;
mac.wi_type = WI_RID_MAC_NODE;
- bcopy((char *)IFP2ENADDR(sc->ifp),
- (char *)&mac.wi_mac_addr, ETHER_ADDR_LEN);
+ bcopy(IF_LLADDR(sc->ifp),
+ &mac.wi_mac_addr, ETHER_ADDR_LEN);
wi_write_record(sc, (struct wi_ltv_gen *)&mac);
/*
diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c
index 75cf052..7805792 100644
--- a/sys/dev/ray/if_ray.c
+++ b/sys/dev/ray/if_ray.c
@@ -1230,7 +1230,7 @@ ray_init_auth_send(struct ray_softc *sc, u_int8_t *dst, int sequence)
IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_AUTH,
IEEE80211_FC1_DIR_NODS,
dst,
- IFP2ENADDR(sc->ifp),
+ IF_LLADDR(sc->ifp),
sc->sc_c.np_bss_id);
/* Add algorithm number */
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 285ea61..7a3f060 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -2120,9 +2120,9 @@ re_init_locked(sc)
*/
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG);
CSR_WRITE_STREAM_4(sc, RL_IDR0,
- *(u_int32_t *)(&IFP2ENADDR(sc->rl_ifp)[0]));
+ *(u_int32_t *)(&IF_LLADDR(sc->rl_ifp)[0]));
CSR_WRITE_STREAM_4(sc, RL_IDR4,
- *(u_int32_t *)(&IFP2ENADDR(sc->rl_ifp)[4]));
+ *(u_int32_t *)(&IF_LLADDR(sc->rl_ifp)[4]));
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
/*
diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c
index 580d37a..282a5ea 100644
--- a/sys/dev/sbni/if_sbni.c
+++ b/sys/dev/sbni/if_sbni.c
@@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$");
#include <machine/resource.h>
#include <net/if.h>
+#include <net/if_dl.h>
#include <net/ethernet.h>
-#include <net/if_arp.h>
#include <net/bpf.h>
#include <net/if_types.h>
@@ -1094,7 +1094,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
* SBNI specific ioctl
*/
case SIOCGHWFLAGS: /* get flags */
- bcopy((caddr_t)IFP2ENADDR(sc->ifp)+3, (caddr_t) &flags, 3);
+ bcopy((caddr_t)IF_LLADDR(sc->ifp)+3, (caddr_t) &flags, 3);
flags.rxl = sc->cur_rxl_index;
flags.rate = sc->csr1.rate;
flags.fixed_rxl = (sc->delta_rxl == 0);
@@ -1125,7 +1125,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
sc->csr1.rate = flags.fixed_rate ? flags.rate : DEFAULT_RATE;
if (flags.mac_addr)
bcopy((caddr_t) &flags,
- (caddr_t) IFP2ENADDR(sc->ifp)+3, 3);
+ (caddr_t) IF_LLADDR(sc->ifp)+3, 3);
/* Don't be afraid... */
sbni_outb(sc, CSR1, *(char*)(&sc->csr1) | PR_RES);
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c
index 4564afe..a4703ed 100644
--- a/sys/dev/sf/if_sf.c
+++ b/sys/dev/sf/if_sf.c
@@ -1239,9 +1239,9 @@ sf_init_locked(sc)
(i + sizeof(u_int32_t)), 0);
/* Init our MAC address */
- csr_write_4(sc, SF_PAR0, *(u_int32_t *)(&IFP2ENADDR(sc->sf_ifp)[0]));
- csr_write_4(sc, SF_PAR1, *(u_int32_t *)(&IFP2ENADDR(sc->sf_ifp)[4]));
- sf_setperf(sc, 0, (caddr_t)&IFP2ENADDR(sc->sf_ifp));
+ csr_write_4(sc, SF_PAR0, *(u_int32_t *)(&IF_LLADDR(sc->sf_ifp)[0]));
+ csr_write_4(sc, SF_PAR1, *(u_int32_t *)(&IF_LLADDR(sc->sf_ifp)[4]));
+ sf_setperf(sc, 0, IF_LLADDR(sc->sf_ifp));
if (sf_init_rx_ring(sc) == ENOBUFS) {
if_printf(sc->sf_ifp,
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index cc53083..7c46d3e 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -2580,11 +2580,11 @@ sk_init_xmac(sc_if)
/* Set station address */
SK_XM_WRITE_2(sc_if, XM_PAR0,
- *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[0]));
+ *(u_int16_t *)(&IF_LLADDR(sc_if->sk_ifp)[0]));
SK_XM_WRITE_2(sc_if, XM_PAR1,
- *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[2]));
+ *(u_int16_t *)(&IF_LLADDR(sc_if->sk_ifp)[2]));
SK_XM_WRITE_2(sc_if, XM_PAR2,
- *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[4]));
+ *(u_int16_t *)(&IF_LLADDR(sc_if->sk_ifp)[4]));
SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_USE_STATION);
if (ifp->if_flags & IFF_BROADCAST) {
@@ -2755,8 +2755,8 @@ sk_init_yukon(sc_if)
for (i = 0; i < 3; i++) {
/* Write Source Address 1 (unicast filter) */
SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4,
- IFP2ENADDR(sc_if->sk_ifp)[i * 2] |
- IFP2ENADDR(sc_if->sk_ifp)[i * 2 + 1] << 8);
+ IF_LLADDR(sc_if->sk_ifp)[i * 2] |
+ IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8);
}
for (i = 0; i < 3; i++) {
diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c
index bbc1e97..ce7c920 100644
--- a/sys/dev/snc/dp83932.c
+++ b/sys/dev/snc/dp83932.c
@@ -670,7 +670,7 @@ camprogram(sc)
ifp = sc->sc_ifp;
/* Always load our own address first. */
- camentry (sc, mcount, IFP2ENADDR(sc->sc_ifp));
+ camentry (sc, mcount, IF_LLADDR(sc->sc_ifp));
mcount++;
/* Assume we won't need allmulti bit. */
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index d4fd437..c7ae13d 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.c
@@ -2862,7 +2862,7 @@ static void ti_init2(sc)
TI_DO_CMD(TI_CMD_UPDATE_GENCOM, 0, 0);
/* Load our MAC address. */
- m = (u_int16_t *)&IFP2ENADDR(sc->ti_ifp)[0];
+ m = (u_int16_t *)IF_LLADDR(sc->ti_ifp);
CSR_WRITE_4(sc, TI_GCR_PAR0, htons(m[0]));
CSR_WRITE_4(sc, TI_GCR_PAR1, (htons(m[1]) << 16) | htons(m[2]));
TI_DO_CMD(TI_CMD_SET_MAC_ADDR, 0, 0);
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c
index ce2da96..9b23899 100644
--- a/sys/dev/tx/if_tx.c
+++ b/sys/dev/tx/if_tx.c
@@ -1293,9 +1293,9 @@ epic_init(xsc)
CSR_WRITE_4(sc, PTCDAR, sc->tx_addr);
/* Put node address to EPIC. */
- CSR_WRITE_4(sc, LAN0, ((u_int16_t *)IFP2ENADDR(sc->ifp))[0]);
- CSR_WRITE_4(sc, LAN1, ((u_int16_t *)IFP2ENADDR(sc->ifp))[1]);
- CSR_WRITE_4(sc, LAN2, ((u_int16_t *)IFP2ENADDR(sc->ifp))[2]);
+ CSR_WRITE_4(sc, LAN0, ((u_int16_t *)IF_LLADDR(sc->ifp))[0]);
+ CSR_WRITE_4(sc, LAN1, ((u_int16_t *)IF_LLADDR(sc->ifp))[1]);
+ CSR_WRITE_4(sc, LAN2, ((u_int16_t *)IF_LLADDR(sc->ifp))[2]);
/* Set tx mode, includeing transmit threshold. */
epic_set_tx_mode(sc);
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c
index 4ddaa06..6f3429e 100644
--- a/sys/dev/txp/if_txp.c
+++ b/sys/dev/txp/if_txp.c
@@ -1179,12 +1179,12 @@ txp_init_locked(sc)
NULL, NULL, NULL, 1);
/* Set station address. */
- ((u_int8_t *)&p1)[1] = IFP2ENADDR(sc->sc_ifp)[0];
- ((u_int8_t *)&p1)[0] = IFP2ENADDR(sc->sc_ifp)[1];
- ((u_int8_t *)&p2)[3] = IFP2ENADDR(sc->sc_ifp)[2];
- ((u_int8_t *)&p2)[2] = IFP2ENADDR(sc->sc_ifp)[3];
- ((u_int8_t *)&p2)[1] = IFP2ENADDR(sc->sc_ifp)[4];
- ((u_int8_t *)&p2)[0] = IFP2ENADDR(sc->sc_ifp)[5];
+ ((u_int8_t *)&p1)[1] = IF_LLADDR(sc->sc_ifp)[0];
+ ((u_int8_t *)&p1)[0] = IF_LLADDR(sc->sc_ifp)[1];
+ ((u_int8_t *)&p2)[3] = IF_LLADDR(sc->sc_ifp)[2];
+ ((u_int8_t *)&p2)[2] = IF_LLADDR(sc->sc_ifp)[3];
+ ((u_int8_t *)&p2)[1] = IF_LLADDR(sc->sc_ifp)[4];
+ ((u_int8_t *)&p2)[0] = IF_LLADDR(sc->sc_ifp)[5];
txp_command(sc, TXP_CMD_STATION_ADDRESS_WRITE, p1, p2, 0,
NULL, NULL, NULL, 1);
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 69bef1c..bb53441 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1159,7 +1159,7 @@ aue_init(void *xsc)
/* Set MAC address */
for (i = 0; i < ETHER_ADDR_LEN; i++)
- aue_csr_write_1(sc, AUE_PAR0 + i, IFP2ENADDR(sc->aue_ifp)[i]);
+ aue_csr_write_1(sc, AUE_PAR0 + i, IF_LLADDR(sc->aue_ifp)[i]);
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index 33a009d..e48e674 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -854,7 +854,7 @@ axe_init(void *xsc)
#ifdef notdef
/* Set MAC address */
- axe_mac(sc, IFP2ENADDR(sc->axe_ifp), 1);
+ axe_mac(sc, IF_LLADDR(sc->axe_ifp), 1);
#endif
/* Enable RX logic. */
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index 0d6ce71..5acafa2 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -860,7 +860,7 @@ cue_init(void *xsc)
/* Set MAC address */
for (i = 0; i < ETHER_ADDR_LEN; i++)
- cue_csr_write_1(sc, CUE_PAR0 - i, IFP2ENADDR(sc->cue_ifp)[i]);
+ cue_csr_write_1(sc, CUE_PAR0 - i, IF_LLADDR(sc->cue_ifp)[i]);
/* Enable RX logic. */
cue_csr_write_1(sc, CUE_ETHCTL, CUE_ETHCTL_RX_ON|CUE_ETHCTL_MCAST_ON);
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 7c5a700..a7cace7 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -809,7 +809,7 @@ kue_init(void *xsc)
/* Set MAC address */
kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SET_MAC,
- 0, IFP2ENADDR(sc->kue_ifp), ETHER_ADDR_LEN);
+ 0, IF_LLADDR(sc->kue_ifp), ETHER_ADDR_LEN);
sc->kue_rxfilt = KUE_RXFILT_UNICAST|KUE_RXFILT_BROADCAST;
diff --git a/sys/dev/usb/if_rue.c b/sys/dev/usb/if_rue.c
index 680d896..cc76a3a 100644
--- a/sys/dev/usb/if_rue.c
+++ b/sys/dev/usb/if_rue.c
@@ -1092,7 +1092,7 @@ rue_init(void *xsc)
rue_reset(sc);
/* Set MAC address */
- rue_write_mem(sc, RUE_IDR0, IFP2ENADDR(sc->rue_ifp),
+ rue_write_mem(sc, RUE_IDR0, IF_LLADDR(sc->rue_ifp),
ETHER_ADDR_LEN);
/* Init TX ring. */
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index a50dbec..880527e 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -852,7 +852,7 @@ udav_init(void *xsc)
#if defined(__NetBSD__)
eaddr = LLADDR(ifp->if_sadl);
#elif defined(__FreeBSD__)
- eaddr = IFP2ENADDR(ifp);
+ eaddr = IF_LLADDR(ifp);
#endif
udav_csr_write(sc, UDAV_PAR, eaddr, ETHER_ADDR_LEN);
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index f9b7abd..915deb8 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -1969,7 +1969,7 @@ vge_init(xsc)
/* Set our station address */
for (i = 0; i < ETHER_ADDR_LEN; i++)
- CSR_WRITE_1(sc, VGE_PAR0 + i, IFP2ENADDR(sc->vge_ifp)[i]);
+ CSR_WRITE_1(sc, VGE_PAR0 + i, IF_LLADDR(sc->vge_ifp)[i]);
/*
* Set receive FIFO threshold. Also allow transmission and
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c
index 27ae364..73bf764 100644
--- a/sys/dev/vr/if_vr.c
+++ b/sys/dev/vr/if_vr.c
@@ -1446,7 +1446,7 @@ vr_init_locked(struct vr_softc *sc)
/* Set our station address. */
for (i = 0; i < ETHER_ADDR_LEN; i++)
- CSR_WRITE_1(sc, VR_PAR0 + i, IFP2ENADDR(sc->vr_ifp)[i]);
+ CSR_WRITE_1(sc, VR_PAR0 + i, IF_LLADDR(sc->vr_ifp)[i]);
/* Set DMA size. */
VR_CLRBIT(sc, VR_BCR0, VR_BCR0_DMA_LENGTH);
diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c
index abc8091..a543440 100644
--- a/sys/dev/vx/if_vx.c
+++ b/sys/dev/vx/if_vx.c
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/ethernet.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/if_types.h>
#include <machine/bus.h>
@@ -232,7 +232,7 @@ vx_init_locked(struct vx_softc *sc)
GO_WINDOW(2);
for (i = 0; i < 6; i++) /* Reload the ether_addr. */
- CSR_WRITE_1(sc, VX_W2_ADDR_0 + i, IFP2ENADDR(sc->vx_ifp)[i]);
+ CSR_WRITE_1(sc, VX_W2_ADDR_0 + i, IF_LLADDR(sc->vx_ifp)[i]);
CSR_WRITE_2(sc, VX_COMMAND, RX_RESET);
VX_BUSY_WAIT;
@@ -756,7 +756,7 @@ again:
if (!(ifp->if_flags & IFF_PROMISC)
&& (eh->ether_dhost[0] & 1) == 0 /* !mcast and !bcast */
- && bcmp(eh->ether_dhost, IFP2ENADDR(sc->vx_ifp),
+ && bcmp(eh->ether_dhost, IF_LLADDR(sc->vx_ifp),
ETHER_ADDR_LEN) != 0) {
m_freem(m);
return;
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 43c9a5d..2903ec9 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -656,8 +656,6 @@ wi_init(void *arg)
struct wi_joinreq join;
int i;
int error = 0, wasenabled;
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl;
WI_LOCK_DECL();
WI_LOCK(sc);
@@ -717,9 +715,7 @@ wi_init(void *arg)
ieee80211_chan2ieee(ic, ic->ic_ibss_chan));
wi_write_ssid(sc, WI_RID_OWN_SSID, ic->ic_des_essid, ic->ic_des_esslen);
- ifa = ifaddr_byindex(ifp->if_index);
- sdl = (struct sockaddr_dl *) ifa->ifa_addr;
- IEEE80211_ADDR_COPY(ic->ic_myaddr, LLADDR(sdl));
+ IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp));
wi_write_rid(sc, WI_RID_MAC_NODE, ic->ic_myaddr, IEEE80211_ADDR_LEN);
if (ic->ic_caps & IEEE80211_C_PMGT)
diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c
index 4fb27ed..2108257 100644
--- a/sys/dev/wl/if_wl.c
+++ b/sys/dev/wl/if_wl.c
@@ -1192,7 +1192,7 @@ wlread(struct wl_softc *sc, u_short fd_p)
#endif
&&
(eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(eh->ether_dhost, IFP2ENADDR(sc->ifp),
+ bcmp(eh->ether_dhost, IF_LLADDR(sc->ifp),
sizeof(eh->ether_dhost)) != 0 ) {
m_freem(m);
return 1;
@@ -2142,7 +2142,7 @@ wlconfig(struct wl_softc *sc)
outw(PIOP1(base), 0); /* ac_status */
outw(PIOP1(base), AC_IASETUP|AC_CW_EL); /* ac_command */
outw(PIOR1(base), OFFSET_CU + 6);
- outsw(PIOP1(base), IFP2ENADDR(sc->ifp), WAVELAN_ADDR_SIZE/2);
+ outsw(PIOP1(base), IF_LLADDR(sc->ifp), WAVELAN_ADDR_SIZE/2);
if (wlcmd(sc, "config()-address") == 0)
return(0);
diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c
index 303036f..d8bae18 100644
--- a/sys/dev/xe/if_xe.c
+++ b/sys/dev/xe/if_xe.c
@@ -373,7 +373,7 @@ xe_init(void *xscp) {
/* Put MAC address in first 'individual address' register */
XE_SELECT_PAGE(0x50);
for (i = 0; i < 6; i++)
- XE_OUTB(0x08 + i, IFP2ENADDR(scp->ifp)[scp->mohawk ? 5 - i : i]);
+ XE_OUTB(0x08 + i, IF_LLADDR(scp->ifp)[scp->mohawk ? 5 - i : i]);
/* Set up multicast addresses */
xe_set_multicast(scp);
@@ -1309,7 +1309,7 @@ xe_set_multicast(struct xe_softc *scp) {
else if (count < 10) {
/* Full in any unused Individual Addresses with our MAC address */
for (i = count + 1; i < 10; i++)
- xe_set_addr(scp, (u_int8_t *)(IFP2ENADDR(scp->ifp)), i);
+ xe_set_addr(scp, IF_LLADDR(scp->ifp), i);
/* Enable Individual Address matching only */
XE_SELECT_PAGE(0x42);
XE_OUTB(XE_SWC1, (XE_INB(XE_SWC1) & ~XE_SWC1_ALLMULTI) | XE_SWC1_IA_ENABLE);
diff --git a/sys/net/if.c b/sys/net/if.c
index be7b842..e23f461 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -479,7 +479,7 @@ if_attach(struct ifnet *ifp)
sdl->sdl_nlen = namelen;
sdl->sdl_index = ifp->if_index;
sdl->sdl_type = ifp->if_type;
- ifaddr_byindex(ifp->if_index) = ifa;
+ ifp->if_addr = ifa;
ifa->ifa_ifp = ifp;
ifa->ifa_rtrequest = link_rtrequest;
ifa->ifa_addr = (struct sockaddr *)sdl;
@@ -598,7 +598,7 @@ if_purgeaddrs(struct ifnet *ifp)
/*
* Detach an interface, removing it from the
- * list of "active" interfaces and freeing the struct ifnet.
+ * list of "active" interfaces.
*
* XXXRW: There are some significant questions about event ordering, and
* how to prevent things from starting to use the interface during detach.
@@ -653,10 +653,10 @@ if_detach(struct ifnet *ifp)
in6_ifdetach(ifp);
#endif
/*
- * Remove address from ifindex_table[] and maybe decrement if_index.
+ * Remove link ifaddr pointer and maybe decrement if_index.
* Clean up all addresses.
*/
- ifaddr_byindex(ifp->if_index) = NULL;
+ ifp->if_addr = NULL;
destroy_dev(ifdev_byindex(ifp->if_index));
ifdev_byindex(ifp->if_index) = NULL;
@@ -1326,7 +1326,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
ifp->if_xname, new_name);
strlcpy(ifp->if_xname, new_name, sizeof(ifp->if_xname));
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
IFA_LOCK(ifa);
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
namelen = strlen(new_name);
@@ -2091,7 +2091,7 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len)
struct ifaddr *ifa;
struct ifreq ifr;
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
if (ifa == NULL)
return (EINVAL);
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c
index 94f6681..6cdb951 100644
--- a/sys/net/if_arcsubr.c
+++ b/sys/net/if_arcsubr.c
@@ -649,7 +649,7 @@ arc_ifattach(ifp, lla)
#if __FreeBSD_version < 500000
ifa = ifnet_addrs[ifp->if_index - 1];
#else
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
#endif
KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h
index c9cd15f..1e18804 100644
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -103,11 +103,9 @@ struct arpreq {
*/
struct arpcom {
struct ifnet *ac_ifp; /* network-visible interface */
- u_char *_ac_enaddr; /* ethernet hardware address */
void *ac_netgraph; /* ng_ether(4) netgraph node info */
};
#define IFP2AC(ifp) ((struct arpcom *)(ifp->if_l2com))
-#define IFP2ENADDR(ifp) (IFP2AC(ifp)->_ac_enaddr)
#define AC2IFP(ac) ((ac)->ac_ifp)
#endif
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 7090a6b..89f7420 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1673,7 +1673,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
eh = mtod(m, struct ether_header *);
- if (memcmp(eh->ether_dhost, IFP2ENADDR(bifp),
+ if (memcmp(eh->ether_dhost, IF_LLADDR(bifp),
ETHER_ADDR_LEN) == 0) {
/*
* If the packet is for us, set the packets source as the
diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c
index 448240e..849c8db 100644
--- a/sys/net/if_ef.c
+++ b/sys/net/if_ef.c
@@ -126,8 +126,6 @@ static int
ef_attach(struct efnet *sc)
{
struct ifnet *ifp = sc->ef_ifp;
- struct ifaddr *ifa2;
- struct sockaddr_dl *sdl2;
ifp->if_start = ef_start;
ifp->if_watchdog = NULL;
@@ -137,9 +135,7 @@ ef_attach(struct efnet *sc)
/*
* Attach the interface
*/
- ifa2 = ifaddr_byindex(sc->ef_pifp->if_index);
- sdl2 = (struct sockaddr_dl *)ifa2->ifa_addr;
- ether_ifattach(ifp, LLADDR(sdl2));
+ ether_ifattach(ifp, IF_LLADDR(sc->ef_pifp));
ifp->if_resolvemulti = 0;
ifp->if_type = IFT_XETHER;
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 9288a7f..7cfba9a 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -282,7 +282,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
(void)memcpy(eh->ether_shost, esrc,
sizeof(eh->ether_shost));
else
- (void)memcpy(eh->ether_shost, IFP2ENADDR(ifp),
+ (void)memcpy(eh->ether_shost, IF_LLADDR(ifp),
sizeof(eh->ether_shost));
/*
@@ -629,7 +629,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
/*
* XXX: Okay, we need to call carp_forus() and - if it is for
* us jump over code that does the normal check
- * "IFP2ENADDR(ifp) == ether_dhost". The check sequence is a bit
+ * "IF_LLADDR(ifp) == ether_dhost". The check sequence is a bit
* different from OpenBSD, so we jump over as few code as
* possible, to catch _all_ sanity checks. This needs
* evaluation, to see if the carp ether_dhost values break any
@@ -653,7 +653,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
if ((ifp->if_flags & IFF_PROMISC) != 0
&& !ETHER_IS_MULTICAST(eh->ether_dhost)
&& bcmp(eh->ether_dhost,
- IFP2ENADDR(ifp), ETHER_ADDR_LEN) != 0
+ IF_LLADDR(ifp), ETHER_ADDR_LEN) != 0
&& (ifp->if_flags & IFF_PPROMISC) == 0) {
m_freem(m);
return;
@@ -863,13 +863,12 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla)
ifp->if_baudrate = IF_Mbps(10); /* just a default */
ifp->if_broadcastaddr = etherbroadcastaddr;
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_ETHER;
sdl->sdl_alen = ifp->if_addrlen;
bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
- IFP2ENADDR(ifp) = LLADDR(sdl);
bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN);
if (ng_ether_attach_p != NULL)
@@ -1016,10 +1015,10 @@ ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
if (ipx_nullhost(*ina))
ina->x_host =
*(union ipx_host *)
- IFP2ENADDR(ifp);
+ IF_LLADDR(ifp);
else {
bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IFP2ENADDR(ifp),
+ (caddr_t) IF_LLADDR(ifp),
ETHER_ADDR_LEN);
}
@@ -1041,7 +1040,7 @@ ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
struct sockaddr *sa;
sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(IFP2ENADDR(ifp),
+ bcopy(IF_LLADDR(ifp),
(caddr_t) sa->sa_data, ETHER_ADDR_LEN);
}
break;
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 917ed66..d7c3e33 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -309,7 +309,7 @@ fddi_output(ifp, m, dst, rt0)
if (hdrcmplt)
bcopy((caddr_t)esrc, (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN);
else
- bcopy(IFP2ENADDR(ifp), (caddr_t)fh->fddi_shost,
+ bcopy(IF_LLADDR(ifp), (caddr_t)fh->fddi_shost,
FDDI_ADDR_LEN);
/*
@@ -420,7 +420,7 @@ fddi_input(ifp, m)
* is in promiscuous mode.
*/
if ((ifp->if_flags & IFF_PROMISC) && ((fh->fddi_dhost[0] & 1) == 0) &&
- (bcmp(IFP2ENADDR(ifp), (caddr_t)fh->fddi_dhost,
+ (bcmp(IF_LLADDR(ifp), (caddr_t)fh->fddi_dhost,
FDDI_ADDR_LEN) != 0))
goto dropanyway;
@@ -579,17 +579,13 @@ fddi_ifattach(ifp, lla, bpf)
#ifdef IFF_NOTRAILERS
ifp->if_flags |= IFF_NOTRAILERS;
#endif
- ifa = ifaddr_byindex(ifp->if_index);
- if (ifa == NULL) {
- if_printf(ifp, "%s() no lladdr!\n", __func__);
- return;
- }
+ ifa = ifp->if_addr;
+ KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_FDDI;
sdl->sdl_alen = ifp->if_addrlen;
bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
- IFP2ENADDR(ifp) = LLADDR(sdl);
if (bpf)
bpfattach(ifp, DLT_FDDI, FDDI_HDR_LEN);
@@ -647,10 +643,10 @@ fddi_ioctl (ifp, command, data)
if (ipx_nullhost(*ina)) {
ina->x_host = *(union ipx_host *)
- IFP2ENADDR(ifp);
+ IF_LLADDR(ifp);
} else {
bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IFP2ENADDR(ifp),
+ (caddr_t) IF_LLADDR(ifp),
ETHER_ADDR_LEN);
}
@@ -670,7 +666,7 @@ fddi_ioctl (ifp, command, data)
struct sockaddr *sa;
sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(IFP2ENADDR(ifp),
+ bcopy(IF_LLADDR(ifp),
(caddr_t) sa->sa_data, FDDI_ADDR_LEN);
}
diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c
index 191c4f0..3910237 100644
--- a/sys/net/if_fwsubr.c
+++ b/sys/net/if_fwsubr.c
@@ -766,7 +766,7 @@ firewire_ifattach(struct ifnet *ifp, struct fw_hwaddr *llc)
ifp->if_resolvemulti = firewire_resolvemulti;
ifp->if_broadcastaddr = (u_char *) &firewire_broadcastaddr;
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_IEEE1394;
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index d78de12..5d5a3a2 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -114,17 +114,13 @@ iso88025_ifattach(struct ifnet *ifp, const u_int8_t *lla, int bpf)
if (ifp->if_mtu == 0)
ifp->if_mtu = ISO88025_DEFAULT_MTU;
- ifa = ifaddr_byindex(ifp->if_index);
- if (ifa == 0) {
- if_printf(ifp, "%s() no lladdr!\n", __func__);
- return;
- }
+ ifa = ifp->if_addr;
+ KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_ISO88025;
sdl->sdl_alen = ifp->if_addrlen;
bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
- IFP2ENADDR(ifp) = LLADDR(sdl);
if (bpf)
bpfattach(ifp, DLT_IEEE802, ISO88025_HDR_LEN);
@@ -182,10 +178,10 @@ iso88025_ioctl(struct ifnet *ifp, int command, caddr_t data)
if (ipx_nullhost(*ina))
ina->x_host = *(union ipx_host *)
- IFP2ENADDR(ifp);
+ IF_LLADDR(ifp);
else
bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IFP2ENADDR(ifp),
+ (caddr_t) IF_LLADDR(ifp),
ISO88025_ADDR_LEN);
/*
@@ -205,7 +201,7 @@ iso88025_ioctl(struct ifnet *ifp, int command, caddr_t data)
struct sockaddr *sa;
sa = (struct sockaddr *) & ifr->ifr_data;
- bcopy(IFP2ENADDR(ifp),
+ bcopy(IF_LLADDR(ifp),
(caddr_t) sa->sa_data, ISO88025_ADDR_LEN);
}
break;
@@ -275,7 +271,7 @@ iso88025_output(ifp, m, dst, rt0)
/* Generate a generic 802.5 header for the packet */
gen_th.ac = TR_AC;
gen_th.fc = TR_LLC_FRAME;
- (void)memcpy((caddr_t)gen_th.iso88025_shost, IFP2ENADDR(ifp),
+ (void)memcpy((caddr_t)gen_th.iso88025_shost, IF_LLADDR(ifp),
ISO88025_ADDR_LEN);
if (rif_len) {
gen_th.iso88025_shost[0] |= TR_RII;
@@ -521,7 +517,7 @@ iso88025_input(ifp, m)
*/
if ((ifp->if_flags & IFF_PROMISC) &&
((th->iso88025_dhost[0] & 1) == 0) &&
- (bcmp(IFP2ENADDR(ifp), (caddr_t) th->iso88025_dhost,
+ (bcmp(IF_LLADDR(ifp), (caddr_t) th->iso88025_dhost,
ISO88025_ADDR_LEN) != 0))
goto dropanyway;
@@ -651,7 +647,7 @@ iso88025_input(ifp, m)
l->llc_dsap = l->llc_ssap;
l->llc_ssap = c;
if (m->m_flags & (M_BCAST | M_MCAST))
- bcopy((caddr_t)IFP2ENADDR(ifp),
+ bcopy((caddr_t)IF_LLADDR(ifp),
(caddr_t)th->iso88025_dhost,
ISO88025_ADDR_LEN);
sa.sa_family = AF_UNSPEC;
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index 4e1b727..66c4a92 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -60,7 +60,7 @@
#include <net/bpf.h>
#include <net/ethernet.h>
#include <net/if.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/route.h>
#include <net/if_types.h>
@@ -386,7 +386,7 @@ tapopen(dev, flag, mode, td)
return (EBUSY);
}
- bcopy(IFP2ENADDR(tp->tap_ifp), tp->ether_addr, sizeof(tp->ether_addr));
+ bcopy(IF_LLADDR(tp->tap_ifp), tp->ether_addr, sizeof(tp->ether_addr));
tp->tap_pid = td->td_proc->p_pid;
tp->tap_flags |= TAP_OPEN;
ifp = tp->tap_ifp;
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index b09319f..afd014a 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -125,7 +125,7 @@ struct ifnet {
* addresses which store the link-level address and the name
* of the interface.
* However, access to the AF_LINK address through this
- * field is deprecated. Use ifaddr_byindex() instead.
+ * field is deprecated. Use if_addr or ifaddr_byindex() instead.
*/
struct knlist if_klist; /* events attached to this if */
int if_pcount; /* number of promiscuous listeners */
@@ -158,7 +158,7 @@ struct ifnet {
(void *);
int (*if_resolvemulti) /* validate/resolve multicast */
(struct ifnet *, struct sockaddr **, struct sockaddr *);
- void *if_spare1; /* spare pointer 1 */
+ struct ifaddr *if_addr; /* pointer to link-level address */
void *if_spare2; /* spare pointer 2 */
void *if_spare3; /* spare pointer 3 */
int if_drv_flags; /* driver-managed status flags */
@@ -605,7 +605,6 @@ extern struct mtx ifnet_lock;
struct ifindex_entry {
struct ifnet *ife_ifnet;
- struct ifaddr *ife_ifnet_addr;
struct cdev *ife_dev;
};
@@ -615,7 +614,7 @@ struct ifindex_entry {
* link-level ifaddr for the interface. You are not supposed to use
* it to traverse the list of addresses associated to the interface.
*/
-#define ifaddr_byindex(idx) ifindex_table[(idx)].ife_ifnet_addr
+#define ifaddr_byindex(idx) ifnet_byindex(idx)->if_addr
#define ifdev_byindex(idx) ifindex_table[(idx)].ife_dev
extern struct ifnethead ifnet;
@@ -658,7 +657,7 @@ void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f);
void if_deregister_com_alloc(u_char type);
#define IF_LLADDR(ifp) \
- LLADDR((struct sockaddr_dl *) ifaddr_byindex((ifp)->if_index)->ifa_addr)
+ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr))
#ifdef DEVICE_POLLING
enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS };
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index e0377e2..89471cf 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -907,7 +907,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct sockaddr *sa;
sa = (struct sockaddr *) &ifr->ifr_data;
- bcopy(IFP2ENADDR(ifp), (caddr_t)sa->sa_data,
+ bcopy(IF_LLADDR(ifp), (caddr_t)sa->sa_data,
ETHER_ADDR_LEN);
}
break;
diff --git a/sys/net/route.c b/sys/net/route.c
index 6fc33f2..94d6c24 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -188,7 +188,7 @@ rtalloc1(struct sockaddr *dst, int report, u_long ignflags)
info.rti_info[RTAX_GATEWAY] = newrt->rt_gateway;
if (newrt->rt_ifp != NULL) {
info.rti_info[RTAX_IFP] =
- ifaddr_byindex(newrt->rt_ifp->if_index)->ifa_addr;
+ newrt->rt_ifp->if_addr->ifa_addr;
info.rti_info[RTAX_IFA] = newrt->rt_ifa->ifa_addr;
}
rt_missmsg(RTM_ADD, &info, newrt->rt_flags, 0);
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 641a796..f0a978d 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -444,7 +444,7 @@ route_output(struct mbuf *m, struct socket *so)
ifp = rt->rt_ifp;
if (ifp) {
info.rti_info[RTAX_IFP] =
- ifaddr_byindex(ifp->if_index)->ifa_addr;
+ ifp->if_addr->ifa_addr;
if (jailed(so->so_cred)) {
bzero(&jail, sizeof(jail));
jail.sin_family = PF_INET;
@@ -873,8 +873,7 @@ rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt)
int ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR;
info.rti_info[RTAX_IFA] = sa = ifa->ifa_addr;
- info.rti_info[RTAX_IFP] =
- ifaddr_byindex(ifp->if_index)->ifa_addr;
+ info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr;
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr;
if ((m = rt_msg1(ncmd, &info)) == NULL)
@@ -924,8 +923,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiaddr *ifma)
bzero((caddr_t)&info, sizeof(info));
info.rti_info[RTAX_IFA] = ifma->ifma_addr;
- info.rti_info[RTAX_IFP] =
- ifp ? ifaddr_byindex(ifp->if_index)->ifa_addr : NULL;
+ info.rti_info[RTAX_IFP] = ifp ? ifp->if_addr->ifa_addr : NULL;
/*
* If a link-layer address is present, present it as a ``gateway''
* (similarly to how ARP entries, e.g., are presented).
@@ -1058,8 +1056,7 @@ sysctl_dumpentry(struct radix_node *rn, void *vw)
info.rti_info[RTAX_NETMASK] = rt_mask(rt);
info.rti_info[RTAX_GENMASK] = rt->rt_genmask;
if (rt->rt_ifp) {
- info.rti_info[RTAX_IFP] =
- ifaddr_byindex(rt->rt_ifp->if_index)->ifa_addr;
+ info.rti_info[RTAX_IFP] = rt->rt_ifp->if_addr->ifa_addr;
info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr;
if (rt->rt_ifp->if_flags & IFF_POINTOPOINT)
info.rti_info[RTAX_BRD] = rt->rt_ifa->ifa_dstaddr;
@@ -1093,7 +1090,7 @@ sysctl_iflist(int af, struct walkarg *w)
TAILQ_FOREACH(ifp, &ifnet, if_link) {
if (w->w_arg && w->w_arg != ifp->if_index)
continue;
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
info.rti_info[RTAX_IFP] = ifa->ifa_addr;
len = rt_msg2(RTM_IFINFO, &info, NULL, w);
info.rti_info[RTAX_IFP] = NULL;
@@ -1154,7 +1151,7 @@ sysctl_ifmalist(int af, struct walkarg *w)
TAILQ_FOREACH(ifp, &ifnet, if_link) {
if (w->w_arg && w->w_arg != ifp->if_index)
continue;
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
info.rti_info[RTAX_IFP] = ifa ? ifa->ifa_addr : NULL;
IF_ADDR_LOCK(ifp);
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 00f8a76..38b8ece 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <net/if.h>
-#include <net/if_arp.h>
+#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/ethernet.h>
@@ -2463,10 +2463,10 @@ ieee80211_ioctl(struct ieee80211com *ic, u_long cmd, caddr_t data)
if (ipx_nullhost(*ina))
ina->x_host = *(union ipx_host *)
- IFP2ENADDR(ifp);
+ IF_LLADDR(ifp);
else
bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IFP2ENADDR(ifp),
+ (caddr_t) IF_LLADDR(ifp),
ETHER_ADDR_LEN);
/* fall thru... */
}
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index 50c5ced..d835d66 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -63,6 +63,7 @@
#include <sys/syslog.h>
#include <net/if.h>
+#include <net/if_dl.h>
#include <netinet/in.h>
#undef s_net
@@ -196,7 +197,7 @@ aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat)
ea->aarp_hln = sizeof(ea->aarp_sha);
ea->aarp_pln = sizeof(ea->aarp_spu);
ea->aarp_op = htons(AARPOP_REQUEST);
- bcopy(IFP2ENADDR(ifp), (caddr_t)ea->aarp_sha,
+ bcopy(IF_LLADDR(ifp), (caddr_t)ea->aarp_sha,
sizeof(ea->aarp_sha));
/*
@@ -360,7 +361,7 @@ at_aarpinput(struct ifnet *ifp, struct mbuf *m)
ea = mtod(m, struct ether_aarp *);
/* Check to see if from my hardware address */
- if (!bcmp((caddr_t)ea->aarp_sha, IFP2ENADDR(ifp), ETHER_ADDR_LEN)) {
+ if (!bcmp((caddr_t)ea->aarp_sha, IF_LLADDR(ifp), ETHER_ADDR_LEN)) {
m_freem(m);
return;
}
@@ -483,7 +484,7 @@ at_aarpinput(struct ifnet *ifp, struct mbuf *m)
bcopy((caddr_t)ea->aarp_sha, (caddr_t)ea->aarp_tha,
sizeof(ea->aarp_sha));
- bcopy(IFP2ENADDR(ifp), (caddr_t)ea->aarp_sha,
+ bcopy(IF_LLADDR(ifp), (caddr_t)ea->aarp_sha,
sizeof(ea->aarp_sha));
/* XXX */
@@ -629,7 +630,7 @@ aarpprobe(void *arg)
ea->aarp_hln = sizeof(ea->aarp_sha);
ea->aarp_pln = sizeof(ea->aarp_spu);
ea->aarp_op = htons(AARPOP_PROBE);
- bcopy(IFP2ENADDR(ifp), (caddr_t)ea->aarp_sha,
+ bcopy(IF_LLADDR(ifp), (caddr_t)ea->aarp_sha,
sizeof(ea->aarp_sha));
eh = (struct ether_header *)sa.sa_data;
diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c
index cc9cfb0a..cdf4960 100644
--- a/sys/netatm/atm_if.c
+++ b/sys/netatm/atm_if.c
@@ -561,7 +561,7 @@ atm_physif_ioctl(code, data, arg)
* Set macaddr in <Link> address
*/
ifp->if_addrlen = 6;
- ifa = ifaddr_byindex(ifp->if_index);
+ ifa = ifp->if_addr;
if ( ifa ) {
sdl = (struct sockaddr_dl *)
ifa->ifa_addr;
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index 484f2a9..51e40c2 100644
--- a/sys/netgraph/ng_ether.c
+++ b/sys/netgraph/ng_ether.c
@@ -461,7 +461,7 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook)
error = ENOMEM;
break;
}
- bcopy(IFP2ENADDR(priv->ifp),
+ bcopy(IF_LLADDR(priv->ifp),
resp->data, ETHER_ADDR_LEN);
break;
case NGM_ETHER_SET_ENADDR:
@@ -624,7 +624,7 @@ ng_ether_rcv_lower(node_p node, struct mbuf *m)
return (ENOBUFS);
/* Overwrite source MAC address */
- bcopy(IFP2ENADDR(ifp),
+ bcopy(IF_LLADDR(ifp),
mtod(m, struct ether_header *)->ether_shost,
ETHER_ADDR_LEN);
}
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index 85e2f77..fb5657c 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -102,8 +102,8 @@
#include <sys/queue.h>
#include <net/if.h>
+#include <net/if_dl.h>
#include <net/if_types.h>
-#include <net/if_arp.h>
#include <net/if_media.h>
#include <net/bpf.h>
#include <net/ethernet.h>
@@ -411,18 +411,18 @@ ng_fec_addport(struct ng_fec_private *priv, char *iface)
* by extension, all the other ports in the bundle).
*/
if (b->fec_ifcnt == 0)
- if_setlladdr(ifp, IFP2ENADDR(bifp), ETHER_ADDR_LEN);
+ if_setlladdr(ifp, IF_LLADDR(bifp), ETHER_ADDR_LEN);
b->fec_btype = FEC_BTYPE_MAC;
new->fec_idx = b->fec_ifcnt;
b->fec_ifcnt++;
/* Save the real MAC address. */
- bcopy(IFP2ENADDR(bifp),
+ bcopy(IF_LLADDR(bifp),
(char *)&new->fec_mac, ETHER_ADDR_LEN);
/* Set up phony MAC address. */
- if_setlladdr(bifp, IFP2ENADDR(ifp), ETHER_ADDR_LEN);
+ if_setlladdr(bifp, IF_LLADDR(ifp), ETHER_ADDR_LEN);
/* Save original input vector */
new->fec_if_input = bifp->if_input;
@@ -1143,7 +1143,7 @@ ng_fec_constructor(node_p node)
log(LOG_WARNING, "%s: can't acquire netgraph name\n", ifname);
/* Attach the interface */
- ether_ifattach(ifp, IFP2ENADDR(priv->ifp));
+ ether_ifattach(ifp, IF_LLADDR(priv->ifp));
callout_handle_init(&priv->fec_ch);
/* Override output method with our own */
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 44157b4..4f7fb5e 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1049,8 +1049,8 @@ carp_send_arp(struct carp_softc *sc)
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
-/* arprequest(sc->sc_carpdev, &in, &in, IFP2ENADDR(sc->sc_ifp)); */
- arp_ifinit2(sc->sc_carpdev, ifa, IFP2ENADDR(sc->sc_ifp));
+/* arprequest(sc->sc_carpdev, &in, &in, IF_LLADDR(sc->sc_ifp)); */
+ arp_ifinit2(sc->sc_carpdev, ifa, IF_LLADDR(sc->sc_ifp));
DELAY(1000); /* XXX */
}
@@ -1145,7 +1145,7 @@ carp_iamatch(void *v, struct in_ifaddr *ia,
if (count == index) {
if (vh->sc_state ==
MASTER) {
- *enaddr = IFP2ENADDR(vh->sc_ifp);
+ *enaddr = IF_LLADDR(vh->sc_ifp);
CARP_UNLOCK(cif);
return (1);
} else {
@@ -1163,7 +1163,7 @@ carp_iamatch(void *v, struct in_ifaddr *ia,
if ((SC2IFP(vh)->if_flags & IFF_UP) &&
(SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING) &&
ia->ia_ifp == SC2IFP(vh)) {
- *enaddr = IFP2ENADDR(vh->sc_ifp);
+ *enaddr = IF_LLADDR(vh->sc_ifp);
CARP_UNLOCK(cif);
return (1);
}
@@ -1219,14 +1219,14 @@ carp_macmatch6(void *v, struct mbuf *m, const struct in6_addr *taddr)
if (mtag == NULL) {
/* better a bit than nothing */
CARP_UNLOCK(cif);
- return (IFP2ENADDR(sc->sc_ifp));
+ return (IF_LLADDR(sc->sc_ifp));
}
bcopy(&ifp, (caddr_t)(mtag + 1),
sizeof(struct ifnet *));
m_tag_prepend(m, mtag);
CARP_UNLOCK(cif);
- return (IFP2ENADDR(sc->sc_ifp));
+ return (IF_LLADDR(sc->sc_ifp));
}
}
}
@@ -1251,7 +1251,7 @@ carp_forus(void *v, void *dhost)
if ((SC2IFP(vh)->if_flags & IFF_UP) &&
(SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING) &&
vh->sc_state == MASTER &&
- !bcmp(dhost, IFP2ENADDR(vh->sc_ifp), ETHER_ADDR_LEN)) {
+ !bcmp(dhost, IF_LLADDR(vh->sc_ifp), ETHER_ADDR_LEN)) {
CARP_UNLOCK(cif);
return (SC2IFP(vh));
}
@@ -1863,12 +1863,12 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
return EEXIST;
}
sc->sc_vhid = carpr.carpr_vhid;
- IFP2ENADDR(sc->sc_ifp)[0] = 0;
- IFP2ENADDR(sc->sc_ifp)[1] = 0;
- IFP2ENADDR(sc->sc_ifp)[2] = 0x5e;
- IFP2ENADDR(sc->sc_ifp)[3] = 0;
- IFP2ENADDR(sc->sc_ifp)[4] = 1;
- IFP2ENADDR(sc->sc_ifp)[5] = sc->sc_vhid;
+ IF_LLADDR(sc->sc_ifp)[0] = 0;
+ IF_LLADDR(sc->sc_ifp)[1] = 0;
+ IF_LLADDR(sc->sc_ifp)[2] = 0x5e;
+ IF_LLADDR(sc->sc_ifp)[3] = 0;
+ IF_LLADDR(sc->sc_ifp)[4] = 1;
+ IF_LLADDR(sc->sc_ifp)[5] = sc->sc_vhid;
error--;
}
if (carpr.carpr_advbase > 0 || carpr.carpr_advskew > 0) {
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 107ef1f..3aedccd 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -2037,8 +2037,7 @@ ip_savecontrol(inp, mp, ip, m)
if (((ifp = m->m_pkthdr.rcvif))
&& ( ifp->if_index && (ifp->if_index <= if_index))) {
- sdp = (struct sockaddr_dl *)
- (ifaddr_byindex(ifp->if_index)->ifa_addr);
+ sdp = (struct sockaddr_dl *)ifp->if_addr->ifa_addr;
/*
* Change our mind and don't try copy.
*/
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index 46ec2da..7f1752c 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/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);
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index 2c780e2..452990c 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -1171,11 +1171,11 @@ pcn_init_locked(sc)
/* Set MAC address */
pcn_csr_write(sc, PCN_CSR_PAR0,
- ((u_int16_t *)IFP2ENADDR(sc->pcn_ifp))[0]);
+ ((u_int16_t *)IF_LLADDR(sc->pcn_ifp))[0]);
pcn_csr_write(sc, PCN_CSR_PAR1,
- ((u_int16_t *)IFP2ENADDR(sc->pcn_ifp))[1]);
+ ((u_int16_t *)IF_LLADDR(sc->pcn_ifp))[1]);
pcn_csr_write(sc, PCN_CSR_PAR2,
- ((u_int16_t *)IFP2ENADDR(sc->pcn_ifp))[2]);
+ ((u_int16_t *)IF_LLADDR(sc->pcn_ifp))[2]);
/* Init circular RX list. */
if (pcn_list_rx_init(sc) == ENOBUFS) {
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index a76a28e..970bb59 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1511,9 +1511,9 @@ rl_init_locked(struct rl_softc *sc)
*/
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG);
CSR_WRITE_STREAM_4(sc, RL_IDR0,
- *(uint32_t *)(&IFP2ENADDR(sc->rl_ifp)[0]));
+ *(uint32_t *)(&IF_LLADDR(sc->rl_ifp)[0]));
CSR_WRITE_STREAM_4(sc, RL_IDR4,
- *(uint32_t *)(&IFP2ENADDR(sc->rl_ifp)[4]));
+ *(uint32_t *)(&IF_LLADDR(sc->rl_ifp)[4]));
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
/* Init the RX buffer pointer register. */
diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c
index 4564afe..a4703ed 100644
--- a/sys/pci/if_sf.c
+++ b/sys/pci/if_sf.c
@@ -1239,9 +1239,9 @@ sf_init_locked(sc)
(i + sizeof(u_int32_t)), 0);
/* Init our MAC address */
- csr_write_4(sc, SF_PAR0, *(u_int32_t *)(&IFP2ENADDR(sc->sf_ifp)[0]));
- csr_write_4(sc, SF_PAR1, *(u_int32_t *)(&IFP2ENADDR(sc->sf_ifp)[4]));
- sf_setperf(sc, 0, (caddr_t)&IFP2ENADDR(sc->sf_ifp));
+ csr_write_4(sc, SF_PAR0, *(u_int32_t *)(&IF_LLADDR(sc->sf_ifp)[0]));
+ csr_write_4(sc, SF_PAR1, *(u_int32_t *)(&IF_LLADDR(sc->sf_ifp)[4]));
+ sf_setperf(sc, 0, IF_LLADDR(sc->sf_ifp));
if (sf_init_rx_ring(sc) == ENOBUFS) {
if_printf(sc->sf_ifp,
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 762d138..b24d578 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -1869,23 +1869,23 @@ sis_initl(struct sis_softc *sc)
if (sc->sis_type == SIS_TYPE_83815) {
CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR0);
CSR_WRITE_4(sc, SIS_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[0]);
+ ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]);
CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR1);
CSR_WRITE_4(sc, SIS_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[1]);
+ ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]);
CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR2);
CSR_WRITE_4(sc, SIS_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[2]);
+ ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]);
} else {
CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0);
CSR_WRITE_4(sc, SIS_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[0]);
+ ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]);
CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR1);
CSR_WRITE_4(sc, SIS_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[1]);
+ ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]);
CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2);
CSR_WRITE_4(sc, SIS_RXFILT_DATA,
- ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[2]);
+ ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]);
}
/* Init circular TX/RX lists. */
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c
index cc53083..7c46d3e 100644
--- a/sys/pci/if_sk.c
+++ b/sys/pci/if_sk.c
@@ -2580,11 +2580,11 @@ sk_init_xmac(sc_if)
/* Set station address */
SK_XM_WRITE_2(sc_if, XM_PAR0,
- *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[0]));
+ *(u_int16_t *)(&IF_LLADDR(sc_if->sk_ifp)[0]));
SK_XM_WRITE_2(sc_if, XM_PAR1,
- *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[2]));
+ *(u_int16_t *)(&IF_LLADDR(sc_if->sk_ifp)[2]));
SK_XM_WRITE_2(sc_if, XM_PAR2,
- *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[4]));
+ *(u_int16_t *)(&IF_LLADDR(sc_if->sk_ifp)[4]));
SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_USE_STATION);
if (ifp->if_flags & IFF_BROADCAST) {
@@ -2755,8 +2755,8 @@ sk_init_yukon(sc_if)
for (i = 0; i < 3; i++) {
/* Write Source Address 1 (unicast filter) */
SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4,
- IFP2ENADDR(sc_if->sk_ifp)[i * 2] |
- IFP2ENADDR(sc_if->sk_ifp)[i * 2 + 1] << 8);
+ IF_LLADDR(sc_if->sk_ifp)[i * 2] |
+ IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8);
}
for (i = 0; i < 3; i++) {
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index 2113337..3cdd581 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -1305,7 +1305,7 @@ ste_init_locked(sc)
/* Init our MAC address */
for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, STE_PAR0 + i, IFP2ENADDR(sc->ste_ifp)[i]);
+ CSR_WRITE_1(sc, STE_PAR0 + i, IF_LLADDR(sc->ste_ifp)[i]);
}
/* Init RX list */
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c
index d4fd437..c7ae13d 100644
--- a/sys/pci/if_ti.c
+++ b/sys/pci/if_ti.c
@@ -2862,7 +2862,7 @@ static void ti_init2(sc)
TI_DO_CMD(TI_CMD_UPDATE_GENCOM, 0, 0);
/* Load our MAC address. */
- m = (u_int16_t *)&IFP2ENADDR(sc->ti_ifp)[0];
+ m = (u_int16_t *)IF_LLADDR(sc->ti_ifp);
CSR_WRITE_4(sc, TI_GCR_PAR0, htons(m[0]));
CSR_WRITE_4(sc, TI_GCR_PAR1, (htons(m[1]) << 16) | htons(m[2]));
TI_DO_CMD(TI_CMD_SET_MAC_ADDR, 0, 0);
diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c
index babd1ae..b06ae6a6 100644
--- a/sys/pci/if_tl.c
+++ b/sys/pci/if_tl.c
@@ -1525,7 +1525,7 @@ tl_intvec_rxeof(xsc, type)
*/
eh = mtod(m, struct ether_header *);
/*if (ifp->if_flags & IFF_PROMISC && */
- if (!bcmp(eh->ether_shost, IFP2ENADDR(sc->tl_ifp),
+ if (!bcmp(eh->ether_shost, IF_LLADDR(sc->tl_ifp),
ETHER_ADDR_LEN)) {
m_freem(m);
continue;
@@ -2091,7 +2091,7 @@ tl_init_locked(sc)
tl_dio_write16(sc, TL_MAXRX, MCLBYTES);
/* Init our MAC address */
- tl_setfilt(sc, (caddr_t)IFP2ENADDR(sc->tl_ifp), 0);
+ tl_setfilt(sc, IF_LLADDR(sc->tl_ifp), 0);
/* Init multicast filter, if needed. */
tl_setmulti(sc);
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
index 27ae364..73bf764 100644
--- a/sys/pci/if_vr.c
+++ b/sys/pci/if_vr.c
@@ -1446,7 +1446,7 @@ vr_init_locked(struct vr_softc *sc)
/* Set our station address. */
for (i = 0; i < ETHER_ADDR_LEN; i++)
- CSR_WRITE_1(sc, VR_PAR0 + i, IFP2ENADDR(sc->vr_ifp)[i]);
+ CSR_WRITE_1(sc, VR_PAR0 + i, IF_LLADDR(sc->vr_ifp)[i]);
/* Set DMA size. */
VR_CLRBIT(sc, VR_BCR0, VR_BCR0_DMA_LENGTH);
diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c
index 6516667..ae097de 100644
--- a/sys/pci/if_wb.c
+++ b/sys/pci/if_wb.c
@@ -1598,7 +1598,7 @@ wb_init_locked(sc)
/* Init our MAC address */
for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, WB_NODE0 + i, IFP2ENADDR(sc->wb_ifp)[i]);
+ CSR_WRITE_1(sc, WB_NODE0 + i, IF_LLADDR(sc->wb_ifp)[i]);
}
/* Init circular RX list. */
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 37aab4e..f884ac6 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -857,9 +857,9 @@ xl_testpacket(struct xl_softc *sc)
if (m == NULL)
return;
- bcopy(IFP2ENADDR(sc->xl_ifp),
+ bcopy(IF_LLADDR(sc->xl_ifp),
mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN);
- bcopy(IFP2ENADDR(sc->xl_ifp),
+ bcopy(IF_LLADDR(sc->xl_ifp),
mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN);
mtod(m, struct ether_header *)->ether_type = htons(3);
mtod(m, unsigned char *)[14] = 0;
@@ -2807,7 +2807,7 @@ xl_init_locked(struct xl_softc *sc)
XL_SEL_WIN(2);
for (i = 0; i < ETHER_ADDR_LEN; i++) {
CSR_WRITE_1(sc, XL_W2_STATION_ADDR_LO + i,
- IFP2ENADDR(sc->xl_ifp)[i]);
+ IF_LLADDR(sc->xl_ifp)[i]);
}
/* Clear the station mask. */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 06b53b8..7a19c81 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 700005 /* Master, propagated to newvers */
+#define __FreeBSD_version 700006 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>
OpenPOWER on IntegriCloud