Changeset 269 for freebsd-mos-driver
- Timestamp:
- Feb 6, 2011, 10:22:05 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd-mos-driver/if_mos.c
r268 r269 794 794 struct ifnet *ifp = uether_getifp(ue); 795 795 796 u_int8_t rxstat = 0; 797 u_int32_t actlen; 798 u_int16_t pktlen = 0; 799 struct mbuf *stat; 796 uint8_t rxstat = 0; 797 uint32_t actlen; 798 uint16_t pktlen = 0; 800 799 struct usb_page_cache *pc; 801 800 … … 808 807 case USB_ST_TRANSFERRED: 809 808 DPRINTF("read_callback actlen : %d\n", actlen); 810 if (actlen <= 1) 809 if (actlen <= 1) { 811 810 ifp->if_ierrors++; 812 811 goto tr_setup; 813 814 usbd_copy_out(pc, actlen - sizeof(stat), &stat, 815 sizeof(stat)); 812 } 816 813 817 814 /* evaluate status byte at the end */ 818 pktlen = actlen - 1;819 rxstat = stat->m_pktdat[pktlen] & MOS_RXSTS_MASK;815 usbd_copy_out(pc, actlen - sizeof(rxstat), &rxstat, 816 sizeof(rxstat)); 820 817 821 818 if (rxstat != MOS_RXSTS_VALID) { … … 835 832 836 833 if ( pktlen < sizeof(struct ether_header) ) { 834 DPRINTF("mos: pktlen %i is smaller than ether_header %i\n", pktlen, sizeof(struct ether_header)); 837 835 ifp->if_ierrors++; 838 836 goto tr_setup; … … 840 838 841 839 uether_rxbuf(ue, pc, 0, actlen); 842 843 840 /* FALLTHROUGH */ 844 841 case USB_ST_SETUP: … … 908 905 ifp->if_opackets++; 909 906 return; 910 default: /* Error */911 912 913 914 915 916 917 918 return;907 default: /* Error */ 908 DPRINTF("%s: usb error on tx: %s\n", "mos", usbd_errstr(error)); 909 ifp->if_oerrors++; 910 if (error != USB_ERR_CANCELLED) { 911 /* try to clear stall first */ 912 usbd_xfer_set_stall(xfer); 913 goto tr_setup; 914 } 915 return; 919 916 } 920 917 }
Note:
See TracChangeset
for help on using the changeset viewer.