diff options
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_hw.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 |
3 files changed, 53 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index 303c63da5ea3..94392daebaa0 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -580,3 +580,53 @@ void ar9002_hw_attach_ops(struct ath_hw *ah) | |||
580 | else | 580 | else |
581 | ath9k_hw_attach_ani_ops_old(ah); | 581 | ath9k_hw_attach_ani_ops_old(ah); |
582 | } | 582 | } |
583 | |||
584 | void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan) | ||
585 | { | ||
586 | u32 modesIndex; | ||
587 | int i; | ||
588 | |||
589 | switch (chan->chanmode) { | ||
590 | case CHANNEL_A: | ||
591 | case CHANNEL_A_HT20: | ||
592 | modesIndex = 1; | ||
593 | break; | ||
594 | case CHANNEL_A_HT40PLUS: | ||
595 | case CHANNEL_A_HT40MINUS: | ||
596 | modesIndex = 2; | ||
597 | break; | ||
598 | case CHANNEL_G: | ||
599 | case CHANNEL_G_HT20: | ||
600 | case CHANNEL_B: | ||
601 | modesIndex = 4; | ||
602 | break; | ||
603 | case CHANNEL_G_HT40PLUS: | ||
604 | case CHANNEL_G_HT40MINUS: | ||
605 | modesIndex = 3; | ||
606 | break; | ||
607 | |||
608 | default: | ||
609 | return; | ||
610 | } | ||
611 | |||
612 | ENABLE_REGWRITE_BUFFER(ah); | ||
613 | |||
614 | for (i = 0; i < ah->iniModes_9271_ANI_reg.ia_rows; i++) { | ||
615 | u32 reg = INI_RA(&ah->iniModes_9271_ANI_reg, i, 0); | ||
616 | u32 val = INI_RA(&ah->iniModes_9271_ANI_reg, i, modesIndex); | ||
617 | u32 val_orig; | ||
618 | |||
619 | if (reg == AR_PHY_CCK_DETECT) { | ||
620 | val_orig = REG_READ(ah, reg); | ||
621 | val &= AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK; | ||
622 | val_orig &= ~AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK; | ||
623 | |||
624 | REG_WRITE(ah, reg, val|val_orig); | ||
625 | } else | ||
626 | REG_WRITE(ah, reg, val); | ||
627 | } | ||
628 | |||
629 | REGWRITE_BUFFER_FLUSH(ah); | ||
630 | DISABLE_REGWRITE_BUFFER(ah); | ||
631 | |||
632 | } | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 68940a8864e0..afadade2a67e 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1263,6 +1263,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1263 | if (ath9k_hw_channel_change(ah, chan)) { | 1263 | if (ath9k_hw_channel_change(ah, chan)) { |
1264 | ath9k_hw_loadnf(ah, ah->curchan); | 1264 | ath9k_hw_loadnf(ah, ah->curchan); |
1265 | ath9k_hw_start_nfcal(ah, true); | 1265 | ath9k_hw_start_nfcal(ah, true); |
1266 | if (AR_SREV_9271(ah)) | ||
1267 | ar9002_hw_load_ani_reg(ah, chan); | ||
1266 | return 0; | 1268 | return 0; |
1267 | } | 1269 | } |
1268 | } | 1270 | } |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 197c717286e7..1724b17bfc73 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -996,6 +996,7 @@ void ar9003_hw_attach_calib_ops(struct ath_hw *ah); | |||
996 | void ar9002_hw_attach_ops(struct ath_hw *ah); | 996 | void ar9002_hw_attach_ops(struct ath_hw *ah); |
997 | void ar9003_hw_attach_ops(struct ath_hw *ah); | 997 | void ar9003_hw_attach_ops(struct ath_hw *ah); |
998 | 998 | ||
999 | void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan); | ||
999 | /* | 1000 | /* |
1000 | * ANI work can be shared between all families but a next | 1001 | * ANI work can be shared between all families but a next |
1001 | * generation implementation of ANI will be used only for AR9003 only | 1002 | * generation implementation of ANI will be used only for AR9003 only |