Changeset 173 for freebsd-mos-driver
- Timestamp:
- Sep 2, 2010, 3:01:30 PM (14 years ago)
- Location:
- freebsd-mos-driver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd-mos-driver/if_mos.c
r172 r173 517 517 val |= (MOS_CTL_TX_ENB | MOS_CTL_RX_ENB); 518 518 err = mos_reg_write_1(sc, MOS_CTL, val); 519 MOS_UNLOCK(sc);520 519 521 520 if (err) … … 711 710 712 711 713 DPRINTF N(11,"%s:", "mos");712 DPRINTF("%s:", "mos"); 714 713 715 714 if (sc->mos_flags & MCS7730) { 716 DPRINTF N(11," MCS7730");715 DPRINTF(" MCS7730"); 717 716 } else if (sc->mos_flags & MCS7830) { 718 DPRINTF N(11," MCS7830");717 DPRINTF(" MCS7830"); 719 718 } 720 719 … … 788 787 struct usb_page_cache *pc; 789 788 790 DPRINTF N(10,"%s: %s: enter\n", "mos",__func__);789 DPRINTF("%s: %s: enter\n", "mos",__func__); 791 790 792 791 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); … … 844 843 usbd_transfer_submit(xfer); 845 844 uether_rxflush(ue); 846 DPRINTF N(10,"%s: %s: start rx\n", "mos", __func__);845 DPRINTF("%s: %s: start rx\n", "mos", __func__); 847 846 848 847 return; … … 871 870 if (status != USB_ST_SETUP) { 872 871 if (status == USB_ST_TRANSFERRED) { 873 DPRINTF N(11,"transfer of %d bytes complete\n", actlen);872 DPRINTF("transfer of %d bytes complete\n", actlen); 874 873 ifp->if_opackets++; 875 874 } else { 876 DPRINTF N(11,"%s: usb error on tx: %s\n", "mos", usbd_errstr(status));875 DPRINTF("%s: usb error on tx: %s\n", "mos", usbd_errstr(status)); 877 876 ifp->if_oerrors++; 878 877 if (error == USB_ERR_CANCELLED) { … … 898 897 usbd_transfer_submit(xfer); 899 898 900 if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)901 mos_start(&sc->sc_ue);902 903 899 ifp->if_opackets++; 904 900 return; … … 909 905 { 910 906 struct mos_softc *sc = uether_getsc(ue); 911 struct ifnet *ifp = uether_getifp(ue);912 907 struct mii_data *mii = GET_MII(sc); 913 908 914 if (sc == NULL)915 return;916 917 909 MOS_LOCK_ASSERT(sc, MA_OWNED); 918 DPRINTF N(0xff,"%s: %s: enter\n", "mos", __func__);910 DPRINTF("%s: %s: enter\n", "mos", __func__); 919 911 920 912 mii_tick(mii); … … 924 916 "mos", __func__); 925 917 sc->mos_link++; 926 if (IFQ_IS_EMPTY(&ifp->if_snd) == 0) 927 mos_start(&sc->sc_ue); 918 mos_start(ue); 928 919 } 929 920 } … … 964 955 { 965 956 struct mos_softc *sc = uether_getsc(ue); 966 struct ifnet *ifp = uether_getifp(ue);967 struct mbuf *m_head = NULL;968 969 sc = ifp->if_softc;970 971 if (!sc->mos_link)972 return;973 974 //if (ifp->if_flags & IFF_OACTIVE)975 // return;976 977 IFQ_POLL(&ifp->if_snd, m_head);978 if (m_head == NULL)979 return;980 981 //if (mos_encap(sc, m_head, 0)) {982 // ifp->if_flags |= IFF_OACTIVE;983 // return;984 //}985 IFQ_DEQUEUE(&ifp->if_snd, m_head);986 957 987 958 /* 988 * If there's a BPF listener, bounce a copy of this frame 989 * to him. 959 * start the USB transfers, if not already started: 990 960 */ 991 BPF_MTAP(ifp, m_head); 992 993 /* 994 * Set a timeout in case the chip goes out to lunch. 995 */ 996 //ifp->if_timer = 5; 997 998 return; 961 usbd_transfer_start(sc->sc_xfer[MOS_ENDPT_TX]); 962 usbd_transfer_start(sc->sc_xfer[MOS_ENDPT_RX]); 963 usbd_transfer_start(sc->sc_xfer[MOS_ENDPT_INTR]); 999 964 } 1000 965 … … 1042 1007 mos_setmulti(ue); 1043 1008 1044 mii_mediachg(GET_MII(sc));1009 usbd_xfer_set_stall(sc->sc_xfer[MOS_ENDPT_TX]); 1045 1010 1046 1011 ifp->if_flags |= IFF_DRV_RUNNING; … … 1062 1027 1063 1028 //XXX: Porting, how? mos_txeof(c->mos_xfer, c, stat); 1064 1065 if (!IFQ_IS_EMPTY(&ifp->if_snd))1066 mos_start(&sc->sc_ue);1067 1029 } 1068 1030 -
freebsd-mos-driver/if_mosreg.h
r171 r173 179 179 180 180 struct mos_softc { 181 struct usb_ether sc_ue; 181 182 // struct device mos_dev; 182 183 //#define GET_MII(sc) (&(sc)->mos_mii) … … 212 213 213 214 214 struct usb_ether sc_ue;215 215 struct mtx sc_mtx; 216 216 struct usb_xfer *sc_xfer[MOS_ENDPT_MAX];
Note:
See TracChangeset
for help on using the changeset viewer.