aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-06-01 05:44:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-03 14:10:46 -0400
commite9141f71f4734584bc9704e1266090abe98e1859 (patch)
tree0441d1a0bc03bbe36ff2d6e8a4b1b0b3da2c23d9 /drivers/net/wireless
parent15ae733b25b7d74e9ef14eab8414447204bdcc1b (diff)
ath9k_hw: Fix async fifo for AR9287
Async fifo is now enabled only for versions 1.3 and above. Enable it in the appropriate place, in the reset routine, instead of process_ini(). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c11
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c24
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h58
5 files changed, 55 insertions, 44 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index b2c17c98bb38..96018d53f48e 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -742,17 +742,6 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
742 return -EINVAL; 742 return -EINVAL;
743 } 743 }
744 744
745 if (AR_SREV_9287_12_OR_LATER(ah)) {
746 /* Enable ASYNC FIFO */
747 REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
748 AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL);
749 REG_SET_BIT(ah, AR_PHY_MODE, AR_PHY_MODE_ASYNCFIFO);
750 REG_CLR_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
751 AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
752 REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
753 AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
754 }
755
756 /* 745 /*
757 * Set correct baseband to analog shift setting to 746 * Set correct baseband to analog shift setting to
758 * access analog chips. 747 * access analog chips.
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index 748449cd5872..7ba9dd68cc05 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -18,6 +18,7 @@
18#include "ar5008_initvals.h" 18#include "ar5008_initvals.h"
19#include "ar9001_initvals.h" 19#include "ar9001_initvals.h"
20#include "ar9002_initvals.h" 20#include "ar9002_initvals.h"
21#include "ar9002_phy.h"
21 22
22/* General hardware code for the A5008/AR9001/AR9002 hadware families */ 23/* General hardware code for the A5008/AR9001/AR9002 hadware families */
23 24
@@ -565,18 +566,29 @@ int ar9002_hw_rf_claim(struct ath_hw *ah)
565 return 0; 566 return 0;
566} 567}
567 568
569void ar9002_hw_enable_async_fifo(struct ath_hw *ah)
570{
571 if (AR_SREV_9287_13_OR_LATER(ah)) {
572 REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
573 AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL);
574 REG_SET_BIT(ah, AR_PHY_MODE, AR_PHY_MODE_ASYNCFIFO);
575 REG_CLR_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
576 AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
577 REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
578 AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
579 }
580}
581
568/* 582/*
569 * Enable ASYNC FIFO
570 *
571 * If Async FIFO is enabled, the following counters change as MAC now runs 583 * If Async FIFO is enabled, the following counters change as MAC now runs
572 * at 117 Mhz instead of 88/44MHz when async FIFO is disabled. 584 * at 117 Mhz instead of 88/44MHz when async FIFO is disabled.
573 * 585 *
574 * The values below tested for ht40 2 chain. 586 * The values below tested for ht40 2 chain.
575 * Overwrite the delay/timeouts initialized in process ini. 587 * Overwrite the delay/timeouts initialized in process ini.
576 */ 588 */
577void ar9002_hw_enable_async_fifo(struct ath_hw *ah) 589void ar9002_hw_update_async_fifo(struct ath_hw *ah)
578{ 590{
579 if (AR_SREV_9287_12_OR_LATER(ah)) { 591 if (AR_SREV_9287_13_OR_LATER(ah)) {
580 REG_WRITE(ah, AR_D_GBL_IFS_SIFS, 592 REG_WRITE(ah, AR_D_GBL_IFS_SIFS,
581 AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR); 593 AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR);
582 REG_WRITE(ah, AR_D_GBL_IFS_SLOT, 594 REG_WRITE(ah, AR_D_GBL_IFS_SLOT,
@@ -600,9 +612,9 @@ void ar9002_hw_enable_async_fifo(struct ath_hw *ah)
600 */ 612 */
601void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah) 613void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah)
602{ 614{
603 if (AR_SREV_9287_12_OR_LATER(ah)) { 615 if (AR_SREV_9287_13_OR_LATER(ah)) {
604 REG_SET_BIT(ah, AR_PCU_MISC_MODE2, 616 REG_SET_BIT(ah, AR_PCU_MISC_MODE2,
605 AR_PCU_MISC_MODE2_ENABLE_AGGWEP); 617 AR_PCU_MISC_MODE2_ENABLE_AGGWEP);
606 } 618 }
607} 619}
608 620
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index df277e467b87..b0e42b0374c2 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1298,6 +1298,9 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1298 if (AR_SREV_9280_10_OR_LATER(ah)) 1298 if (AR_SREV_9280_10_OR_LATER(ah))
1299 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); 1299 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
1300 1300
1301 if (!AR_SREV_9300_20_OR_LATER(ah))
1302 ar9002_hw_enable_async_fifo(ah);
1303
1301 r = ath9k_hw_process_ini(ah, chan); 1304 r = ath9k_hw_process_ini(ah, chan);
1302 if (r) 1305 if (r)
1303 return r; 1306 return r;
@@ -1370,7 +1373,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1370 ath9k_hw_init_global_settings(ah); 1373 ath9k_hw_init_global_settings(ah);
1371 1374
1372 if (!AR_SREV_9300_20_OR_LATER(ah)) { 1375 if (!AR_SREV_9300_20_OR_LATER(ah)) {
1373 ar9002_hw_enable_async_fifo(ah); 1376 ar9002_hw_update_async_fifo(ah);
1374 ar9002_hw_enable_wep_aggregation(ah); 1377 ar9002_hw_enable_wep_aggregation(ah);
1375 } 1378 }
1376 1379
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 116d1c80aa21..88bf2fca3736 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -911,6 +911,7 @@ void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
911void ar9002_hw_cck_chan14_spread(struct ath_hw *ah); 911void ar9002_hw_cck_chan14_spread(struct ath_hw *ah);
912int ar9002_hw_rf_claim(struct ath_hw *ah); 912int ar9002_hw_rf_claim(struct ath_hw *ah);
913void ar9002_hw_enable_async_fifo(struct ath_hw *ah); 913void ar9002_hw_enable_async_fifo(struct ath_hw *ah);
914void ar9002_hw_update_async_fifo(struct ath_hw *ah);
914void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah); 915void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah);
915 916
916/* 917/*
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index a7371a080491..3e3ccef438db 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -760,32 +760,33 @@
760#define AR_SREV_REVISION2 0x00000F00 760#define AR_SREV_REVISION2 0x00000F00
761#define AR_SREV_REVISION2_S 8 761#define AR_SREV_REVISION2_S 8
762 762
763#define AR_SREV_VERSION_5416_PCI 0xD 763#define AR_SREV_VERSION_5416_PCI 0xD
764#define AR_SREV_VERSION_5416_PCIE 0xC 764#define AR_SREV_VERSION_5416_PCIE 0xC
765#define AR_SREV_REVISION_5416_10 0 765#define AR_SREV_REVISION_5416_10 0
766#define AR_SREV_REVISION_5416_20 1 766#define AR_SREV_REVISION_5416_20 1
767#define AR_SREV_REVISION_5416_22 2 767#define AR_SREV_REVISION_5416_22 2
768#define AR_SREV_VERSION_9100 0x14 768#define AR_SREV_VERSION_9100 0x14
769#define AR_SREV_VERSION_9160 0x40 769#define AR_SREV_VERSION_9160 0x40
770#define AR_SREV_REVISION_9160_10 0 770#define AR_SREV_REVISION_9160_10 0
771#define AR_SREV_REVISION_9160_11 1 771#define AR_SREV_REVISION_9160_11 1
772#define AR_SREV_VERSION_9280 0x80 772#define AR_SREV_VERSION_9280 0x80
773#define AR_SREV_REVISION_9280_10 0 773#define AR_SREV_REVISION_9280_10 0
774#define AR_SREV_REVISION_9280_20 1 774#define AR_SREV_REVISION_9280_20 1
775#define AR_SREV_REVISION_9280_21 2 775#define AR_SREV_REVISION_9280_21 2
776#define AR_SREV_VERSION_9285 0xC0 776#define AR_SREV_VERSION_9285 0xC0
777#define AR_SREV_REVISION_9285_10 0 777#define AR_SREV_REVISION_9285_10 0
778#define AR_SREV_REVISION_9285_11 1 778#define AR_SREV_REVISION_9285_11 1
779#define AR_SREV_REVISION_9285_12 2 779#define AR_SREV_REVISION_9285_12 2
780#define AR_SREV_VERSION_9287 0x180 780#define AR_SREV_VERSION_9287 0x180
781#define AR_SREV_REVISION_9287_10 0 781#define AR_SREV_REVISION_9287_10 0
782#define AR_SREV_REVISION_9287_11 1 782#define AR_SREV_REVISION_9287_11 1
783#define AR_SREV_REVISION_9287_12 2 783#define AR_SREV_REVISION_9287_12 2
784#define AR_SREV_VERSION_9271 0x140 784#define AR_SREV_REVISION_9287_13 3
785#define AR_SREV_REVISION_9271_10 0 785#define AR_SREV_VERSION_9271 0x140
786#define AR_SREV_REVISION_9271_11 1 786#define AR_SREV_REVISION_9271_10 0
787#define AR_SREV_VERSION_9300 0x1c0 787#define AR_SREV_REVISION_9271_11 1
788#define AR_SREV_REVISION_9300_20 2 /* 2.0 and 2.1 */ 788#define AR_SREV_VERSION_9300 0x1c0
789#define AR_SREV_REVISION_9300_20 2 /* 2.0 and 2.1 */
789 790
790#define AR_SREV_5416(_ah) \ 791#define AR_SREV_5416(_ah) \
791 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \ 792 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \
@@ -863,6 +864,11 @@
863 (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \ 864 (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \
864 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 865 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \
865 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_12))) 866 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_12)))
867#define AR_SREV_9287_13_OR_LATER(_ah) \
868 (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \
869 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \
870 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_13)))
871
866#define AR_SREV_9271(_ah) \ 872#define AR_SREV_9271(_ah) \
867 (((_ah))->hw_version.macVersion == AR_SREV_VERSION_9271) 873 (((_ah))->hw_version.macVersion == AR_SREV_VERSION_9271)
868#define AR_SREV_9271_10(_ah) \ 874#define AR_SREV_9271_10(_ah) \