If we're using these devices on a big-endian CPU, byte swap the "count"

field in the dp8390's packet header (because the dp8390 runs in little-endian
mode in these cases).  Inspired by an e-mail from Kazuki Sakamoto.
This commit is contained in:
thorpej 1998-01-26 19:21:36 +00:00
parent 8f59ce8e35
commit 044add4253
3 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ne2000.c,v 1.6 1998/01/12 09:23:33 thorpej Exp $ */
/* $NetBSD: ne2000.c,v 1.7 1998/01/26 19:21:39 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -558,6 +558,9 @@ ne2000_read_hdr(sc, buf, hdr)
ne2000_readmem(sc->sc_regt, sc->sc_regh, nsc->sc_asict, nsc->sc_asich,
buf, (u_int8_t *)hdr, sizeof(struct dp8390_ring),
(nsc->sc_type == NE2000_TYPE_NE2000));
#if BYTE_ORDER == BIG_ENDIAN
hdr->count = bswap16(hdr->count);
#endif
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ec.c,v 1.3 1998/01/12 09:43:34 thorpej Exp $ */
/* $NetBSD: if_ec.c,v 1.4 1998/01/26 19:21:36 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -682,6 +682,9 @@ ec_read_hdr(sc, packet_ptr, packet_hdrp)
ec_readmem(esc, packet_ptr, (u_int8_t *)packet_hdrp,
sizeof(struct dp8390_ring));
#if BYTE_ORDER == BIG_ENDIAN
packet_hdrp->count = bswap16(packet_hdrp->count);
#endif
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_we.c,v 1.4 1998/01/13 06:13:29 thorpej Exp $ */
/* $NetBSD: if_we.c,v 1.5 1998/01/26 19:21:37 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -715,6 +715,9 @@ we_read_hdr(sc, packet_ptr, packet_hdrp)
we_readmem(wsc, packet_ptr, (u_int8_t *)packet_hdrp,
sizeof(struct dp8390_ring));
#if BYTE_ORDER == BIG_ENDIAN
packet_hdrp->count = bswap16(packet_hdrp->count);
#endif
}
void