Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122824
b: refs/heads/master
c: aa33de0
h: refs/heads/master
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Dec 19, 2008
1 parent f122378 commit 4362d32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e3f308997f53d00e8cbebdb89d4f6e347aa963a
refs/heads/master: aa33de09a849bd65b1201e1aec42e3e412c14cf6
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath9k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ struct ath_softc {
struct ath_hal *sc_ah;
void __iomem *mem;
spinlock_t sc_resetlock;
struct mutex mutex;

u8 sc_curbssid[ETH_ALEN];
u8 sc_myaddr[ETH_ALEN];
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
printk(KERN_ERR "Unable to create debugfs files\n");

spin_lock_init(&sc->sc_resetlock);
mutex_init(&sc->mutex);
tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
(unsigned long)sc);
Expand Down Expand Up @@ -2133,6 +2134,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
struct ath_softc *sc = hw->priv;
struct ieee80211_conf *conf = &hw->conf;

mutex_lock(&sc->mutex);
if (changed & (IEEE80211_CONF_CHANGE_CHANNEL |
IEEE80211_CONF_CHANGE_HT)) {
struct ieee80211_channel *curchan = hw->conf.channel;
Expand All @@ -2145,6 +2147,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
if (pos == -1) {
DPRINTF(sc, ATH_DBG_FATAL, "Invalid channel: %d\n",
curchan->center_freq);
mutex_unlock(&sc->mutex);
return -EINVAL;
}

Expand All @@ -2165,6 +2168,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)

if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) {
DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n");
mutex_unlock(&sc->mutex);
return -EINVAL;
}

Expand All @@ -2174,6 +2178,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
if (changed & IEEE80211_CONF_CHANGE_POWER)
sc->sc_config.txpowlimit = 2 * conf->power_level;

mutex_unlock(&sc->mutex);
return 0;
}

Expand Down

0 comments on commit 4362d32

Please sign in to comment.