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

b43: PHY: drop channel_type (we can get this info from chandef)

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
427fa00b bee6d4b2

+8 -14
-6
drivers/net/wireless/b43/phy_common.c
··· 547 547 } 548 548 549 549 550 - bool b43_channel_type_is_40mhz(enum nl80211_channel_type channel_type) 551 - { 552 - return (channel_type == NL80211_CHAN_HT40MINUS || 553 - channel_type == NL80211_CHAN_HT40PLUS); 554 - } 555 - 556 550 bool b43_is_40mhz(struct b43_wldev *dev) 557 551 { 558 552 return dev->phy.chandef->width == NL80211_CHAN_WIDTH_40;
-3
drivers/net/wireless/b43/phy_common.h
··· 266 266 /* Current channel */ 267 267 struct cfg80211_chan_def *chandef; 268 268 unsigned int channel; 269 - enum nl80211_channel_type channel_type; 270 269 271 270 /* PHY TX errors counter. */ 272 271 atomic_t txerr_cnt; ··· 445 446 * for struct b43_phy_operations. 446 447 */ 447 448 void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on); 448 - 449 - bool b43_channel_type_is_40mhz(enum nl80211_channel_type channel_type); 450 449 451 450 bool b43_is_40mhz(struct b43_wldev *dev); 452 451
+7 -4
drivers/net/wireless/b43/phy_n.c
··· 4504 4504 txcal_radio_regs[3] = b43_radio_read(dev, 0xBC); 4505 4505 } 4506 4506 iqcal_chanspec->center_freq = dev->phy.chandef->chan->center_freq; 4507 - iqcal_chanspec->channel_type = dev->phy.channel_type; 4507 + iqcal_chanspec->channel_type = 4508 + cfg80211_get_chandef_type(dev->phy.chandef); 4508 4509 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 8, table); 4509 4510 4510 4511 if (nphy->hang_avoid) ··· 4780 4779 nphy->txiqlocal_chanspec.center_freq = 4781 4780 phy->chandef->chan->center_freq; 4782 4781 nphy->txiqlocal_chanspec.channel_type = 4783 - dev->phy.channel_type; 4782 + cfg80211_get_chandef_type(phy->chandef); 4784 4783 } else { 4785 4784 length = 11; 4786 4785 if (dev->phy.rev < 3) ··· 4817 4816 4818 4817 if (!nphy->txiqlocal_coeffsvalid || 4819 4818 nphy->txiqlocal_chanspec.center_freq != dev->phy.chandef->chan->center_freq || 4820 - nphy->txiqlocal_chanspec.channel_type != dev->phy.channel_type) 4819 + nphy->txiqlocal_chanspec.channel_type != cfg80211_get_chandef_type(dev->phy.chandef)) 4821 4820 return; 4822 4821 4823 4822 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 7, buffer); ··· 5442 5441 bool avoid = false; 5443 5442 if (dev->phy.n->spur_avoid == B43_SPUR_AVOID_FORCE) { 5444 5443 avoid = true; 5445 - } else if (!b43_channel_type_is_40mhz(phy->channel_type)) { 5444 + } else if (!b43_is_40mhz(dev)) { 5446 5445 if ((ch >= 5 && ch <= 8) || ch == 13 || ch == 14) 5447 5446 avoid = true; 5448 5447 } else { /* 40MHz */ ··· 5508 5507 own to let this function's subcalls work properly. */ 5509 5508 phy->channel = channel->hw_value; 5510 5509 5510 + #if 0 5511 5511 if (b43_channel_type_is_40mhz(phy->channel_type) != 5512 5512 b43_channel_type_is_40mhz(channel_type)) 5513 5513 ; /* TODO: BMAC BW Set (channel_type) */ 5514 + #endif 5514 5515 5515 5516 if (channel_type == NL80211_CHAN_HT40PLUS) 5516 5517 b43_phy_set(dev, B43_NPHY_RXCTL,
+1 -1
drivers/net/wireless/b43/tables_nphy.c
··· 3191 3191 /* Some workarounds to the workarounds... */ 3192 3192 if (ghz5 && dev->phy.rev >= 6) { 3193 3193 if (dev->phy.radio_rev == 11 && 3194 - !b43_channel_type_is_40mhz(dev->phy.channel_type)) 3194 + !b43_is_40mhz(dev)) 3195 3195 e->cliplo_gain = 0x2d; 3196 3196 } else if (!ghz5 && dev->phy.rev >= 5) { 3197 3197 static const int gain_data[] = {0x0062, 0x0064, 0x006a, 0x106a,