Date: Wed, 30 Jan 2019 13:19:05 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343577 - head/sys/dev/usb/wlan Message-ID: <201901301319.x0UDJ5ot026786@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Wed Jan 30 13:19:05 2019 New Revision: 343577 URL: https://svnweb.freebsd.org/changeset/base/343577 Log: rsu(4): add support for ifconfig(8) 'maxretry' option. Tested with Asus USB-N10, STA mode; maxretry 0 / 1 / 6 / 12 Checked with RTL8188EE, MONITOR mode. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Jan 30 12:32:47 2019 (r343576) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Jan 30 13:19:05 2019 (r343577) @@ -2755,7 +2755,7 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; - uint8_t rate, ridx, type, cipher; + uint8_t rate, ridx, type, cipher, qos; int prio = 0; uint8_t which; int hasqos; @@ -2804,12 +2804,14 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no prio = M_WME_GETAC(m0); which = rsu_wme_ac_xfer_map[prio]; hasqos = 1; + qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; } else { /* Non-QoS TID */ /* XXX TODO: tid=0 for non-qos TID? */ which = rsu_wme_ac_xfer_map[WME_AC_BE]; hasqos = 0; prio = 0; + qos = 0; } qid = rsu_ac2qid[prio]; @@ -2867,6 +2869,12 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no txd->txdw2 |= htole32(R92S_TXDW2_BK); if (ismcast) txd->txdw2 |= htole32(R92S_TXDW2_BMCAST); + + if (!ismcast && (!qos || (qos & IEEE80211_QOS_ACKPOLICY) != + IEEE80211_QOS_ACKPOLICY_NOACK)) { + txd->txdw2 |= htole32(R92S_TXDW2_RTY_LMT_ENA); + txd->txdw2 |= htole32(SM(R92S_TXDW2_RTY_LMT, tp->maxretry)); + } /* Force mgmt / mcast / ucast rate if needed. */ if (rate != 0) { Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Wed Jan 30 12:32:47 2019 (r343576) +++ head/sys/dev/usb/wlan/if_rsureg.h Wed Jan 30 13:19:05 2019 (r343577) @@ -688,6 +688,9 @@ struct r92s_tx_desc { #define R92S_TXDW1_HWPC 0x80000000 uint32_t txdw2; +#define R92S_TXDW2_RTY_LMT_M 0x0000003f +#define R92S_TXDW2_RTY_LMT_S 0 +#define R92S_TXDW2_RTY_LMT_ENA 0x00000040 #define R92S_TXDW2_BMCAST 0x00000080 #define R92S_TXDW2_AGGEN 0x20000000 #define R92S_TXDW2_BK 0x40000000
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901301319.x0UDJ5ot026786>