diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-01-22 08:44:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:13 -0500 |
commit | 07c1e852514e862e246b9f2962ce8fc0d7ac8ed1 (patch) | |
tree | ae8f097e73213a6c5a072978dda13a37d8028708 /drivers/net/wireless/ath5k/base.c | |
parent | 8902ff4e5666c04ca5829c9fd7fc28d73e81ee90 (diff) |
ath5k: honor the RTS/CTS bits
The ath5k driver didn't use set_rts_threshold or use_cts_prot, and also
didn't check the IEEE80211_TX_RC_USE_{RTS_CTS,CTS_PROTECT} RC flags.
Tell the hardware about these so RTS/CTS will work, and so the device
will work better in mixed b/g environments.
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index fc0ff713401c..fa39f21c36c3 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -1180,6 +1180,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) | |||
1180 | unsigned int mrr_rate[3], mrr_tries[3]; | 1180 | unsigned int mrr_rate[3], mrr_tries[3]; |
1181 | int i, ret; | 1181 | int i, ret; |
1182 | u16 hw_rate; | 1182 | u16 hw_rate; |
1183 | u16 cts_rate = 0; | ||
1184 | u16 duration = 0; | ||
1183 | u8 rc_flags; | 1185 | u8 rc_flags; |
1184 | 1186 | ||
1185 | flags = AR5K_TXDESC_INTREQ | AR5K_TXDESC_CLRDMASK; | 1187 | flags = AR5K_TXDESC_INTREQ | AR5K_TXDESC_CLRDMASK; |
@@ -1199,6 +1201,19 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) | |||
1199 | 1201 | ||
1200 | pktlen = skb->len; | 1202 | pktlen = skb->len; |
1201 | 1203 | ||
1204 | if (rc_flags & IEEE80211_TX_RC_USE_RTS_CTS) { | ||
1205 | flags |= AR5K_TXDESC_RTSENA; | ||
1206 | cts_rate = ieee80211_get_rts_cts_rate(sc->hw, info)->hw_value; | ||
1207 | duration = le16_to_cpu(ieee80211_rts_duration(sc->hw, | ||
1208 | sc->vif, pktlen, info)); | ||
1209 | } | ||
1210 | if (rc_flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { | ||
1211 | flags |= AR5K_TXDESC_CTSENA; | ||
1212 | cts_rate = ieee80211_get_rts_cts_rate(sc->hw, info)->hw_value; | ||
1213 | duration = le16_to_cpu(ieee80211_ctstoself_duration(sc->hw, | ||
1214 | sc->vif, pktlen, info)); | ||
1215 | } | ||
1216 | |||
1202 | if (info->control.hw_key) { | 1217 | if (info->control.hw_key) { |
1203 | keyidx = info->control.hw_key->hw_key_idx; | 1218 | keyidx = info->control.hw_key->hw_key_idx; |
1204 | pktlen += info->control.hw_key->icv_len; | 1219 | pktlen += info->control.hw_key->icv_len; |
@@ -1207,7 +1222,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) | |||
1207 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, | 1222 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, |
1208 | (sc->power_level * 2), | 1223 | (sc->power_level * 2), |
1209 | hw_rate, | 1224 | hw_rate, |
1210 | info->control.rates[0].count, keyidx, 0, flags, 0, 0); | 1225 | info->control.rates[0].count, keyidx, 0, flags, |
1226 | cts_rate, duration); | ||
1211 | if (ret) | 1227 | if (ret) |
1212 | goto err_unmap; | 1228 | goto err_unmap; |
1213 | 1229 | ||