diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/phy.c')
-rw-r--r-- | drivers/net/wireless/ath5k/phy.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c index 8b576b314cf5..248c0f545f24 100644 --- a/drivers/net/wireless/ath5k/phy.c +++ b/drivers/net/wireless/ath5k/phy.c | |||
@@ -1124,7 +1124,7 @@ static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah, | |||
1124 | rf = ah->ah_rf_banks; | 1124 | rf = ah->ah_rf_banks; |
1125 | 1125 | ||
1126 | if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_2112A | 1126 | if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_2112A |
1127 | && !test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode)){ | 1127 | && !test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode)) { |
1128 | rf_ini = rfregs_2112a; | 1128 | rf_ini = rfregs_2112a; |
1129 | rf_size = ARRAY_SIZE(rfregs_5112a); | 1129 | rf_size = ARRAY_SIZE(rfregs_5112a); |
1130 | if (mode < 2) { | 1130 | if (mode < 2) { |
@@ -1445,9 +1445,10 @@ static u32 ath5k_hw_rf5110_chan2athchan(struct ieee80211_channel *channel) | |||
1445 | * newer chipsets like the AR5212A who have a completely | 1445 | * newer chipsets like the AR5212A who have a completely |
1446 | * different RF/PHY part. | 1446 | * different RF/PHY part. |
1447 | */ | 1447 | */ |
1448 | athchan = (ath5k_hw_bitswap((ieee80211_frequency_to_channel(channel->center_freq) - 24) / 2, 5) << 1) | | 1448 | athchan = (ath5k_hw_bitswap( |
1449 | (1 << 6) | 0x1; | 1449 | (ieee80211_frequency_to_channel( |
1450 | 1450 | channel->center_freq) - 24) / 2, 5) | |
1451 | << 1) | (1 << 6) | 0x1; | ||
1451 | return athchan; | 1452 | return athchan; |
1452 | } | 1453 | } |
1453 | 1454 | ||
@@ -1506,7 +1507,8 @@ static int ath5k_hw_rf5111_channel(struct ath5k_hw *ah, | |||
1506 | struct ieee80211_channel *channel) | 1507 | struct ieee80211_channel *channel) |
1507 | { | 1508 | { |
1508 | struct ath5k_athchan_2ghz ath5k_channel_2ghz; | 1509 | struct ath5k_athchan_2ghz ath5k_channel_2ghz; |
1509 | unsigned int ath5k_channel = ieee80211_frequency_to_channel(channel->center_freq); | 1510 | unsigned int ath5k_channel = |
1511 | ieee80211_frequency_to_channel(channel->center_freq); | ||
1510 | u32 data0, data1, clock; | 1512 | u32 data0, data1, clock; |
1511 | int ret; | 1513 | int ret; |
1512 | 1514 | ||
@@ -1517,8 +1519,9 @@ static int ath5k_hw_rf5111_channel(struct ath5k_hw *ah, | |||
1517 | 1519 | ||
1518 | if (channel->hw_value & CHANNEL_2GHZ) { | 1520 | if (channel->hw_value & CHANNEL_2GHZ) { |
1519 | /* Map 2GHz channel to 5GHz Atheros channel ID */ | 1521 | /* Map 2GHz channel to 5GHz Atheros channel ID */ |
1520 | ret = ath5k_hw_rf5111_chan2athchan(ieee80211_frequency_to_channel(channel->center_freq), | 1522 | ret = ath5k_hw_rf5111_chan2athchan( |
1521 | &ath5k_channel_2ghz); | 1523 | ieee80211_frequency_to_channel(channel->center_freq), |
1524 | &ath5k_channel_2ghz); | ||
1522 | if (ret) | 1525 | if (ret) |
1523 | return ret; | 1526 | return ret; |
1524 | 1527 | ||
@@ -1599,19 +1602,17 @@ static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, | |||
1599 | int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) | 1602 | int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) |
1600 | { | 1603 | { |
1601 | int ret; | 1604 | int ret; |
1602 | |||
1603 | /* | 1605 | /* |
1604 | * Check bounds supported by the PHY | 1606 | * Check bounds supported by the PHY (we don't care about regultory |
1605 | * (don't care about regulation restrictions at this point) | 1607 | * restrictions at this point). Note: hw_value already has the band |
1606 | */ | 1608 | * (CHANNEL_2GHZ, or CHANNEL_5GHZ) so we inform ath5k_channel_ok() |
1607 | if ((channel->center_freq < ah->ah_capabilities.cap_range.range_2ghz_min || | 1609 | * of the band by that */ |
1608 | channel->center_freq > ah->ah_capabilities.cap_range.range_2ghz_max) && | 1610 | if (!ath5k_channel_ok(ah, channel->center_freq, channel->hw_value)) { |
1609 | (channel->center_freq < ah->ah_capabilities.cap_range.range_5ghz_min || | ||
1610 | channel->center_freq > ah->ah_capabilities.cap_range.range_5ghz_max)) { | ||
1611 | ATH5K_ERR(ah->ah_sc, | 1611 | ATH5K_ERR(ah->ah_sc, |
1612 | "channel out of supported range (%u MHz)\n", | 1612 | "channel frequency (%u MHz) out of supported " |
1613 | "band range\n", | ||
1613 | channel->center_freq); | 1614 | channel->center_freq); |
1614 | return -EINVAL; | 1615 | return -EINVAL; |
1615 | } | 1616 | } |
1616 | 1617 | ||
1617 | /* | 1618 | /* |