aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-05-31 14:49:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:13 -0400
commit39e971ef1b0ced72b6504429296551bbf14ac965 (patch)
treeaac28679e8833343d1b706663c8c849248a6877e
parentea42e71c79068daa8bfd04f5e3c4a19b5e62f7da (diff)
b43: PHY: drop own channel_freq (get it from chandef when needed)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43/phy_common.h1
-rw-r--r--drivers/net/wireless/b43/phy_ht.c2
-rw-r--r--drivers/net/wireless/b43/phy_n.c24
3 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h
index 56dfe7aa50a7..399082026b03 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -269,7 +269,6 @@ struct b43_phy {
269 /* Current channel */ 269 /* Current channel */
270 struct cfg80211_chan_def *chandef; 270 struct cfg80211_chan_def *chandef;
271 unsigned int channel; 271 unsigned int channel;
272 u16 channel_freq;
273 enum nl80211_channel_type channel_type; 272 enum nl80211_channel_type channel_type;
274 273
275 /* PHY TX errors counter. */ 274 /* PHY TX errors counter. */
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index 5d6833f18498..f2974c6b1c01 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -596,7 +596,7 @@ static void b43_phy_ht_tx_power_ctl_setup(struct b43_wldev *dev)
596 u8 target[3]; 596 u8 target[3];
597 s16 a1[3], b0[3], b1[3]; 597 s16 a1[3], b0[3], b1[3];
598 598
599 u16 freq = dev->phy.channel_freq; 599 u16 freq = dev->phy.chandef->chan->center_freq;
600 int i, c; 600 int i, c;
601 601
602 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { 602 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 86569f6a8705..dc62f024f776 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -798,6 +798,7 @@ static void b43_chantab_radio_2056_upload(struct b43_wldev *dev,
798static void b43_radio_2056_setup(struct b43_wldev *dev, 798static void b43_radio_2056_setup(struct b43_wldev *dev,
799 const struct b43_nphy_channeltab_entry_rev3 *e) 799 const struct b43_nphy_channeltab_entry_rev3 *e)
800{ 800{
801 struct b43_phy *phy = &dev->phy;
801 struct ssb_sprom *sprom = dev->dev->bus_sprom; 802 struct ssb_sprom *sprom = dev->dev->bus_sprom;
802 enum ieee80211_band band = b43_current_band(dev->wl); 803 enum ieee80211_band band = b43_current_band(dev->wl);
803 u16 offset; 804 u16 offset;
@@ -909,7 +910,7 @@ static void b43_radio_2056_setup(struct b43_wldev *dev,
909 b43_radio_write(dev, offset | B2056_TX_PA_SPARE1, 0xee); 910 b43_radio_write(dev, offset | B2056_TX_PA_SPARE1, 0xee);
910 } 911 }
911 } else if (dev->phy.n->ipa5g_on && band == IEEE80211_BAND_5GHZ) { 912 } else if (dev->phy.n->ipa5g_on && band == IEEE80211_BAND_5GHZ) {
912 u16 freq = dev->phy.channel_freq; 913 u16 freq = phy->chandef->chan->center_freq;
913 if (freq < 5100) { 914 if (freq < 5100) {
914 paa_boost = 0xA; 915 paa_boost = 0xA;
915 pada_boost = 0x77; 916 pada_boost = 0x77;
@@ -1675,6 +1676,7 @@ static int b43_nphy_poll_rssi(struct b43_wldev *dev, enum n_rssi_type rssi_type,
1675/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICalRev3 */ 1676/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICalRev3 */
1676static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev) 1677static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
1677{ 1678{
1679 struct b43_phy *phy = &dev->phy;
1678 struct b43_phy_n *nphy = dev->phy.n; 1680 struct b43_phy_n *nphy = dev->phy.n;
1679 1681
1680 u16 saved_regs_phy_rfctl[2]; 1682 u16 saved_regs_phy_rfctl[2];
@@ -1897,9 +1899,9 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
1897 1899
1898 /* Remember for which channel we store configuration */ 1900 /* Remember for which channel we store configuration */
1899 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) 1901 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
1900 nphy->rssical_chanspec_2G.center_freq = dev->phy.channel_freq; 1902 nphy->rssical_chanspec_2G.center_freq = phy->chandef->chan->center_freq;
1901 else 1903 else
1902 nphy->rssical_chanspec_5G.center_freq = dev->phy.channel_freq; 1904 nphy->rssical_chanspec_5G.center_freq = phy->chandef->chan->center_freq;
1903 1905
1904 /* End of calibration, restore configuration */ 1906 /* End of calibration, restore configuration */
1905 b43_nphy_classifier(dev, 7, class); 1907 b43_nphy_classifier(dev, 7, class);
@@ -2528,7 +2530,7 @@ static void b43_nphy_workarounds_rev7plus(struct b43_wldev *dev)
2528 } 2530 }
2529 } 2531 }
2530 } else { 2532 } else {
2531 u16 freq = phy->channel_freq; 2533 u16 freq = phy->chandef->chan->center_freq;
2532 if ((freq >= 5180 && freq <= 5230) || 2534 if ((freq >= 5180 && freq <= 5230) ||
2533 (freq >= 5745 && freq <= 5805)) { 2535 (freq >= 5745 && freq <= 5805)) {
2534 b43_radio_write(dev, 0x7D, 0xFF); 2536 b43_radio_write(dev, 0x7D, 0xFF);
@@ -3184,12 +3186,13 @@ static void b43_nphy_tx_power_ctrl(struct b43_wldev *dev, bool enable)
3184/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrFix */ 3186/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrFix */
3185static void b43_nphy_tx_power_fix(struct b43_wldev *dev) 3187static void b43_nphy_tx_power_fix(struct b43_wldev *dev)
3186{ 3188{
3189 struct b43_phy *phy = &dev->phy;
3187 struct b43_phy_n *nphy = dev->phy.n; 3190 struct b43_phy_n *nphy = dev->phy.n;
3188 struct ssb_sprom *sprom = dev->dev->bus_sprom; 3191 struct ssb_sprom *sprom = dev->dev->bus_sprom;
3189 3192
3190 u8 txpi[2], bbmult, i; 3193 u8 txpi[2], bbmult, i;
3191 u16 tmp, radio_gain, dac_gain; 3194 u16 tmp, radio_gain, dac_gain;
3192 u16 freq = dev->phy.channel_freq; 3195 u16 freq = phy->chandef->chan->center_freq;
3193 u32 txgain; 3196 u32 txgain;
3194 /* u32 gaintbl; rev3+ */ 3197 /* u32 gaintbl; rev3+ */
3195 3198
@@ -3474,6 +3477,7 @@ static void b43_nphy_tx_prepare_adjusted_power_table(struct b43_wldev *dev)
3474/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlSetup */ 3477/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlSetup */
3475static void b43_nphy_tx_power_ctl_setup(struct b43_wldev *dev) 3478static void b43_nphy_tx_power_ctl_setup(struct b43_wldev *dev)
3476{ 3479{
3480 struct b43_phy *phy = &dev->phy;
3477 struct b43_phy_n *nphy = dev->phy.n; 3481 struct b43_phy_n *nphy = dev->phy.n;
3478 struct ssb_sprom *sprom = dev->dev->bus_sprom; 3482 struct ssb_sprom *sprom = dev->dev->bus_sprom;
3479 3483
@@ -3483,7 +3487,7 @@ static void b43_nphy_tx_power_ctl_setup(struct b43_wldev *dev)
3483 s32 num, den, pwr; 3487 s32 num, den, pwr;
3484 u32 regval[64]; 3488 u32 regval[64];
3485 3489
3486 u16 freq = dev->phy.channel_freq; 3490 u16 freq = phy->chandef->chan->center_freq;
3487 u16 tmp; 3491 u16 tmp;
3488 u16 r; /* routing */ 3492 u16 r; /* routing */
3489 u8 i, c; 3493 u8 i, c;
@@ -4500,7 +4504,7 @@ static void b43_nphy_save_cal(struct b43_wldev *dev)
4500 txcal_radio_regs[2] = b43_radio_read(dev, 0x8D); 4504 txcal_radio_regs[2] = b43_radio_read(dev, 0x8D);
4501 txcal_radio_regs[3] = b43_radio_read(dev, 0xBC); 4505 txcal_radio_regs[3] = b43_radio_read(dev, 0xBC);
4502 } 4506 }
4503 iqcal_chanspec->center_freq = dev->phy.channel_freq; 4507 iqcal_chanspec->center_freq = dev->phy.chandef->chan->center_freq;
4504 iqcal_chanspec->channel_type = dev->phy.channel_type; 4508 iqcal_chanspec->channel_type = dev->phy.channel_type;
4505 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 8, table); 4509 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 8, table);
4506 4510
@@ -4581,6 +4585,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
4581 struct nphy_txgains target, 4585 struct nphy_txgains target,
4582 bool full, bool mphase) 4586 bool full, bool mphase)
4583{ 4587{
4588 struct b43_phy *phy = &dev->phy;
4584 struct b43_phy_n *nphy = dev->phy.n; 4589 struct b43_phy_n *nphy = dev->phy.n;
4585 int i; 4590 int i;
4586 int error = 0; 4591 int error = 0;
@@ -4773,7 +4778,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
4773 nphy->txiqlocal_bestc); 4778 nphy->txiqlocal_bestc);
4774 nphy->txiqlocal_coeffsvalid = true; 4779 nphy->txiqlocal_coeffsvalid = true;
4775 nphy->txiqlocal_chanspec.center_freq = 4780 nphy->txiqlocal_chanspec.center_freq =
4776 dev->phy.channel_freq; 4781 phy->chandef->chan->center_freq;
4777 nphy->txiqlocal_chanspec.channel_type = 4782 nphy->txiqlocal_chanspec.channel_type =
4778 dev->phy.channel_type; 4783 dev->phy.channel_type;
4779 } else { 4784 } else {
@@ -4811,7 +4816,7 @@ static void b43_nphy_reapply_tx_cal_coeffs(struct b43_wldev *dev)
4811 bool equal = true; 4816 bool equal = true;
4812 4817
4813 if (!nphy->txiqlocal_coeffsvalid || 4818 if (!nphy->txiqlocal_coeffsvalid ||
4814 nphy->txiqlocal_chanspec.center_freq != dev->phy.channel_freq || 4819 nphy->txiqlocal_chanspec.center_freq != dev->phy.chandef->chan->center_freq ||
4815 nphy->txiqlocal_chanspec.channel_type != dev->phy.channel_type) 4820 nphy->txiqlocal_chanspec.channel_type != dev->phy.channel_type)
4816 return; 4821 return;
4817 4822
@@ -5502,7 +5507,6 @@ static int b43_nphy_set_channel(struct b43_wldev *dev,
5502 /* Channel is set later in common code, but we need to set it on our 5507 /* Channel is set later in common code, but we need to set it on our
5503 own to let this function's subcalls work properly. */ 5508 own to let this function's subcalls work properly. */
5504 phy->channel = channel->hw_value; 5509 phy->channel = channel->hw_value;
5505 phy->channel_freq = channel->center_freq;
5506 5510
5507 if (b43_channel_type_is_40mhz(phy->channel_type) != 5511 if (b43_channel_type_is_40mhz(phy->channel_type) !=
5508 b43_channel_type_is_40mhz(channel_type)) 5512 b43_channel_type_is_40mhz(channel_type))