diff options
author | avos <avos@FreeBSD.org> | 2016-01-20 23:01:33 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-01-20 23:01:33 +0000 |
commit | bd94b945d62e73f8b6f9bdcc3781590607801b3c (patch) | |
tree | a51fde2b8b2acd24c78359bf76382cfe26428395 | |
parent | 9b2207f86007504b58fbb42ce7f30946bbd50cea (diff) | |
download | FreeBSD-src-bd94b945d62e73f8b6f9bdcc3781590607801b3c.zip FreeBSD-src-bd94b945d62e73f8b6f9bdcc3781590607801b3c.tar.gz |
urtwn: use ic_updateslot method to handle slot time change
(by default it was set to 9us).
Tested with RTL8188EU / RTL8188CUS in STA mode.
Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4535
-rw-r--r-- | sys/dev/usb/wlan/if_urtwn.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c index 7466d1a..682238a 100644 --- a/sys/dev/usb/wlan/if_urtwn.c +++ b/sys/dev/usb/wlan/if_urtwn.c @@ -319,6 +319,10 @@ static void urtwn_scan_start(struct ieee80211com *); static void urtwn_scan_end(struct ieee80211com *); static void urtwn_set_channel(struct ieee80211com *); static int urtwn_wme_update(struct ieee80211com *); +static void urtwn_update_slot(struct ieee80211com *); +static void urtwn_update_slot_cb(struct urtwn_softc *, + union sec_param *); +static void urtwn_update_aifs(struct urtwn_softc *, uint8_t); static void urtwn_set_promisc(struct urtwn_softc *); static void urtwn_update_promisc(struct ieee80211com *); static void urtwn_update_mcast(struct ieee80211com *); @@ -540,6 +544,7 @@ urtwn_attach(device_t self) ic->ic_vap_create = urtwn_vap_create; ic->ic_vap_delete = urtwn_vap_delete; ic->ic_wme.wme_update = urtwn_wme_update; + ic->ic_updateslot = urtwn_update_slot; ic->ic_update_promisc = urtwn_update_promisc; ic->ic_update_mcast = urtwn_update_mcast; if (sc->chip & URTWN_CHIP_88E) { @@ -4195,6 +4200,40 @@ urtwn_wme_update(struct ieee80211com *ic) } static void +urtwn_update_slot(struct ieee80211com *ic) +{ + urtwn_cmd_sleepable(ic->ic_softc, NULL, 0, urtwn_update_slot_cb); +} + +static void +urtwn_update_slot_cb(struct urtwn_softc *sc, union sec_param *data) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint8_t slottime; + + slottime = IEEE80211_GET_SLOTTIME(ic); + + DPRINTFN(10, "setting slot time to %uus\n", slottime); + + urtwn_write_1(sc, R92C_SLOT, slottime); + urtwn_update_aifs(sc, slottime); +} + +static void +urtwn_update_aifs(struct urtwn_softc *sc, uint8_t slottime) +{ + const struct wmeParams *wmep = + sc->sc_ic.ic_wme.wme_chanParams.cap_wmeParams; + uint8_t aifs, ac; + + for (ac = WME_AC_BE; ac < WME_NUM_AC; ac++) { + /* AIFS[AC] = AIFSN[AC] * aSlotTime + aSIFSTime. */ + aifs = wmep[ac].wmep_aifsn * slottime + IEEE80211_DUR_SIFS; + urtwn_write_1(sc, wme2queue[ac].reg, aifs); + } +} + +static void urtwn_set_promisc(struct urtwn_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; |