Changeset 2156

Show
Ignore:
Timestamp:
02/24/07 04:57:04 (2 years ago)
Author:
proski
Message:

Don't call ath_reset() for devices that are down or invalid

When setting the MAC address or MTU, make sure not to call ath_reset()
if the master interface is down or invalid.

This fixes tickets #716 and #1156.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ath/if_ath.c

    r2141 r2156  
    90739073        struct ath_hal *ah = sc->sc_ah; 
    90749074        struct sockaddr *mac = addr; 
    9075         int error
     9075        int error = 0
    90769076 
    90779077        if (netif_running(dev)) { 
     
    90909090        IEEE80211_ADDR_COPY(dev->dev_addr, mac->sa_data); 
    90919091        ath_hal_setmac(ah, dev->dev_addr); 
    9092         error = ath_reset(dev); 
     9092        if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { 
     9093                error = ath_reset(dev); 
     9094        } 
    90939095        ATH_UNLOCK(sc); 
    90949096 
     
    91009102{ 
    91019103        struct ath_softc *sc = dev->priv; 
    9102         int error
     9104        int error = 0
    91039105 
    91049106        if (!(ATH_MIN_MTU < mtu && mtu <= ATH_MAX_MTU)) { 
     
    91119113        ATH_LOCK(sc); 
    91129114        dev->mtu = mtu; 
    9113         /* NB: the rx buffers may need to be reallocated */ 
    9114         tasklet_disable(&sc->sc_rxtq); 
    9115         error = ath_reset(dev); 
    9116         tasklet_enable(&sc->sc_rxtq); 
     9115        if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { 
     9116                /* NB: the rx buffers may need to be reallocated */ 
     9117                tasklet_disable(&sc->sc_rxtq); 
     9118                error = ath_reset(dev); 
     9119                tasklet_enable(&sc->sc_rxtq); 
     9120        } 
    91179121        ATH_UNLOCK(sc); 
    91189122