diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-10-10 21:11:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-11 15:04:25 -0400 |
commit | 087de74ae512fe31894c1556d5f8d5a126322de7 (patch) | |
tree | 65066c7f543bc90703bc9ae1d22a08b8b0577979 /drivers/net/wireless/b43/phy_n.c | |
parent | e5c407f970ea2977600eb54cf4cc8a67a44fefeb (diff) |
b43: N-PHY: fix logic in band switching
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_n.c')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 789d21c54139..19582ba20598 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -3337,17 +3337,18 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev, | |||
3337 | struct b43_phy *phy = &dev->phy; | 3337 | struct b43_phy *phy = &dev->phy; |
3338 | struct b43_phy_n *nphy = dev->phy.n; | 3338 | struct b43_phy_n *nphy = dev->phy.n; |
3339 | 3339 | ||
3340 | u16 tmp; | 3340 | u16 old_band_5ghz; |
3341 | u32 tmp32; | 3341 | u32 tmp32; |
3342 | 3342 | ||
3343 | tmp = b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; | 3343 | old_band_5ghz = |
3344 | if (new_channel->band == IEEE80211_BAND_5GHZ && tmp == 0) { | 3344 | b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; |
3345 | if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { | ||
3345 | tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); | 3346 | tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); |
3346 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); | 3347 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); |
3347 | b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); | 3348 | b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); |
3348 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); | 3349 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); |
3349 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); | 3350 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); |
3350 | } else if (new_channel->band == IEEE80211_BAND_5GHZ) { | 3351 | } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { |
3351 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); | 3352 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); |
3352 | tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); | 3353 | tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); |
3353 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); | 3354 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); |