aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-08-14 02:01:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-16 14:17:50 -0400
commit4d70f2fbe12118c5526a1d761f8ef562cecbbc2c (patch)
tree45ac5466752d2fe9ada2ede5963d911c4bd317d5 /drivers/net/wireless/ath/ath5k
parent6a09ae95ed248d6d946407bb1f955e5f2624663d (diff)
ath5k: enable support for 5 MHz and 10 MHz channels
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h1
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c25
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/mac80211-ops.c2
4 files changed, 25 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 2d691b8b95b9..74bd54d6aceb 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -29,6 +29,7 @@
29#include <linux/average.h> 29#include <linux/average.h>
30#include <linux/leds.h> 30#include <linux/leds.h>
31#include <net/mac80211.h> 31#include <net/mac80211.h>
32#include <net/cfg80211.h>
32 33
33/* RX/TX descriptor hw structs 34/* RX/TX descriptor hw structs
34 * TODO: Driver part should only see sw structs */ 35 * TODO: Driver part should only see sw structs */
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7c298af35d42..48161edec8de 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -56,6 +56,7 @@
56#include <linux/etherdevice.h> 56#include <linux/etherdevice.h>
57#include <linux/nl80211.h> 57#include <linux/nl80211.h>
58 58
59#include <net/cfg80211.h>
59#include <net/ieee80211_radiotap.h> 60#include <net/ieee80211_radiotap.h>
60 61
61#include <asm/unaligned.h> 62#include <asm/unaligned.h>
@@ -443,11 +444,27 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
443 * Called with ah->lock. 444 * Called with ah->lock.
444 */ 445 */
445int 446int
446ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan) 447ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef)
447{ 448{
448 ATH5K_DBG(ah, ATH5K_DEBUG_RESET, 449 ATH5K_DBG(ah, ATH5K_DEBUG_RESET,
449 "channel set, resetting (%u -> %u MHz)\n", 450 "channel set, resetting (%u -> %u MHz)\n",
450 ah->curchan->center_freq, chan->center_freq); 451 ah->curchan->center_freq, chandef->chan->center_freq);
452
453 switch (chandef->width) {
454 case NL80211_CHAN_WIDTH_20:
455 case NL80211_CHAN_WIDTH_20_NOHT:
456 ah->ah_bwmode = AR5K_BWMODE_DEFAULT;
457 break;
458 case NL80211_CHAN_WIDTH_5:
459 ah->ah_bwmode = AR5K_BWMODE_5MHZ;
460 break;
461 case NL80211_CHAN_WIDTH_10:
462 ah->ah_bwmode = AR5K_BWMODE_10MHZ;
463 break;
464 default:
465 WARN_ON(1);
466 return -EINVAL;
467 }
451 468
452 /* 469 /*
453 * To switch channels clear any pending DMA operations; 470 * To switch channels clear any pending DMA operations;
@@ -455,7 +472,7 @@ ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan)
455 * hardware at the new frequency, and then re-enable 472 * hardware at the new frequency, and then re-enable
456 * the relevant bits of the h/w. 473 * the relevant bits of the h/w.
457 */ 474 */
458 return ath5k_reset(ah, chan, true); 475 return ath5k_reset(ah, chandef->chan, true);
459} 476}
460 477
461void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) 478void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
@@ -2525,6 +2542,8 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
2525 /* SW support for IBSS_RSN is provided by mac80211 */ 2542 /* SW support for IBSS_RSN is provided by mac80211 */
2526 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 2543 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
2527 2544
2545 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
2546
2528 /* both antennas can be configured as RX or TX */ 2547 /* both antennas can be configured as RX or TX */
2529 hw->wiphy->available_antennas_tx = 0x3; 2548 hw->wiphy->available_antennas_tx = 0x3;
2530 hw->wiphy->available_antennas_rx = 0x3; 2549 hw->wiphy->available_antennas_rx = 0x3;
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index ca9a83ceeee1..97469d0fbad7 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -101,7 +101,7 @@ void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable);
101 101
102void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah, 102void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
103 struct ieee80211_vif *vif); 103 struct ieee80211_vif *vif);
104int ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan); 104int ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef);
105void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf); 105void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
106void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf); 106void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
107void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, 107void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 40825d43322e..4ee01f654235 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -202,7 +202,7 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
202 mutex_lock(&ah->lock); 202 mutex_lock(&ah->lock);
203 203
204 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 204 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
205 ret = ath5k_chan_set(ah, conf->chandef.chan); 205 ret = ath5k_chan_set(ah, &conf->chandef);
206 if (ret < 0) 206 if (ret < 0)
207 goto unlock; 207 goto unlock;
208 } 208 }