diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-07-17 13:31:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-07-18 13:45:25 -0400 |
commit | c9325e2f2435d93117e9336d72754b68abda26d4 (patch) | |
tree | 97a839c40186a5d9eb0c7d65c905607d335660e0 /drivers/net/wireless/b43 | |
parent | ef0d635ed147047afd97bb86510fb7a889fab709 (diff) |
b43: N-PHY: set band on every channel switch
Seems to be required by some hardware, wl does it every time.
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')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_n.h | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 2c5583231d2f..ef1acaec7027 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -6058,23 +6058,23 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev, | |||
6058 | struct b43_phy *phy = &dev->phy; | 6058 | struct b43_phy *phy = &dev->phy; |
6059 | struct b43_phy_n *nphy = dev->phy.n; | 6059 | struct b43_phy_n *nphy = dev->phy.n; |
6060 | int ch = new_channel->hw_value; | 6060 | int ch = new_channel->hw_value; |
6061 | |||
6062 | u16 old_band_5ghz; | ||
6063 | u16 tmp16; | 6061 | u16 tmp16; |
6064 | 6062 | ||
6065 | old_band_5ghz = | 6063 | if (new_channel->band == IEEE80211_BAND_5GHZ) { |
6066 | b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; | ||
6067 | if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { | ||
6068 | tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); | 6064 | tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); |
6069 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); | 6065 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); |
6070 | b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); | 6066 | /* Put BPHY in the reset */ |
6067 | b43_phy_set(dev, B43_PHY_B_BBCFG, | ||
6068 | B43_PHY_B_BBCFG_RSTCCA | B43_PHY_B_BBCFG_RSTRX); | ||
6071 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); | 6069 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); |
6072 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); | 6070 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); |
6073 | } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { | 6071 | } else if (new_channel->band == IEEE80211_BAND_2GHZ) { |
6074 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); | 6072 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); |
6075 | tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); | 6073 | tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); |
6076 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); | 6074 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); |
6077 | b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF); | 6075 | /* Take BPHY out of the reset */ |
6076 | b43_phy_mask(dev, B43_PHY_B_BBCFG, | ||
6077 | (u16)~(B43_PHY_B_BBCFG_RSTCCA | B43_PHY_B_BBCFG_RSTRX)); | ||
6078 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); | 6078 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); |
6079 | } | 6079 | } |
6080 | 6080 | ||
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h index 474bf758295d..30bec815b969 100644 --- a/drivers/net/wireless/b43/phy_n.h +++ b/drivers/net/wireless/b43/phy_n.h | |||
@@ -869,6 +869,8 @@ | |||
869 | #define B43_NPHY_REV7_RF_CTL_OVER6 B43_PHY_N(0x347) | 869 | #define B43_NPHY_REV7_RF_CTL_OVER6 B43_PHY_N(0x347) |
870 | 870 | ||
871 | #define B43_PHY_B_BBCFG B43_PHY_N_BMODE(0x001) /* BB config */ | 871 | #define B43_PHY_B_BBCFG B43_PHY_N_BMODE(0x001) /* BB config */ |
872 | #define B43_PHY_B_BBCFG_RSTCCA 0x4000 /* Reset CCA */ | ||
873 | #define B43_PHY_B_BBCFG_RSTRX 0x8000 /* Reset RX */ | ||
872 | #define B43_PHY_B_TEST B43_PHY_N_BMODE(0x00A) | 874 | #define B43_PHY_B_TEST B43_PHY_N_BMODE(0x00A) |
873 | 875 | ||
874 | struct b43_wldev; | 876 | struct b43_wldev; |