diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-12-02 04:27:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-02 15:17:51 -0500 |
commit | e7aecd327d80b2f156b54769013aaccb2a20645a (patch) | |
tree | 6b0edda6058597dc290bf75dd72883a8480b8250 /drivers/net/wireless/ath/ath5k/attach.c | |
parent | 8efa5d7d6ad307ae2d220def37ca89594062c40d (diff) |
ath5k: Add a function to read chipset's MAC revision
Add bus dependent revision read function which is used to
determine chipset's MAC before hardware is initialized.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/attach.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/attach.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c index 86f6fec069e8..9dbc1fa81795 100644 --- a/drivers/net/wireless/ath/ath5k/attach.c +++ b/drivers/net/wireless/ath/ath5k/attach.c | |||
@@ -128,7 +128,8 @@ int ath5k_hw_init(struct ath5k_softc *sc) | |||
128 | /* | 128 | /* |
129 | * Find the mac version | 129 | * Find the mac version |
130 | */ | 130 | */ |
131 | srev = ath5k_hw_reg_read(ah, AR5K_SREV); | 131 | ath5k_hw_read_srev(ah); |
132 | srev = ah->ah_mac_srev; | ||
132 | if (srev < AR5K_SREV_AR5311) | 133 | if (srev < AR5K_SREV_AR5311) |
133 | ah->ah_version = AR5K_AR5210; | 134 | ah->ah_version = AR5K_AR5210; |
134 | else if (srev < AR5K_SREV_AR5212) | 135 | else if (srev < AR5K_SREV_AR5212) |
@@ -136,6 +137,10 @@ int ath5k_hw_init(struct ath5k_softc *sc) | |||
136 | else | 137 | else |
137 | ah->ah_version = AR5K_AR5212; | 138 | ah->ah_version = AR5K_AR5212; |
138 | 139 | ||
140 | /* Get the MAC revision */ | ||
141 | ah->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); | ||
142 | ah->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV); | ||
143 | |||
139 | /* Fill the ath5k_hw struct with the needed functions */ | 144 | /* Fill the ath5k_hw struct with the needed functions */ |
140 | ret = ath5k_hw_init_desc_functions(ah); | 145 | ret = ath5k_hw_init_desc_functions(ah); |
141 | if (ret) | 146 | if (ret) |
@@ -146,9 +151,7 @@ int ath5k_hw_init(struct ath5k_softc *sc) | |||
146 | if (ret) | 151 | if (ret) |
147 | goto err; | 152 | goto err; |
148 | 153 | ||
149 | /* Get MAC, PHY and RADIO revisions */ | 154 | /* Get PHY and RADIO revisions */ |
150 | ah->ah_mac_srev = srev; | ||
151 | ah->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); | ||
152 | ah->ah_phy_revision = ath5k_hw_reg_read(ah, AR5K_PHY_CHIP_ID) & | 155 | ah->ah_phy_revision = ath5k_hw_reg_read(ah, AR5K_PHY_CHIP_ID) & |
153 | 0xffffffff; | 156 | 0xffffffff; |
154 | ah->ah_radio_5ghz_revision = ath5k_hw_radio_revision(ah, | 157 | ah->ah_radio_5ghz_revision = ath5k_hw_radio_revision(ah, |