aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iwn
diff options
context:
space:
mode:
authorAndriy Voskoboinyk <avos@FreeBSD.org>2017-02-26 20:49:35 +0000
committerAndriy Voskoboinyk <avos@FreeBSD.org>2017-02-26 20:49:35 +0000
commitf6313575401b3e97469df997e8b9d1a18fb485d0 (patch)
tree157d78224587d45de6f2a92e09caff18cbfe7fac /sys/dev/iwn
parent2fa6d2fe8429a0bdcead3f328e95f3158f30244d (diff)
downloadsrc-f6313575401b3e97469df997e8b9d1a18fb485d0.tar.gz
src-f6313575401b3e97469df997e8b9d1a18fb485d0.zip
net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parameters
directly from the node. - Use ni_txparms directly instead of calculating them manually every time - Move M_EAPOL flag check upper; otherwise it may be skipped due to 'ucastrate' / 'mcastrate' check - Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter) - Add few more M_EAPOL checks where it was missing (zyd(4), ural(4), urtw(4)) - Few unrelated cleanups Tested with: - Intel 6205 (iwn(4)), STA mode; - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9811
Notes
Notes: svn path=/head/; revision=314315
Diffstat (limited to 'sys/dev/iwn')
-rw-r--r--sys/dev/iwn/if_iwn.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index 92ee8e70d658..f430127e0aa2 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -4370,7 +4370,7 @@ static int
iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
{
struct iwn_ops *ops = &sc->ops;
- const struct ieee80211_txparam *tp;
+ const struct ieee80211_txparam *tp = ni->ni_txparms;
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
struct iwn_node *wn = (void *)ni;
@@ -4449,15 +4449,14 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
data = &ring->data[ring->cur];
/* Choose a TX rate index. */
- tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)];
- if (type == IEEE80211_FC0_TYPE_MGT)
+ if (type == IEEE80211_FC0_TYPE_MGT ||
+ type == IEEE80211_FC0_TYPE_CTL ||
+ (m->m_flags & M_EAPOL) != 0)
rate = tp->mgmtrate;
else if (IEEE80211_IS_MULTICAST(wh->i_addr1))
rate = tp->mcastrate;
else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp->ucastrate;
- else if (m->m_flags & M_EAPOL)
- rate = tp->mgmtrate;
else {
/* XXX pass pktlen */
(void) ieee80211_ratectl_rate(ni, NULL, 0);