diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-03-07 10:47:16 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-13 14:27:46 -0400 |
commit | b372afaed5c1392dd6be3bbfea15a411d7ceb54d (patch) | |
tree | e6c677d4bfb6584f94bc83718a3d03b444481140 /drivers/net/wireless/b43/phy_ht.c | |
parent | 476069224d3584692563a571768cf3ccf2fee8e0 (diff) |
b43: HT-PHY: add classifier control function
After comparing operations on reg 0xB on N and HT it seems to be the
same register with similar ops. Implement them for HT-PHY.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/phy_ht.c')
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index df07c83dec89..05790fa81bc1 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c | |||
@@ -157,6 +157,22 @@ static void b43_radio_2059_init(struct b43_wldev *dev) | |||
157 | * Various PHY ops | 157 | * Various PHY ops |
158 | **************************************************/ | 158 | **************************************************/ |
159 | 159 | ||
160 | static u16 b43_phy_ht_classifier(struct b43_wldev *dev, u16 mask, u16 val) | ||
161 | { | ||
162 | u16 tmp; | ||
163 | u16 allowed = B43_PHY_HT_CLASS_CTL_CCK_EN | | ||
164 | B43_PHY_HT_CLASS_CTL_OFDM_EN | | ||
165 | B43_PHY_HT_CLASS_CTL_WAITED_EN; | ||
166 | |||
167 | tmp = b43_phy_read(dev, B43_PHY_HT_CLASS_CTL); | ||
168 | tmp &= allowed; | ||
169 | tmp &= ~mask; | ||
170 | tmp |= (val & mask); | ||
171 | b43_phy_maskset(dev, B43_PHY_HT_CLASS_CTL, ~allowed, tmp); | ||
172 | |||
173 | return tmp; | ||
174 | } | ||
175 | |||
160 | static void b43_phy_ht_zero_extg(struct b43_wldev *dev) | 176 | static void b43_phy_ht_zero_extg(struct b43_wldev *dev) |
161 | { | 177 | { |
162 | u8 i, j; | 178 | u8 i, j; |
@@ -264,7 +280,15 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev, | |||
264 | b43_phy_write(dev, B43_PHY_HT_BW5, e->bw5); | 280 | b43_phy_write(dev, B43_PHY_HT_BW5, e->bw5); |
265 | b43_phy_write(dev, B43_PHY_HT_BW6, e->bw6); | 281 | b43_phy_write(dev, B43_PHY_HT_BW6, e->bw6); |
266 | 282 | ||
267 | /* TODO: some ops on PHY regs 0x0B0 and 0xC0A */ | 283 | if (new_channel->hw_value == 14) { |
284 | b43_phy_ht_classifier(dev, B43_PHY_HT_CLASS_CTL_OFDM_EN, 0); | ||
285 | b43_phy_set(dev, B43_PHY_HT_TEST, 0x0800); | ||
286 | } else { | ||
287 | b43_phy_ht_classifier(dev, B43_PHY_HT_CLASS_CTL_OFDM_EN, | ||
288 | B43_PHY_HT_CLASS_CTL_OFDM_EN); | ||
289 | if (new_channel->band == IEEE80211_BAND_2GHZ) | ||
290 | b43_phy_mask(dev, B43_PHY_HT_TEST, ~0x840); | ||
291 | } | ||
268 | 292 | ||
269 | /* TODO: separated function? */ | 293 | /* TODO: separated function? */ |
270 | for (i = 0; i < 3; i++) { | 294 | for (i = 0; i < 3; i++) { |
@@ -376,8 +400,11 @@ static int b43_phy_ht_op_init(struct b43_wldev *dev) | |||
376 | if (0) /* TODO: condition */ | 400 | if (0) /* TODO: condition */ |
377 | ; /* TODO: PHY op on reg 0x217 */ | 401 | ; /* TODO: PHY op on reg 0x217 */ |
378 | 402 | ||
379 | b43_phy_read(dev, 0xb0); /* TODO: what for? */ | 403 | if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) |
380 | b43_phy_set(dev, 0xb0, 0x1); | 404 | b43_phy_ht_classifier(dev, B43_PHY_HT_CLASS_CTL_CCK_EN, 0); |
405 | else | ||
406 | b43_phy_ht_classifier(dev, B43_PHY_HT_CLASS_CTL_CCK_EN, | ||
407 | B43_PHY_HT_CLASS_CTL_CCK_EN); | ||
381 | 408 | ||
382 | b43_phy_set(dev, 0xb1, 0x91); | 409 | b43_phy_set(dev, 0xb1, 0x91); |
383 | b43_phy_write(dev, 0x32f, 0x0003); | 410 | b43_phy_write(dev, 0x32f, 0x0003); |
@@ -456,9 +483,8 @@ static int b43_phy_ht_op_init(struct b43_wldev *dev) | |||
456 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RX2TX); | 483 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RX2TX); |
457 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RST2RX); | 484 | b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RST2RX); |
458 | 485 | ||
459 | /* TODO: PHY op on reg 0xb0 */ | ||
460 | |||
461 | /* TODO: Should we restore it? Or store it in global PHY info? */ | 486 | /* TODO: Should we restore it? Or store it in global PHY info? */ |
487 | b43_phy_ht_classifier(dev, 0, 0); | ||
462 | b43_phy_ht_read_clip_detection(dev, clip_state); | 488 | b43_phy_ht_read_clip_detection(dev, clip_state); |
463 | 489 | ||
464 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 490 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |