提交 7152451a 编写于 作者: L Luis R. Rodriguez 提交者: John W. Linville

ath9k_hw: add common channel select helpers for ar900[23]

Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 da6f1d7f
...@@ -83,7 +83,7 @@ static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -83,7 +83,7 @@ static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
bMode = 1; bMode = 1;
fracMode = 1; fracMode = 1;
aModeRefSel = 0; aModeRefSel = 0;
channelSel = (freq * 0x10000) / 15; channelSel = CHANSEL_2G(freq);
if (AR_SREV_9287_11_OR_LATER(ah)) { if (AR_SREV_9287_11_OR_LATER(ah)) {
if (freq == 2484) { if (freq == 2484) {
...@@ -126,7 +126,7 @@ static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -126,7 +126,7 @@ static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
*/ */
fracMode = 1; fracMode = 1;
refDivA = 1; refDivA = 1;
channelSel = (freq * 0x8000) / 15; channelSel = CHANSEL_5G(freq);
/* RefDivA setting */ /* RefDivA setting */
REG_RMW_FIELD(ah, AR_AN_SYNTH9, REG_RMW_FIELD(ah, AR_AN_SYNTH9,
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
#ifndef PHY_H #ifndef PHY_H
#define PHY_H #define PHY_H
#define CHANSEL_DIV 15
#define CHANSEL_2G(_freq) (((_freq) * 0x10000) / CHANSEL_DIV)
#define CHANSEL_5G(_freq) (((_freq) * 0x8000) / CHANSEL_DIV)
#define AR_PHY_BASE 0x9800 #define AR_PHY_BASE 0x9800
#define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2)) #define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册