diff options
author | yongari <yongari@FreeBSD.org> | 2015-03-26 05:07:18 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2015-03-26 05:07:18 +0000 |
commit | 125afe6753d482d1a6a02da3db5ebdf87d013ef0 (patch) | |
tree | f5f2647a09c7c78fff9b6a7aaf6c269a0f7ebd91 | |
parent | f0de020e4accd241ac0722fe1d6893a2a781a6e5 (diff) | |
download | FreeBSD-src-125afe6753d482d1a6a02da3db5ebdf87d013ef0.zip FreeBSD-src-125afe6753d482d1a6a02da3db5ebdf87d013ef0.tar.gz |
MFC r277050:
Receive filter configuration is done in nge_rxfilter(). Remove
unnecessary filter configuration code in nge_init_locked().
While I'm here add a check for driver running state for multicast
filter handling. Also remove unnecessary assignment to error
variable since it is cleared in the function entry.
-rw-r--r-- | sys/dev/nge/if_nge.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 6f680c3..832ec1b 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -2102,27 +2102,6 @@ nge_init_locked(struct nge_softc *sc) */ nge_list_tx_init(sc); - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ARP); - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_PERFECT); - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_BROAD); - } else { - NGE_CLRBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_BROAD); - } - - /* Turn the receive filter on. */ - NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ENABLE); - /* Set Rx filter. */ nge_rxfilter(sc); @@ -2335,9 +2314,9 @@ nge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCADDMULTI: case SIOCDELMULTI: NGE_LOCK(sc); - nge_rxfilter(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + nge_rxfilter(sc); NGE_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: |