Index: dev/usb/net/if_smsc.c =================================================================== --- dev/usb/net/if_smsc.c (revision 243980) +++ dev/usb/net/if_smsc.c (working copy) @@ -92,6 +92,7 @@ #include #include +#include #include #include "usbdevs.h" @@ -957,9 +958,9 @@ usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); smsc_dbg_printf(sc, "rx : actlen %d\n", actlen); + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - /* There is always a zero length frame after bringing the IF up */ if (actlen < (sizeof(rxhdr) + ETHER_CRC_LEN)) goto tr_setup; @@ -977,7 +978,6 @@ off = ((off + 0x3) & ~0x3); usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); - off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); pktlen = (uint16_t)SMSC_RX_STAT_FRM_LENGTH(rxhdr); @@ -985,6 +985,10 @@ smsc_dbg_printf(sc, "rx : rxhdr 0x%08x : pktlen %d : actlen %d : " "off %d\n", rxhdr, pktlen, actlen, off); + if ((pktlen > 1520) || (pktlen == 0)) + panic("pkt len %d @%08x\n", pktlen, off); + off += (sizeof(rxhdr) + ETHER_ALIGN); + if (rxhdr & SMSC_RX_STAT_ERROR) { smsc_dbg_printf(sc, "rx error (hdr 0x%08x)\n", rxhdr); @@ -1061,6 +1065,7 @@ /* Update the offset to move to the next potential packet */ off += pktlen; } + /* FALLTHROUGH */ @@ -1194,8 +1199,9 @@ mii_tick(mii); if ((sc->sc_flags & SMSC_FLAG_LINK) == 0) { smsc_miibus_statchg(ue->ue_dev); - if ((sc->sc_flags & SMSC_FLAG_LINK) != 0) + if ((sc->sc_flags & SMSC_FLAG_LINK) != 0) { smsc_start(ue); + } } } @@ -1622,6 +1628,13 @@ sc->sc_ue.ue_eaddr[1] = (uint8_t)((mac_l >> 8) & 0xff); sc->sc_ue.ue_eaddr[0] = (uint8_t)((mac_l) & 0xff); } + + sc->sc_ue.ue_eaddr[0] = 0x0e; + sc->sc_ue.ue_eaddr[1] = 0x60; + sc->sc_ue.ue_eaddr[2] = 0x33; + sc->sc_ue.ue_eaddr[3] = 0xB1; + sc->sc_ue.ue_eaddr[4] = 0x46; + sc->sc_ue.ue_eaddr[5] = 0x01; /* MAC address is not set so try to read from EEPROM, if that fails generate * a random MAC address.