aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanoharan@atheros.com>2010-10-27 09:01:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-08 16:53:46 -0500
commit5f841b4130a639e5f0fbcf4a9b26045d734e4ee6 (patch)
tree2a13d6467b753647a779cb47f2cb97d440f4d2b8 /drivers/net/wireless/ath/ath9k/hw.c
parent269e2d77b82d92d8dad543a2375e74372e9d773e (diff)
ath9k: Avoid HW opmode overridden on monitor mode changes
The HW opmode is blindly set to monitor type on monitor mode change notification. This overrides the opmode when one of the interfaces is still running as non-monitor iftype. So the monitoring information needs to be maintained seperately. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index cc13ee11782..c3a49045986 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -952,9 +952,12 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
952 REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION); 952 REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
953 break; 953 break;
954 case NL80211_IFTYPE_STATION: 954 case NL80211_IFTYPE_STATION:
955 case NL80211_IFTYPE_MONITOR:
956 REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE); 955 REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
957 break; 956 break;
957 default:
958 if (ah->is_monitoring)
959 REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
960 break;
958 } 961 }
959} 962}
960 963
@@ -1634,7 +1637,6 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
1634 1637
1635 switch (ah->opmode) { 1638 switch (ah->opmode) {
1636 case NL80211_IFTYPE_STATION: 1639 case NL80211_IFTYPE_STATION:
1637 case NL80211_IFTYPE_MONITOR:
1638 REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon)); 1640 REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon));
1639 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff); 1641 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
1640 REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff); 1642 REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
@@ -1663,6 +1665,14 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
1663 AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; 1665 AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN;
1664 break; 1666 break;
1665 default: 1667 default:
1668 if (ah->is_monitoring) {
1669 REG_WRITE(ah, AR_NEXT_TBTT_TIMER,
1670 TU_TO_USEC(next_beacon));
1671 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
1672 REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
1673 flags |= AR_TBTT_TIMER_EN;
1674 break;
1675 }
1666 ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON, 1676 ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON,
1667 "%s: unsupported opmode: %d\n", 1677 "%s: unsupported opmode: %d\n",
1668 __func__, ah->opmode); 1678 __func__, ah->opmode);