diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/qcu.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/qcu.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c index 65fe929529a8..0583c69d26db 100644 --- a/drivers/net/wireless/ath/ath5k/qcu.c +++ b/drivers/net/wireless/ath/ath5k/qcu.c | |||
@@ -566,9 +566,11 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time) | |||
566 | { | 566 | { |
567 | struct ieee80211_channel *channel = ah->ah_current_channel; | 567 | struct ieee80211_channel *channel = ah->ah_current_channel; |
568 | enum ieee80211_band band; | 568 | enum ieee80211_band band; |
569 | struct ieee80211_supported_band *sband; | ||
569 | struct ieee80211_rate *rate; | 570 | struct ieee80211_rate *rate; |
570 | u32 ack_tx_time, eifs, eifs_clock, sifs, sifs_clock; | 571 | u32 ack_tx_time, eifs, eifs_clock, sifs, sifs_clock; |
571 | u32 slot_time_clock = ath5k_hw_htoclock(ah, slot_time); | 572 | u32 slot_time_clock = ath5k_hw_htoclock(ah, slot_time); |
573 | u32 rate_flags, i; | ||
572 | 574 | ||
573 | if (slot_time < 6 || slot_time_clock > AR5K_SLOT_TIME_MAX) | 575 | if (slot_time < 6 || slot_time_clock > AR5K_SLOT_TIME_MAX) |
574 | return -EINVAL; | 576 | return -EINVAL; |
@@ -605,7 +607,28 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time) | |||
605 | else | 607 | else |
606 | band = IEEE80211_BAND_2GHZ; | 608 | band = IEEE80211_BAND_2GHZ; |
607 | 609 | ||
608 | rate = &ah->sbands[band].bitrates[0]; | 610 | switch (ah->ah_bwmode) { |
611 | case AR5K_BWMODE_5MHZ: | ||
612 | rate_flags = IEEE80211_RATE_SUPPORTS_5MHZ; | ||
613 | break; | ||
614 | case AR5K_BWMODE_10MHZ: | ||
615 | rate_flags = IEEE80211_RATE_SUPPORTS_10MHZ; | ||
616 | break; | ||
617 | default: | ||
618 | rate_flags = 0; | ||
619 | break; | ||
620 | } | ||
621 | sband = &ah->sbands[band]; | ||
622 | rate = NULL; | ||
623 | for (i = 0; i < sband->n_bitrates; i++) { | ||
624 | if ((rate_flags & sband->bitrates[i].flags) != rate_flags) | ||
625 | continue; | ||
626 | rate = &sband->bitrates[i]; | ||
627 | break; | ||
628 | } | ||
629 | if (WARN_ON(!rate)) | ||
630 | return -EINVAL; | ||
631 | |||
609 | ack_tx_time = ath5k_hw_get_frame_duration(ah, band, 10, rate, false); | 632 | ack_tx_time = ath5k_hw_get_frame_duration(ah, band, 10, rate, false); |
610 | 633 | ||
611 | /* ack_tx_time includes an SIFS already */ | 634 | /* ack_tx_time includes an SIFS already */ |