Changeset 267
- Timestamp:
- Feb 5, 2011, 1:39:22 PM (14 years ago)
- Location:
- freebsd-mos-driver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd-mos-driver/Makefile
r200 r267 30 30 sleep 5 31 31 ifconfig ue0 10.0.1.1/24 32 33 code: 34 vim -o /usr/src/sys/dev/usb/net/if_rue.c if_mos.c -
freebsd-mos-driver/if_mos.c
r200 r267 2 2 #define USB_DEBUG 1 3 3 /* 4 * Copyright (c) 201 0Rick van der Zwet <info@rickvanderzwet.nl>4 * Copyright (c) 2011 Rick van der Zwet <info@rickvanderzwet.nl> 5 5 * 6 6 * Permission to use, copy, modify, and distribute this software for any … … 441 441 } 442 442 if (i == MOS_TIMEOUT) { 443 printf("%s: MII read timeout\n", "mos");443 DPRINTF("%s: %s: MII read timeout\n", "mos", __func__); 444 444 } 445 445 … … 473 473 } 474 474 if (i == MOS_TIMEOUT) { 475 printf("%s: MII write timeout\n", "mos");475 DPRINTF("%s: MII write timeout\n", "mos"); 476 476 } 477 477 … … 520 520 521 521 if (err) 522 printf("%s: media change failed\n", "mos");522 DPRINTF("%s: media change failed\n", "mos"); 523 523 524 524 if (!locked) … … 747 747 int err = mos_readmac(sc, ue->ue_eaddr); 748 748 if (err) { 749 printf("couldn't get MAC address\n");749 DPRINTF("couldn't get MAC address\n"); 750 750 } 751 751 DPRINTF("address: %s\n", ether_sprintf(ue->ue_eaddr)); … … 872 872 struct usb_page_cache *pc; 873 873 struct mbuf *m; 874 int actlen;875 874 876 875 DPRINTF("%s: %s: enter\n", "mos",__func__); 877 876 878 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);879 pc = usbd_xfer_get_frame(xfer, 0);880 877 881 878 switch (USB_GET_STATE(xfer)) { 882 879 case USB_ST_TRANSFERRED: 883 DPRINTF("transfer of %d bytes complete\n", actlen);880 DPRINTF("transfer of complete\n"); 884 881 ifp->if_opackets++; 885 882 /* FALLTHROUGH */ … … 890 887 */ 891 888 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 889 if (m == NULL) 890 return; 891 892 pc = usbd_xfer_get_frame(xfer, 0); 893 usbd_m_copy_in(pc, 0, m, 0, m->m_pkthdr.len); 892 894 893 895 usbd_xfer_set_frame_len(xfer, 0, m->m_pkthdr.len); 894 896 895 usbd_m_copy_in(pc, 0, m, 0, m->m_pkthdr.len);896 897 897 898 /* … … 1036 1037 struct mos_softc *sc = usbd_xfer_softc(xfer); 1037 1038 struct ifnet *ifp = uether_getifp(&sc->sc_ue); 1038 //struct usb_page_cache *pc;1039 struct usb_page_cache *pc; 1039 1040 int actlen; 1040 1041 1041 DPRINTF("%s: %s: enter\n", "mos", __func__);1042 // DPRINTF("%s: %s: enter\n", "mos", __func__); 1042 1043 ifp->if_oerrors++; 1043 printf("%s: watchdog timeout\n", "mos");1044 1044 1045 1045 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); … … 1048 1048 switch (USB_GET_STATE(xfer)) { 1049 1049 case USB_ST_TRANSFERRED: 1050 //pc = usbd_xfer_get_frame(xfer, 0); 1051 //usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); 1050 // DPRINTF("State is ST_TRANS\n"); 1051 1052 pc = usbd_xfer_get_frame(xfer, 0); 1053 //usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); 1052 1054 /* FALLTHROUGH */ 1053 1055 case USB_ST_SETUP: 1054 1056 tr_setup: 1057 //DPRINTF("State is ST_SETUP\n"); 1055 1058 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); 1056 1059 usbd_transfer_submit(xfer); 1057 1060 return; 1058 1061 default: /* Error */ 1062 DPRINTF("State is default\n"); 1059 1063 if (error != USB_ERR_CANCELLED) { 1060 1064 /* try to clear stall first */
Note:
See TracChangeset
for help on using the changeset viewer.