diff options
| author | Pyun YongHyeon <yongari@FreeBSD.org> | 2010-02-26 20:26:17 +0000 |
|---|---|---|
| committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2010-02-26 20:26:17 +0000 |
| commit | 03c28f4ef5b02118bfb1988af9ae0a39bc46dc66 (patch) | |
| tree | 0b3661096c8cfd095ff016289a9f61ef5d0b4ea4 /sys/dev/bce | |
| parent | e89abed364643f41db46f223370d642e5509a42b (diff) | |
Notes
Diffstat (limited to 'sys/dev/bce')
| -rw-r--r-- | sys/dev/bce/if_bce.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 268c6325d8484..d5013d1439465 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -6989,7 +6989,7 @@ bce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) struct bce_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int mask, error = 0; + int mask, error = 0, reinit; DBENTER(BCE_VERBOSE_MISC); @@ -7010,7 +7010,16 @@ bce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + reinit = 0; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* + * Because allocation size is used in RX + * buffer allocation, stop controller if + * it is already running. + */ + bce_stop(sc); + reinit = 1; + } #ifdef BCE_JUMBO_HDRSPLIT /* No buffer allocation size changes are necessary. */ #else @@ -7028,7 +7037,8 @@ bce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } #endif - bce_init_locked(sc); + if (reinit != 0) + bce_init_locked(sc); BCE_UNLOCK(sc); break; @@ -7062,7 +7072,6 @@ bce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } BCE_UNLOCK(sc); - error = 0; break; @@ -7072,10 +7081,8 @@ bce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) DBPRINT(sc, BCE_VERBOSE_MISC, "Received SIOCADDMULTI/SIOCDELMULTI\n"); BCE_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) bce_set_rx_mode(sc); - error = 0; - } BCE_UNLOCK(sc); break; |
