Resolve misalignment traps caused by changes to IF_LLADDR().
Use de16dec() and le16dec() to fetch the link-level address from struct ifnet. Tested on: alpha Reviewed by: jhb See also: de(4)
This commit is contained in:
parent
570800eb92
commit
795233d73a
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user