summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/phy.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-02-03 21:51:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:37 -0500
commit400ec45a02b2a9ef75c26c490ba80801d19b7e7b (patch)
tree46e284462d150443c173519be9b7e680792f18e7 /drivers/net/wireless/ath5k/phy.c
parentd8ee398d183df36083e41e9162b0cf014f38f482 (diff)
downloadblackbird-op-linux-400ec45a02b2a9ef75c26c490ba80801d19b7e7b.tar.gz
blackbird-op-linux-400ec45a02b2a9ef75c26c490ba80801d19b7e7b.zip
ath5k: Cleanup after API changes
Cleanup after API changes patch (checkpatch.pl stuff) and on ath5k_hw_channel() make use of the existing ath5k_channel_ok() instead of re-implementing the checks again. This was necessary to make the code cleaner and fit the 80-chars wide limit so sending it within the same patch. Finally make a note that we *may* eventually move cap_range stuff to struct wiphy (band frequency range capabilities). This information can later be exported to userspace, for example, and giving it access to mac80211 and drivers in general can come in handy. Changes to initvals.c, phy.c Changes-licensed-under: ISC Changes to ath5k.h, base.c Changes-licensed-under: 3-Clause-BSD Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/phy.c')
-rw-r--r--drivers/net/wireless/ath5k/phy.c35
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,
rf = ah->ah_rf_banks;
if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_2112A
- && !test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode)){
+ && !test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode)) {
rf_ini = rfregs_2112a;
rf_size = ARRAY_SIZE(rfregs_5112a);
if (mode < 2) {
@@ -1445,9 +1445,10 @@ static u32 ath5k_hw_rf5110_chan2athchan(struct ieee80211_channel *channel)
* newer chipsets like the AR5212A who have a completely
* different RF/PHY part.
*/
- athchan = (ath5k_hw_bitswap((ieee80211_frequency_to_channel(channel->center_freq) - 24) / 2, 5) << 1) |
- (1 << 6) | 0x1;
-
+ athchan = (ath5k_hw_bitswap(
+ (ieee80211_frequency_to_channel(
+ channel->center_freq) - 24) / 2, 5)
+ << 1) | (1 << 6) | 0x1;
return athchan;
}
@@ -1506,7 +1507,8 @@ static int ath5k_hw_rf5111_channel(struct ath5k_hw *ah,
struct ieee80211_channel *channel)
{
struct ath5k_athchan_2ghz ath5k_channel_2ghz;
- unsigned int ath5k_channel = ieee80211_frequency_to_channel(channel->center_freq);
+ unsigned int ath5k_channel =
+ ieee80211_frequency_to_channel(channel->center_freq);
u32 data0, data1, clock;
int ret;
@@ -1517,8 +1519,9 @@ static int ath5k_hw_rf5111_channel(struct ath5k_hw *ah,
if (channel->hw_value & CHANNEL_2GHZ) {
/* Map 2GHz channel to 5GHz Atheros channel ID */
- ret = ath5k_hw_rf5111_chan2athchan(ieee80211_frequency_to_channel(channel->center_freq),
- &ath5k_channel_2ghz);
+ ret = ath5k_hw_rf5111_chan2athchan(
+ ieee80211_frequency_to_channel(channel->center_freq),
+ &ath5k_channel_2ghz);
if (ret)
return ret;
@@ -1599,19 +1602,17 @@ static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah,
int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel)
{
int ret;
-
/*
- * Check bounds supported by the PHY
- * (don't care about regulation restrictions at this point)
- */
- if ((channel->center_freq < ah->ah_capabilities.cap_range.range_2ghz_min ||
- channel->center_freq > ah->ah_capabilities.cap_range.range_2ghz_max) &&
- (channel->center_freq < ah->ah_capabilities.cap_range.range_5ghz_min ||
- channel->center_freq > ah->ah_capabilities.cap_range.range_5ghz_max)) {
+ * Check bounds supported by the PHY (we don't care about regultory
+ * restrictions at this point). Note: hw_value already has the band
+ * (CHANNEL_2GHZ, or CHANNEL_5GHZ) so we inform ath5k_channel_ok()
+ * of the band by that */
+ if (!ath5k_channel_ok(ah, channel->center_freq, channel->hw_value)) {
ATH5K_ERR(ah->ah_sc,
- "channel out of supported range (%u MHz)\n",
+ "channel frequency (%u MHz) out of supported "
+ "band range\n",
channel->center_freq);
- return -EINVAL;
+ return -EINVAL;
}
/*
OpenPOWER on IntegriCloud