summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-11 16:04:59 +0000
committerru <ru@FreeBSD.org>2005-11-11 16:04:59 +0000
commitf70f525b491a7d4a0a4f60eb7d69095f6f6e12e4 (patch)
treec961eb29eda0888de8f7fedb7d3eb12e58d687d3 /sys/dev
parentf82904627463e2f13912d433c5855e8bc112a3f3 (diff)
downloadFreeBSD-src-f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4.zip
FreeBSD-src-f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4.tar.gz
- 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.
Diffstat (limited to 'sys/dev')
-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
45 files changed, 100 insertions, 103 deletions
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);
OpenPOWER on IntegriCloud