Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rafał Miłecki and committed by
John W. Linville
39e971ef ea42e71c

+15 -12
-1
drivers/net/wireless/b43/phy_common.h
··· 269 269 /* Current channel */ 270 270 struct cfg80211_chan_def *chandef; 271 271 unsigned int channel; 272 - u16 channel_freq; 273 272 enum nl80211_channel_type channel_type; 274 273 275 274 /* PHY TX errors counter. */
+1 -1
drivers/net/wireless/b43/phy_ht.c
··· 596 596 u8 target[3]; 597 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 600 int i, c; 601 601 602 602 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
+14 -10
drivers/net/wireless/b43/phy_n.c
··· 798 798 static void b43_radio_2056_setup(struct b43_wldev *dev, 799 799 const struct b43_nphy_channeltab_entry_rev3 *e) 800 800 { 801 + struct b43_phy *phy = &dev->phy; 801 802 struct ssb_sprom *sprom = dev->dev->bus_sprom; 802 803 enum ieee80211_band band = b43_current_band(dev->wl); 803 804 u16 offset; ··· 910 909 b43_radio_write(dev, offset | B2056_TX_PA_SPARE1, 0xee); 911 910 } 912 911 } else if (dev->phy.n->ipa5g_on && band == IEEE80211_BAND_5GHZ) { 913 - u16 freq = dev->phy.channel_freq; 912 + u16 freq = phy->chandef->chan->center_freq; 914 913 if (freq < 5100) { 915 914 paa_boost = 0xA; 916 915 pada_boost = 0x77; ··· 1676 1675 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICalRev3 */ 1677 1676 static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev) 1678 1677 { 1678 + struct b43_phy *phy = &dev->phy; 1679 1679 struct b43_phy_n *nphy = dev->phy.n; 1680 1680 1681 1681 u16 saved_regs_phy_rfctl[2]; ··· 1899 1897 1900 1898 /* Remember for which channel we store configuration */ 1901 1899 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) 1902 - nphy->rssical_chanspec_2G.center_freq = dev->phy.channel_freq; 1900 + nphy->rssical_chanspec_2G.center_freq = phy->chandef->chan->center_freq; 1903 1901 else 1904 - nphy->rssical_chanspec_5G.center_freq = dev->phy.channel_freq; 1902 + nphy->rssical_chanspec_5G.center_freq = phy->chandef->chan->center_freq; 1905 1903 1906 1904 /* End of calibration, restore configuration */ 1907 1905 b43_nphy_classifier(dev, 7, class); ··· 2530 2528 } 2531 2529 } 2532 2530 } else { 2533 - u16 freq = phy->channel_freq; 2531 + u16 freq = phy->chandef->chan->center_freq; 2534 2532 if ((freq >= 5180 && freq <= 5230) || 2535 2533 (freq >= 5745 && freq <= 5805)) { 2536 2534 b43_radio_write(dev, 0x7D, 0xFF); ··· 3186 3184 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrFix */ 3187 3185 static void b43_nphy_tx_power_fix(struct b43_wldev *dev) 3188 3186 { 3187 + struct b43_phy *phy = &dev->phy; 3189 3188 struct b43_phy_n *nphy = dev->phy.n; 3190 3189 struct ssb_sprom *sprom = dev->dev->bus_sprom; 3191 3190 3192 3191 u8 txpi[2], bbmult, i; 3193 3192 u16 tmp, radio_gain, dac_gain; 3194 - u16 freq = dev->phy.channel_freq; 3193 + u16 freq = phy->chandef->chan->center_freq; 3195 3194 u32 txgain; 3196 3195 /* u32 gaintbl; rev3+ */ 3197 3196 ··· 3477 3474 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlSetup */ 3478 3475 static void b43_nphy_tx_power_ctl_setup(struct b43_wldev *dev) 3479 3476 { 3477 + struct b43_phy *phy = &dev->phy; 3480 3478 struct b43_phy_n *nphy = dev->phy.n; 3481 3479 struct ssb_sprom *sprom = dev->dev->bus_sprom; 3482 3480 ··· 3487 3483 s32 num, den, pwr; 3488 3484 u32 regval[64]; 3489 3485 3490 - u16 freq = dev->phy.channel_freq; 3486 + u16 freq = phy->chandef->chan->center_freq; 3491 3487 u16 tmp; 3492 3488 u16 r; /* routing */ 3493 3489 u8 i, c; ··· 4504 4500 txcal_radio_regs[2] = b43_radio_read(dev, 0x8D); 4505 4501 txcal_radio_regs[3] = b43_radio_read(dev, 0xBC); 4506 4502 } 4507 - iqcal_chanspec->center_freq = dev->phy.channel_freq; 4503 + iqcal_chanspec->center_freq = dev->phy.chandef->chan->center_freq; 4508 4504 iqcal_chanspec->channel_type = dev->phy.channel_type; 4509 4505 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 8, table); 4510 4506 ··· 4585 4581 struct nphy_txgains target, 4586 4582 bool full, bool mphase) 4587 4583 { 4584 + struct b43_phy *phy = &dev->phy; 4588 4585 struct b43_phy_n *nphy = dev->phy.n; 4589 4586 int i; 4590 4587 int error = 0; ··· 4778 4773 nphy->txiqlocal_bestc); 4779 4774 nphy->txiqlocal_coeffsvalid = true; 4780 4775 nphy->txiqlocal_chanspec.center_freq = 4781 - dev->phy.channel_freq; 4776 + phy->chandef->chan->center_freq; 4782 4777 nphy->txiqlocal_chanspec.channel_type = 4783 4778 dev->phy.channel_type; 4784 4779 } else { ··· 4816 4811 bool equal = true; 4817 4812 4818 4813 if (!nphy->txiqlocal_coeffsvalid || 4819 - nphy->txiqlocal_chanspec.center_freq != dev->phy.channel_freq || 4814 + nphy->txiqlocal_chanspec.center_freq != dev->phy.chandef->chan->center_freq || 4820 4815 nphy->txiqlocal_chanspec.channel_type != dev->phy.channel_type) 4821 4816 return; 4822 4817 ··· 5507 5502 /* Channel is set later in common code, but we need to set it on our 5508 5503 own to let this function's subcalls work properly. */ 5509 5504 phy->channel = channel->hw_value; 5510 - phy->channel_freq = channel->center_freq; 5511 5505 5512 5506 if (b43_channel_type_is_40mhz(phy->channel_type) != 5513 5507 b43_channel_type_is_40mhz(channel_type))