diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-08-21 02:30:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:30 -0400 |
commit | 3d832611d794b3d312d26a4b251ac5285206f90d (patch) | |
tree | 5fd7abcc8833518ed184fc4b8d50b21786a5bd76 /drivers/net | |
parent | 103bf9f7d35849bce52ad412e4da5063b0716969 (diff) |
ath9k: Fix chainmask selection during scanning
The TX/RX chainmasks were set to 1x1 during scanning.
Configure them properly with the values retrieved from
the EEPROM.
Also, this requires scan_start/scan_end callbacks to be
locked with sc->mutex.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 9b9b4e8ee1ea..eb8d673cde59 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -439,7 +439,7 @@ static void ath_start_ani(struct ath_softc *sc) | |||
439 | */ | 439 | */ |
440 | void ath_update_chainmask(struct ath_softc *sc, int is_ht) | 440 | void ath_update_chainmask(struct ath_softc *sc, int is_ht) |
441 | { | 441 | { |
442 | if (is_ht || | 442 | if ((sc->sc_flags & SC_OP_SCANNING) || is_ht || |
443 | (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX)) { | 443 | (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX)) { |
444 | sc->tx_chainmask = sc->sc_ah->caps.tx_chainmask; | 444 | sc->tx_chainmask = sc->sc_ah->caps.tx_chainmask; |
445 | sc->rx_chainmask = sc->sc_ah->caps.rx_chainmask; | 445 | sc->rx_chainmask = sc->sc_ah->caps.rx_chainmask; |
@@ -2713,6 +2713,7 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | |||
2713 | struct ath_wiphy *aphy = hw->priv; | 2713 | struct ath_wiphy *aphy = hw->priv; |
2714 | struct ath_softc *sc = aphy->sc; | 2714 | struct ath_softc *sc = aphy->sc; |
2715 | 2715 | ||
2716 | mutex_lock(&sc->mutex); | ||
2716 | if (ath9k_wiphy_scanning(sc)) { | 2717 | if (ath9k_wiphy_scanning(sc)) { |
2717 | printk(KERN_DEBUG "ath9k: Two wiphys trying to scan at the " | 2718 | printk(KERN_DEBUG "ath9k: Two wiphys trying to scan at the " |
2718 | "same time\n"); | 2719 | "same time\n"); |
@@ -2720,6 +2721,7 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | |||
2720 | * Do not allow the concurrent scanning state for now. This | 2721 | * Do not allow the concurrent scanning state for now. This |
2721 | * could be improved with scanning control moved into ath9k. | 2722 | * could be improved with scanning control moved into ath9k. |
2722 | */ | 2723 | */ |
2724 | mutex_unlock(&sc->mutex); | ||
2723 | return; | 2725 | return; |
2724 | } | 2726 | } |
2725 | 2727 | ||
@@ -2729,6 +2731,7 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw) | |||
2729 | spin_lock_bh(&sc->ani_lock); | 2731 | spin_lock_bh(&sc->ani_lock); |
2730 | sc->sc_flags |= SC_OP_SCANNING; | 2732 | sc->sc_flags |= SC_OP_SCANNING; |
2731 | spin_unlock_bh(&sc->ani_lock); | 2733 | spin_unlock_bh(&sc->ani_lock); |
2734 | mutex_unlock(&sc->mutex); | ||
2732 | } | 2735 | } |
2733 | 2736 | ||
2734 | static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) | 2737 | static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) |
@@ -2736,11 +2739,13 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) | |||
2736 | struct ath_wiphy *aphy = hw->priv; | 2739 | struct ath_wiphy *aphy = hw->priv; |
2737 | struct ath_softc *sc = aphy->sc; | 2740 | struct ath_softc *sc = aphy->sc; |
2738 | 2741 | ||
2742 | mutex_lock(&sc->mutex); | ||
2739 | spin_lock_bh(&sc->ani_lock); | 2743 | spin_lock_bh(&sc->ani_lock); |
2740 | aphy->state = ATH_WIPHY_ACTIVE; | 2744 | aphy->state = ATH_WIPHY_ACTIVE; |
2741 | sc->sc_flags &= ~SC_OP_SCANNING; | 2745 | sc->sc_flags &= ~SC_OP_SCANNING; |
2742 | sc->sc_flags |= SC_OP_FULL_RESET; | 2746 | sc->sc_flags |= SC_OP_FULL_RESET; |
2743 | spin_unlock_bh(&sc->ani_lock); | 2747 | spin_unlock_bh(&sc->ani_lock); |
2748 | mutex_unlock(&sc->mutex); | ||
2744 | } | 2749 | } |
2745 | 2750 | ||
2746 | struct ieee80211_ops ath9k_ops = { | 2751 | struct ieee80211_ops ath9k_ops = { |