aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-05-31 14:49:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:14 -0400
commit427fa00b8953b4cc428737af2b062e8ab4de3e21 (patch)
tree38d504b250a0831ea1d5a8dc439169504b844d1d /drivers/net
parentbee6d4b272ba6e668f0c12d8bb66d76e1826f406 (diff)
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/phy_common.c6
-rw-r--r--drivers/net/wireless/b43/phy_common.h3
-rw-r--r--drivers/net/wireless/b43/phy_n.c11
-rw-r--r--drivers/net/wireless/b43/tables_nphy.c2
4 files changed, 8 insertions, 14 deletions
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index e7e83835f725..2d05b5987168 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -547,12 +547,6 @@ void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on)
547} 547}
548 548
549 549
550bool 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
556bool b43_is_40mhz(struct b43_wldev *dev) 550bool b43_is_40mhz(struct b43_wldev *dev)
557{ 551{
558 return dev->phy.chandef->width == NL80211_CHAN_WIDTH_40; 552 return dev->phy.chandef->width == NL80211_CHAN_WIDTH_40;
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h
index 674422fd22e6..3912274f71e3 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -266,7 +266,6 @@ struct b43_phy {
266 /* Current channel */ 266 /* Current channel */
267 struct cfg80211_chan_def *chandef; 267 struct cfg80211_chan_def *chandef;
268 unsigned int channel; 268 unsigned int channel;
269 enum nl80211_channel_type channel_type;
270 269
271 /* PHY TX errors counter. */ 270 /* PHY TX errors counter. */
272 atomic_t txerr_cnt; 271 atomic_t txerr_cnt;
@@ -447,8 +446,6 @@ int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 shm_offset);
447 */ 446 */
448void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on); 447void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on);
449 448
450bool b43_channel_type_is_40mhz(enum nl80211_channel_type channel_type);
451
452bool b43_is_40mhz(struct b43_wldev *dev); 449bool b43_is_40mhz(struct b43_wldev *dev);
453 450
454void b43_phy_force_clock(struct b43_wldev *dev, bool force); 451void b43_phy_force_clock(struct b43_wldev *dev, bool force);
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index dc1249381275..6398c7e45ab7 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -4504,7 +4504,8 @@ static void b43_nphy_save_cal(struct b43_wldev *dev)
4504 txcal_radio_regs[3] = b43_radio_read(dev, 0xBC); 4504 txcal_radio_regs[3] = b43_radio_read(dev, 0xBC);
4505 } 4505 }
4506 iqcal_chanspec->center_freq = dev->phy.chandef->chan->center_freq; 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 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 8, table); 4509 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 8, table);
4509 4510
4510 if (nphy->hang_avoid) 4511 if (nphy->hang_avoid)
@@ -4779,7 +4780,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
4779 nphy->txiqlocal_chanspec.center_freq = 4780 nphy->txiqlocal_chanspec.center_freq =
4780 phy->chandef->chan->center_freq; 4781 phy->chandef->chan->center_freq;
4781 nphy->txiqlocal_chanspec.channel_type = 4782 nphy->txiqlocal_chanspec.channel_type =
4782 dev->phy.channel_type; 4783 cfg80211_get_chandef_type(phy->chandef);
4783 } else { 4784 } else {
4784 length = 11; 4785 length = 11;
4785 if (dev->phy.rev < 3) 4786 if (dev->phy.rev < 3)
@@ -4816,7 +4817,7 @@ static void b43_nphy_reapply_tx_cal_coeffs(struct b43_wldev *dev)
4816 4817
4817 if (!nphy->txiqlocal_coeffsvalid || 4818 if (!nphy->txiqlocal_coeffsvalid ||
4818 nphy->txiqlocal_chanspec.center_freq != dev->phy.chandef->chan->center_freq || 4819 nphy->txiqlocal_chanspec.center_freq != dev->phy.chandef->chan->center_freq ||
4819 nphy->txiqlocal_chanspec.channel_type != dev->phy.channel_type) 4820 nphy->txiqlocal_chanspec.channel_type != cfg80211_get_chandef_type(dev->phy.chandef))
4820 return; 4821 return;
4821 4822
4822 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 7, buffer); 4823 b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 7, buffer);
@@ -5441,7 +5442,7 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
5441 bool avoid = false; 5442 bool avoid = false;
5442 if (dev->phy.n->spur_avoid == B43_SPUR_AVOID_FORCE) { 5443 if (dev->phy.n->spur_avoid == B43_SPUR_AVOID_FORCE) {
5443 avoid = true; 5444 avoid = true;
5444 } else if (!b43_channel_type_is_40mhz(phy->channel_type)) { 5445 } else if (!b43_is_40mhz(dev)) {
5445 if ((ch >= 5 && ch <= 8) || ch == 13 || ch == 14) 5446 if ((ch >= 5 && ch <= 8) || ch == 13 || ch == 14)
5446 avoid = true; 5447 avoid = true;
5447 } else { /* 40MHz */ 5448 } else { /* 40MHz */
@@ -5507,9 +5508,11 @@ static int b43_nphy_set_channel(struct b43_wldev *dev,
5507 own to let this function's subcalls work properly. */ 5508 own to let this function's subcalls work properly. */
5508 phy->channel = channel->hw_value; 5509 phy->channel = channel->hw_value;
5509 5510
5511#if 0
5510 if (b43_channel_type_is_40mhz(phy->channel_type) != 5512 if (b43_channel_type_is_40mhz(phy->channel_type) !=
5511 b43_channel_type_is_40mhz(channel_type)) 5513 b43_channel_type_is_40mhz(channel_type))
5512 ; /* TODO: BMAC BW Set (channel_type) */ 5514 ; /* TODO: BMAC BW Set (channel_type) */
5515#endif
5513 5516
5514 if (channel_type == NL80211_CHAN_HT40PLUS) 5517 if (channel_type == NL80211_CHAN_HT40PLUS)
5515 b43_phy_set(dev, B43_NPHY_RXCTL, 5518 b43_phy_set(dev, B43_NPHY_RXCTL,
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index 4047c05e3807..b22171592926 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -3191,7 +3191,7 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
3191 /* Some workarounds to the workarounds... */ 3191 /* Some workarounds to the workarounds... */
3192 if (ghz5 && dev->phy.rev >= 6) { 3192 if (ghz5 && dev->phy.rev >= 6) {
3193 if (dev->phy.radio_rev == 11 && 3193 if (dev->phy.radio_rev == 11 &&
3194 !b43_channel_type_is_40mhz(dev->phy.channel_type)) 3194 !b43_is_40mhz(dev))
3195 e->cliplo_gain = 0x2d; 3195 e->cliplo_gain = 0x2d;
3196 } else if (!ghz5 && dev->phy.rev >= 5) { 3196 } else if (!ghz5 && dev->phy.rev >= 5) {
3197 static const int gain_data[] = {0x0062, 0x0064, 0x006a, 0x106a, 3197 static const int gain_data[] = {0x0062, 0x0064, 0x006a, 0x106a,