diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2010-09-17 17:09:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-21 11:05:25 -0400 |
commit | 735761108f435a30bbabb5254fc5a8e17b99f2a1 (patch) | |
tree | 750f19fd393f33e9b5577d4b035d4c19521e13ad /drivers/net | |
parent | 78ec789bd397249a9bb412ca91bd360079e7b446 (diff) |
carl9170: reinit phy after HT settings have changed
The driver has a set of different initvals for 20 MHz
vs dynamic HT2040 operation. Because we can't change
some of the registers "in-flight", the driver needs to
perform a warm reset.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/carl9170.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/phy.c | 25 |
2 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h index d43675aca0bb..d7c5482d74ce 100644 --- a/drivers/net/wireless/ath/carl9170/carl9170.h +++ b/drivers/net/wireless/ath/carl9170/carl9170.h | |||
@@ -325,6 +325,7 @@ struct ar9170 { | |||
325 | unsigned int chan_fail; | 325 | unsigned int chan_fail; |
326 | unsigned int total_chan_fail; | 326 | unsigned int total_chan_fail; |
327 | u8 heavy_clip; | 327 | u8 heavy_clip; |
328 | u8 ht_settings; | ||
328 | 329 | ||
329 | /* power calibration data */ | 330 | /* power calibration data */ |
330 | u8 power_5G_leg[4]; | 331 | u8 power_5G_leg[4]; |
diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c index fa349b86ea62..89deca37a988 100644 --- a/drivers/net/wireless/ath/carl9170/phy.c +++ b/drivers/net/wireless/ath/carl9170/phy.c | |||
@@ -1610,7 +1610,7 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, | |||
1610 | const struct carl9170_phy_freq_params *freqpar; | 1610 | const struct carl9170_phy_freq_params *freqpar; |
1611 | struct carl9170_rf_init_result rf_res; | 1611 | struct carl9170_rf_init_result rf_res; |
1612 | struct carl9170_rf_init rf; | 1612 | struct carl9170_rf_init rf; |
1613 | u32 cmd, tmp, offs = 0; | 1613 | u32 cmd, tmp, offs = 0, new_ht = 0; |
1614 | int err; | 1614 | int err; |
1615 | enum carl9170_bw bw; | 1615 | enum carl9170_bw bw; |
1616 | bool warm_reset; | 1616 | bool warm_reset; |
@@ -1618,12 +1618,19 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, | |||
1618 | 1618 | ||
1619 | bw = nl80211_to_carl(_bw); | 1619 | bw = nl80211_to_carl(_bw); |
1620 | 1620 | ||
1621 | if (conf_is_ht(&ar->hw->conf)) | ||
1622 | new_ht |= CARL9170FW_PHY_HT_ENABLE; | ||
1623 | |||
1624 | if (conf_is_ht40(&ar->hw->conf)) | ||
1625 | new_ht |= CARL9170FW_PHY_HT_DYN2040; | ||
1626 | |||
1621 | /* may be NULL at first setup */ | 1627 | /* may be NULL at first setup */ |
1622 | if (ar->channel) { | 1628 | if (ar->channel) { |
1623 | old_channel = ar->channel; | 1629 | old_channel = ar->channel; |
1624 | warm_reset = (old_channel->band != channel->band) || | 1630 | warm_reset = (old_channel->band != channel->band) || |
1625 | (old_channel->center_freq == | 1631 | (old_channel->center_freq == |
1626 | channel->center_freq); | 1632 | channel->center_freq) || |
1633 | (ar->ht_settings != new_ht); | ||
1627 | 1634 | ||
1628 | ar->channel = NULL; | 1635 | ar->channel = NULL; |
1629 | } else { | 1636 | } else { |
@@ -1724,16 +1731,9 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, | |||
1724 | 1731 | ||
1725 | freqpar = carl9170_get_hw_dyn_params(channel, bw); | 1732 | freqpar = carl9170_get_hw_dyn_params(channel, bw); |
1726 | 1733 | ||
1727 | rf.ht_settings = 0; | 1734 | rf.ht_settings = new_ht; |
1728 | if (conf_is_ht(&ar->hw->conf)) { | 1735 | if (conf_is_ht40(&ar->hw->conf)) |
1729 | rf.ht_settings |= CARL9170FW_PHY_HT_ENABLE; | 1736 | SET_VAL(CARL9170FW_PHY_HT_EXT_CHAN_OFF, rf.ht_settings, offs); |
1730 | |||
1731 | if (conf_is_ht40(&ar->hw->conf)) { | ||
1732 | rf.ht_settings |= CARL9170FW_PHY_HT_DYN2040; | ||
1733 | SET_VAL(CARL9170FW_PHY_HT_EXT_CHAN_OFF, | ||
1734 | rf.ht_settings, offs); | ||
1735 | } | ||
1736 | } | ||
1737 | 1737 | ||
1738 | rf.freq = cpu_to_le32(channel->center_freq * 1000); | 1738 | rf.freq = cpu_to_le32(channel->center_freq * 1000); |
1739 | rf.delta_slope_coeff_exp = cpu_to_le32(freqpar->coeff_exp); | 1739 | rf.delta_slope_coeff_exp = cpu_to_le32(freqpar->coeff_exp); |
@@ -1805,5 +1805,6 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, | |||
1805 | ar->ps.off_override &= ~PS_OFF_5GHZ; | 1805 | ar->ps.off_override &= ~PS_OFF_5GHZ; |
1806 | 1806 | ||
1807 | ar->channel = channel; | 1807 | ar->channel = channel; |
1808 | ar->ht_settings = new_ht; | ||
1808 | return 0; | 1809 | return 0; |
1809 | } | 1810 | } |