diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-03-08 05:40:38 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-13 16:02:33 -0400 |
commit | 40e024de932cca8b54fbcd0e5faf8f364cc84ec0 (patch) | |
tree | 27b96a33005686c6d57b4ae98186106c7218681a /drivers/net/wireless/b43 | |
parent | 461b3f2aa3c45eb2e85751b6a3b75a8dd1abd04a (diff) |
b43: pull out helpers for writing noise table
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/wa.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c index e632125cb772..daa94211f838 100644 --- a/drivers/net/wireless/b43/wa.c +++ b/drivers/net/wireless/b43/wa.c | |||
@@ -204,42 +204,43 @@ static void b43_wa_rt(struct b43_wldev *dev) /* Rotor table */ | |||
204 | b43_ofdmtab_write32(dev, B43_OFDMTAB_ROTOR, i, b43_tab_rotor[i]); | 204 | b43_ofdmtab_write32(dev, B43_OFDMTAB_ROTOR, i, b43_tab_rotor[i]); |
205 | } | 205 | } |
206 | 206 | ||
207 | static void b43_write_null_nst(struct b43_wldev *dev) | ||
208 | { | ||
209 | int i; | ||
210 | |||
211 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | ||
212 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, i, 0); | ||
213 | } | ||
214 | |||
215 | static void b43_write_nst(struct b43_wldev *dev, const u16 *nst) | ||
216 | { | ||
217 | int i; | ||
218 | |||
219 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | ||
220 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, i, nst[i]); | ||
221 | } | ||
222 | |||
207 | static void b43_wa_nst(struct b43_wldev *dev) /* Noise scale table */ | 223 | static void b43_wa_nst(struct b43_wldev *dev) /* Noise scale table */ |
208 | { | 224 | { |
209 | struct b43_phy *phy = &dev->phy; | 225 | struct b43_phy *phy = &dev->phy; |
210 | int i; | ||
211 | 226 | ||
212 | if (phy->type == B43_PHYTYPE_A) { | 227 | if (phy->type == B43_PHYTYPE_A) { |
213 | if (phy->rev <= 1) | 228 | if (phy->rev <= 1) |
214 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 229 | b43_write_null_nst(dev); |
215 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
216 | i, 0); | ||
217 | else if (phy->rev == 2) | 230 | else if (phy->rev == 2) |
218 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 231 | b43_write_nst(dev, b43_tab_noisescalea2); |
219 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
220 | i, b43_tab_noisescalea2[i]); | ||
221 | else if (phy->rev == 3) | 232 | else if (phy->rev == 3) |
222 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 233 | b43_write_nst(dev, b43_tab_noisescalea3); |
223 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
224 | i, b43_tab_noisescalea3[i]); | ||
225 | else | 234 | else |
226 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 235 | b43_write_nst(dev, b43_tab_noisescaleg3); |
227 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
228 | i, b43_tab_noisescaleg3[i]); | ||
229 | } else { | 236 | } else { |
230 | if (phy->rev >= 6) { | 237 | if (phy->rev >= 6) { |
231 | if (b43_phy_read(dev, B43_PHY_ENCORE) & B43_PHY_ENCORE_EN) | 238 | if (b43_phy_read(dev, B43_PHY_ENCORE) & B43_PHY_ENCORE_EN) |
232 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 239 | b43_write_nst(dev, b43_tab_noisescaleg3); |
233 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
234 | i, b43_tab_noisescaleg3[i]); | ||
235 | else | 240 | else |
236 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 241 | b43_write_nst(dev, b43_tab_noisescaleg2); |
237 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
238 | i, b43_tab_noisescaleg2[i]); | ||
239 | } else { | 242 | } else { |
240 | for (i = 0; i < B43_TAB_NOISESCALE_SIZE; i++) | 243 | b43_write_nst(dev, b43_tab_noisescaleg1); |
241 | b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, | ||
242 | i, b43_tab_noisescaleg1[i]); | ||
243 | } | 244 | } |
244 | } | 245 | } |
245 | } | 246 | } |