diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/xmit.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index d59dd01d6cd..4d571394c7a 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
938 | struct ieee80211_tx_rate *rates; | 938 | struct ieee80211_tx_rate *rates; |
939 | const struct ieee80211_rate *rate; | 939 | const struct ieee80211_rate *rate; |
940 | struct ieee80211_hdr *hdr; | 940 | struct ieee80211_hdr *hdr; |
941 | struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu); | ||
941 | int i; | 942 | int i; |
942 | u8 rix = 0; | 943 | u8 rix = 0; |
943 | 944 | ||
@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
948 | 949 | ||
949 | /* set dur_update_en for l-sig computation except for PS-Poll frames */ | 950 | /* set dur_update_en for l-sig computation except for PS-Poll frames */ |
950 | info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); | 951 | info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); |
951 | 952 | info->rtscts_rate = fi->rtscts_rate; | |
952 | /* | ||
953 | * We check if Short Preamble is needed for the CTS rate by | ||
954 | * checking the BSS's global flag. | ||
955 | * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. | ||
956 | */ | ||
957 | rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); | ||
958 | info->rtscts_rate = rate->hw_value; | ||
959 | |||
960 | if (tx_info->control.vif && | ||
961 | tx_info->control.vif->bss_conf.use_short_preamble) | ||
962 | info->rtscts_rate |= rate->hw_value_short; | ||
963 | 953 | ||
964 | for (i = 0; i < 4; i++) { | 954 | for (i = 0; i < 4; i++) { |
965 | bool is_40, is_sgi, is_sp; | 955 | bool is_40, is_sgi, is_sp; |
@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
1001 | } | 991 | } |
1002 | 992 | ||
1003 | /* legacy rates */ | 993 | /* legacy rates */ |
994 | rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; | ||
1004 | if ((tx_info->band == IEEE80211_BAND_2GHZ) && | 995 | if ((tx_info->band == IEEE80211_BAND_2GHZ) && |
1005 | !(rate->flags & IEEE80211_RATE_ERP_G)) | 996 | !(rate->flags & IEEE80211_RATE_ERP_G)) |
1006 | phy = WLAN_RC_PHY_CCK; | 997 | phy = WLAN_RC_PHY_CCK; |
1007 | else | 998 | else |
1008 | phy = WLAN_RC_PHY_OFDM; | 999 | phy = WLAN_RC_PHY_OFDM; |
1009 | 1000 | ||
1010 | rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; | ||
1011 | info->rates[i].Rate = rate->hw_value; | 1001 | info->rates[i].Rate = rate->hw_value; |
1012 | if (rate->hw_value_short) { | 1002 | if (rate->hw_value_short) { |
1013 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 1003 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
@@ -1776,10 +1766,22 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1776 | struct ieee80211_sta *sta = tx_info->control.sta; | 1766 | struct ieee80211_sta *sta = tx_info->control.sta; |
1777 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; | 1767 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; |
1778 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1768 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1769 | const struct ieee80211_rate *rate; | ||
1779 | struct ath_frame_info *fi = get_frame_info(skb); | 1770 | struct ath_frame_info *fi = get_frame_info(skb); |
1780 | struct ath_node *an = NULL; | 1771 | struct ath_node *an = NULL; |
1781 | enum ath9k_key_type keytype; | 1772 | enum ath9k_key_type keytype; |
1773 | bool short_preamble = false; | ||
1774 | |||
1775 | /* | ||
1776 | * We check if Short Preamble is needed for the CTS rate by | ||
1777 | * checking the BSS's global flag. | ||
1778 | * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. | ||
1779 | */ | ||
1780 | if (tx_info->control.vif && | ||
1781 | tx_info->control.vif->bss_conf.use_short_preamble) | ||
1782 | short_preamble = true; | ||
1782 | 1783 | ||
1784 | rate = ieee80211_get_rts_cts_rate(hw, tx_info); | ||
1783 | keytype = ath9k_cmn_get_hw_crypto_keytype(skb); | 1785 | keytype = ath9k_cmn_get_hw_crypto_keytype(skb); |
1784 | 1786 | ||
1785 | if (sta) | 1787 | if (sta) |
@@ -1794,6 +1796,9 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1794 | fi->keyix = ATH9K_TXKEYIX_INVALID; | 1796 | fi->keyix = ATH9K_TXKEYIX_INVALID; |
1795 | fi->keytype = keytype; | 1797 | fi->keytype = keytype; |
1796 | fi->framelen = framelen; | 1798 | fi->framelen = framelen; |
1799 | fi->rtscts_rate = rate->hw_value; | ||
1800 | if (short_preamble) | ||
1801 | fi->rtscts_rate |= rate->hw_value_short; | ||
1797 | } | 1802 | } |
1798 | 1803 | ||
1799 | u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) | 1804 | u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) |