Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Remove IFF_OACTIVE in txeof always, i.e. for the...



details:   https://anonhg.NetBSD.org/src/rev/f9d5b80254a1
branches:  trunk
changeset: 783949:f9d5b80254a1
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jan 13 08:38:04 2013 +0000

description:
Remove IFF_OACTIVE in txeof always, i.e. for the usb error case as well.

Set an if_timer.

diffstat:

 sys/dev/usb/if_smsc.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 85c82b0cb137 -r f9d5b80254a1 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c     Sun Jan 13 08:15:02 2013 +0000
+++ b/sys/dev/usb/if_smsc.c     Sun Jan 13 08:38:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smsc.c,v 1.3 2013/01/13 08:05:30 skrll Exp $        */
+/*     $NetBSD: if_smsc.c,v 1.4 2013/01/13 08:38:04 skrll Exp $        */
 
 /*     $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
 /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -642,9 +642,13 @@
        IFQ_DEQUEUE(&ifp->if_snd, m_head);
 
        bpf_mtap(ifp, m_head);
-       //m_freem(m_head);                      /* XXXNH needed? */
 
        ifp->if_flags |= IFF_OACTIVE;
+
+       /*
+        * Set a timeout in case the chip goes out to lunch.
+        */
+       ifp->if_timer = 5;
 }
 
 void
@@ -1351,6 +1355,9 @@
 
        s = splnet();
 
+       ifp->if_timer = 0;
+       ifp->if_flags &= ~IFF_OACTIVE;
+
        if (status != USBD_NORMAL_COMPLETION) {
                if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) {
                        splx(s);
@@ -1364,9 +1371,7 @@
                splx(s);
                return;
        }
-
-       ifp->if_timer = 0;
-       ifp->if_flags &= ~IFF_OACTIVE;
+       ifp->if_opackets++;
 
        m_freem(c->sc_mbuf);
        c->sc_mbuf = NULL;
@@ -1374,7 +1379,6 @@
        if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)
                smsc_start(ifp);
 
-       ifp->if_opackets++;
        splx(s);
 }
 



Home | Main Index | Thread Index | Old Index