aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-12-18 01:10:16 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:23:50 -0500
commitaa33de09a849bd65b1201e1aec42e3e412c14cf6 (patch)
treeb3149a22e5fe928feba7eee35d54dd405252c7b2 /drivers
parent5e3f308997f53d00e8cbebdb89d4f6e347aa963a (diff)
ath9k: Protect config() callback with a mutex
This should fix the timeout issues seen when using wpa_supplicant. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath9k/core.h1
-rw-r--r--drivers/net/wireless/ath9k/main.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index e38f0331cfd5..4ca2aed236e0 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -701,6 +701,7 @@ struct ath_softc {
701 struct ath_hal *sc_ah; 701 struct ath_hal *sc_ah;
702 void __iomem *mem; 702 void __iomem *mem;
703 spinlock_t sc_resetlock; 703 spinlock_t sc_resetlock;
704 struct mutex mutex;
704 705
705 u8 sc_curbssid[ETH_ALEN]; 706 u8 sc_curbssid[ETH_ALEN];
706 u8 sc_myaddr[ETH_ALEN]; 707 u8 sc_myaddr[ETH_ALEN];
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index e768be4669e7..94c526669a4d 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1324,6 +1324,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
1324 printk(KERN_ERR "Unable to create debugfs files\n"); 1324 printk(KERN_ERR "Unable to create debugfs files\n");
1325 1325
1326 spin_lock_init(&sc->sc_resetlock); 1326 spin_lock_init(&sc->sc_resetlock);
1327 mutex_init(&sc->mutex);
1327 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); 1328 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
1328 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet, 1329 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
1329 (unsigned long)sc); 1330 (unsigned long)sc);
@@ -2133,6 +2134,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2133 struct ath_softc *sc = hw->priv; 2134 struct ath_softc *sc = hw->priv;
2134 struct ieee80211_conf *conf = &hw->conf; 2135 struct ieee80211_conf *conf = &hw->conf;
2135 2136
2137 mutex_lock(&sc->mutex);
2136 if (changed & (IEEE80211_CONF_CHANGE_CHANNEL | 2138 if (changed & (IEEE80211_CONF_CHANGE_CHANNEL |
2137 IEEE80211_CONF_CHANGE_HT)) { 2139 IEEE80211_CONF_CHANGE_HT)) {
2138 struct ieee80211_channel *curchan = hw->conf.channel; 2140 struct ieee80211_channel *curchan = hw->conf.channel;
@@ -2145,6 +2147,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2145 if (pos == -1) { 2147 if (pos == -1) {
2146 DPRINTF(sc, ATH_DBG_FATAL, "Invalid channel: %d\n", 2148 DPRINTF(sc, ATH_DBG_FATAL, "Invalid channel: %d\n",
2147 curchan->center_freq); 2149 curchan->center_freq);
2150 mutex_unlock(&sc->mutex);
2148 return -EINVAL; 2151 return -EINVAL;
2149 } 2152 }
2150 2153
@@ -2165,6 +2168,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2165 2168
2166 if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) { 2169 if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) {
2167 DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n"); 2170 DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n");
2171 mutex_unlock(&sc->mutex);
2168 return -EINVAL; 2172 return -EINVAL;
2169 } 2173 }
2170 2174
@@ -2174,6 +2178,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2174 if (changed & IEEE80211_CONF_CHANGE_POWER) 2178 if (changed & IEEE80211_CONF_CHANGE_POWER)
2175 sc->sc_config.txpowlimit = 2 * conf->power_level; 2179 sc->sc_config.txpowlimit = 2 * conf->power_level;
2176 2180
2181 mutex_unlock(&sc->mutex);
2177 return 0; 2182 return 0;
2178} 2183}
2179 2184