diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 7dbb53974fab..965130a44dfc 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 *)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]); + 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); @@ -1324,9 +1324,9 @@ dc_setfilt_xircom(struct dc_softc *sc) } /* Set our MAC address */ - 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]); + 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/dc/if_dcreg.h b/sys/dev/dc/if_dcreg.h index ecf9962fcf55..e5195f5f0d90 100644 --- a/sys/dev/dc/if_dcreg.h +++ b/sys/dev/dc/if_dcreg.h @@ -473,9 +473,9 @@ struct dc_desc { (uintptr_t)(sc->dc_ldata->dc_tx_list + i) - (uintptr_t)sc->dc_ldata) #if BYTE_ORDER == BIG_ENDIAN -#define DC_SP_MAC(x) ((x) << 16) +#define DC_SP_MAC(ptr) (be16dec(ptr) << 16) #else -#define DC_SP_MAC(x) (x) +#define DC_SP_MAC(ptr) (le16dec(ptr)) #endif struct dc_list_data {