aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2011-03-22 00:52:44 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2011-03-22 00:52:44 +0000
commit6359b5731ce3d4646f42c4a94f4633a5e1618adf (patch)
tree1e00e9e3fc87521ac6b774afc237fd2ff72e7af7
parentb335ecffa232bbd44bd0e97237c94958a6283d20 (diff)
downloadsrc-6359b5731ce3d4646f42c4a94f4633a5e1618adf.tar.gz
src-6359b5731ce3d4646f42c4a94f4633a5e1618adf.zip
Break out the RF mode setup into ar5416SetRfMode(), mirroring what ath9k does.
Notes
Notes: svn path=/head/; revision=219855
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_reset.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
index 3bfe6baa3256..77b351a43268 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
@@ -598,6 +598,29 @@ ar5416InitUserSettings(struct ath_hal *ah)
#endif
}
+static void
+ar5416SetRfMode(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+ uint32_t rfMode;
+
+ if (chan == AH_NULL)
+ return;
+
+ /* treat channel B as channel G , no B mode suport in owl */
+ rfMode = IEEE80211_IS_CHAN_CCK(chan) ?
+ AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM;
+
+ if (AR_SREV_MERLIN_20(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) {
+ /* phy mode bits for 5GHz channels require Fast Clock */
+ rfMode |= AR_PHY_MODE_DYNAMIC
+ | AR_PHY_MODE_DYN_CCK_DISABLE;
+ } else if (!AR_SREV_MERLIN_10_OR_LATER(ah)) {
+ rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ?
+ AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ;
+ }
+ OS_REG_WRITE(ah, AR_PHY_MODE, rfMode);
+}
+
/*
* Places the hardware into reset and then pulls it out of reset
*/
@@ -629,22 +652,9 @@ ar5416ChipReset(struct ath_hal *ah, const struct ieee80211_channel *chan)
* with an active radio can result in corrupted shifts to the
* radio device.
*/
- if (chan != AH_NULL) {
- uint32_t rfMode;
-
- /* treat channel B as channel G , no B mode suport in owl */
- rfMode = IEEE80211_IS_CHAN_CCK(chan) ?
- AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM;
- if (AR_SREV_MERLIN_20(ah) && IS_5GHZ_FAST_CLOCK_EN(ah, chan)) {
- /* phy mode bits for 5GHz channels require Fast Clock */
- rfMode |= AR_PHY_MODE_DYNAMIC
- | AR_PHY_MODE_DYN_CCK_DISABLE;
- } else if (!AR_SREV_MERLIN_10_OR_LATER(ah)) {
- rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ?
- AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ;
- }
- OS_REG_WRITE(ah, AR_PHY_MODE, rfMode);
- }
+ if (chan != AH_NULL)
+ ar5416SetRfMode(ah, chan);
+
return AH_TRUE;
}