svn commit: r280658 - stable/9/sys/dev/sis

Pyun YongHyeon yongari at FreeBSD.org
Thu Mar 26 04:58:48 UTC 2015


Author: yongari
Date: Thu Mar 26 04:58:47 2015
New Revision: 280658
URL: https://svnweb.freebsd.org/changeset/base/280658

Log:
  MFC r275816:
    Fix a bug introdiced in r217548.  According to NS DP83815 data
    sheet, RX filter should be disabled before programming.
    Previously it was clearing wrong bits so RX filter was not
    disabled in RX filter configuration.
  
  MFC r277048:
    Enable receive filter in sis_rxfilter().
    While I'm here add a check for driver running state for multicast
    filter handling.

Modified:
  stable/9/sys/dev/sis/if_sis.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sis/if_sis.c
==============================================================================
--- stable/9/sys/dev/sis/if_sis.c	Thu Mar 26 04:55:22 2015	(r280657)
+++ stable/9/sys/dev/sis/if_sis.c	Thu Mar 26 04:58:47 2015	(r280658)
@@ -757,7 +757,8 @@ sis_rxfilter_ns(struct sis_softc *sc)
 		if_maddr_runlock(ifp);
 	}
 
-	CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter);
+	/* Turn the receive filter on */
+	CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter | SIS_RXFILTCTL_ENABLE);
 	CSR_READ_4(sc, SIS_RXFILT_CTL);
 }
 
@@ -779,7 +780,7 @@ sis_rxfilter_sis(struct sis_softc *sc)
 
 	filter = CSR_READ_4(sc, SIS_RXFILT_CTL);
 	if (filter & SIS_RXFILTCTL_ENABLE) {
-		CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL);
+		CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE);
 		CSR_READ_4(sc, SIS_RXFILT_CTL);
 	}
 	filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD |
@@ -819,7 +820,8 @@ sis_rxfilter_sis(struct sis_softc *sc)
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]);
 	}
 
-	CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter);
+	/* Turn the receive filter on */
+	CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter | SIS_RXFILTCTL_ENABLE);
 	CSR_READ_4(sc, SIS_RXFILT_CTL);
 }
 
@@ -2015,8 +2017,6 @@ sis_initl(struct sis_softc *sc)
 	}
 
 	sis_rxfilter(sc);
-	/* Turn the receive filter on */
-	SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE);
 
 	/*
 	 * Load the address of the RX and TX lists.
@@ -2138,7 +2138,8 @@ sis_ioctl(struct ifnet *ifp, u_long comm
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
 		SIS_LOCK(sc);
-		sis_rxfilter(sc);
+		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+			sis_rxfilter(sc);
 		SIS_UNLOCK(sc);
 		break;
 	case SIOCGIFMEDIA:


More information about the svn-src-stable-9 mailing list