diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2006-01-10 10:15:23 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2006-01-10 10:15:23 +0000 |
commit | c08d5edd015ad1ea3e0600c275a3979776f82a72 (patch) | |
tree | 44554e5d15fa4bdc5f4bb63ae8fa59e2a046ef2f /sys/dev/usb | |
parent | bbbe7c40639f41c3a9481952964ee47b8d0dee45 (diff) |
fix axe on big endian archs. for jolan
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_axe.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 9628e2fac34..443da9ac5c2 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.43 2005/12/21 12:33:07 jsg Exp $ */ +/* $OpenBSD: if_axe.c,v 1.44 2006/01/10 10:15:22 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -969,13 +969,16 @@ axe_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) memcpy(&hdr, buf, sizeof(hdr)); total_len -= sizeof(hdr); - if ((hdr.len ^ hdr.ilen) != 0xffff || - (hdr.len > total_len)) { + if ((hdr.len ^ hdr.ilen) != 0xffff) { + ifp->if_ierrors++; + goto done; + } + pktlen = letoh16(hdr.len); + if (pktlen > total_len) { ifp->if_ierrors++; goto done; } - pktlen = hdr.len; buf += sizeof(hdr); total_len -= pktlen + (pktlen % 2); } else { @@ -1143,7 +1146,7 @@ axe_encap(struct axe_softc *sc, struct mbuf *m, int idx) if (sc->axe_flags & AX178 || sc->axe_flags & AX772) { boundary = (sc->axe_udev->speed == USB_SPEED_HIGH) ? 512 : 64; - hdr.len = m->m_pkthdr.len; + hdr.len = htole16(m->m_pkthdr.len); hdr.ilen = ~hdr.len; memcpy(c->axe_buf, &hdr, sizeof(hdr)); |