Author: yongari
Date: Tue Oct 13 17:56:48 2009
New Revision: 198039
URL: http://svn.freebsd.org/changeset/base/198039

Log:
  MFC 191345:
    To make it easy whether xl(4) missed Tx completion interrupt check
    number of queued packets in watchdog timeout handler. If there are
    no queued packets just print a informational message and return
    without resetting controller. Also fix to invoke correct Tx
    completion handler as 3C905B needs different handler.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/pci/if_xl.c

Modified: stable/7/sys/pci/if_xl.c
==============================================================================
--- stable/7/sys/pci/if_xl.c    Tue Oct 13 17:50:10 2009        (r198038)
+++ stable/7/sys/pci/if_xl.c    Tue Oct 13 17:56:48 2009        (r198039)
@@ -3216,12 +3216,31 @@ xl_watchdog(struct xl_softc *sc)
 {
        struct ifnet            *ifp = sc->xl_ifp;
        u_int16_t               status = 0;
+       int                     misintr;
 
        XL_LOCK_ASSERT(sc);
 
        if (sc->xl_wdog_timer == 0 || --sc->xl_wdog_timer != 0)
                return (0);
 
+       xl_rxeof(sc);
+       xl_txeoc(sc);
+       misintr = 0;
+       if (sc->xl_type == XL_TYPE_905B) {
+               xl_txeof_90xB(sc);
+               if (sc->xl_cdata.xl_tx_cnt == 0)
+                       misintr++;
+       } else {
+               xl_txeof(sc);
+               if (sc->xl_cdata.xl_tx_head == NULL)
+                       misintr++;
+       }
+       if (misintr != 0) {
+               device_printf(sc->xl_dev,
+                   "watchdog timeout (missed Tx interrupts) -- recovering\n");
+               return (0);
+       }
+
        ifp->if_oerrors++;
        XL_SEL_WIN(4);
        status = CSR_READ_2(sc, XL_W4_MEDIA_STATUS);
@@ -3231,9 +3250,6 @@ xl_watchdog(struct xl_softc *sc)
                device_printf(sc->xl_dev,
                    "no carrier - transceiver cable problem?\n");
 
-       xl_txeoc(sc);
-       xl_txeof(sc);
-       xl_rxeof(sc);
        xl_reset(sc);
        xl_init_locked(sc);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to