diff options
author | avos <avos@FreeBSD.org> | 2015-12-13 20:48:24 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2015-12-13 20:48:24 +0000 |
commit | 093224c4462002b02a08f5b23e361e7983b9fee1 (patch) | |
tree | b814d4d67532060ec79203f4a600bc5f31291fbd /sys/dev/usb/wlan | |
parent | 6000e4fde45e8fe83b65b851e2f7347b4982d075 (diff) | |
download | FreeBSD-src-093224c4462002b02a08f5b23e361e7983b9fee1.zip FreeBSD-src-093224c4462002b02a08f5b23e361e7983b9fee1.tar.gz |
net80211: remove hardcoded slot time durations from drivers
- Add IEEE80211_GET_SLOTTIME(ic) macro.
- Use predefined macroses to set slot time.
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4044
Diffstat (limited to 'sys/dev/usb/wlan')
-rw-r--r-- | sys/dev/usb/wlan/if_rum.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/wlan/if_run.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/wlan/if_ural.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/wlan/if_urtw.c | 8 | ||||
-rw-r--r-- | sys/dev/usb/wlan/if_urtwn.c | 3 |
5 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 02788b1..49864b3 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -2068,7 +2068,7 @@ rum_update_slot_cb(struct rum_softc *sc, union sec_param *data, uint8_t rvp_id) struct ieee80211com *ic = &sc->sc_ic; uint8_t slottime; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); rum_modbits(sc, RT2573_MAC_CSR9, slottime, 0xff); diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index aa853c6..1ad9f60 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -5186,7 +5186,7 @@ run_updateslot_cb(void *arg) run_read(sc, RT2860_BKOFF_SLOT_CFG, &tmp); tmp &= ~0xff; - tmp |= (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + tmp |= IEEE80211_GET_SLOTTIME(ic); run_write(sc, RT2860_BKOFF_SLOT_CFG, tmp); } diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index 6174215..4d84e5a 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -1771,7 +1771,7 @@ ural_update_slot(struct ural_softc *sc) struct ieee80211com *ic = &sc->sc_ic; uint16_t slottime, sifs, eifs; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); /* * These settings may sound a bit inconsistent but this is what the diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index 3f4e4c7..105fd9d 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -4291,18 +4291,18 @@ urtw_updateslottask(void *arg, int pending) if (sc->sc_flags & URTW_RTL8187B) { urtw_write8_m(sc, URTW_SIFS, 0x22); if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) - urtw_write8_m(sc, URTW_SLOT, 0x9); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SHSLOT); else - urtw_write8_m(sc, URTW_SLOT, 0x14); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SLOT); urtw_write8_m(sc, URTW_8187B_EIFS, 0x5b); urtw_write8_m(sc, URTW_CARRIER_SCOUNT, 0x5b); } else { urtw_write8_m(sc, URTW_SIFS, 0x22); if (sc->sc_state == IEEE80211_S_ASSOC && ic->ic_flags & IEEE80211_F_SHSLOT) - urtw_write8_m(sc, URTW_SLOT, 0x9); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SHSLOT); else - urtw_write8_m(sc, URTW_SLOT, 0x14); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SLOT); if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) { urtw_write8_m(sc, URTW_DIFS, 0x14); urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14); diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c index 3223008..becf6c8 100644 --- a/sys/dev/usb/wlan/if_urtwn.c +++ b/sys/dev/usb/wlan/if_urtwn.c @@ -3621,8 +3621,7 @@ urtwn_wme_update(struct ieee80211com *ic) int ac; acm = 0; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? - IEEE80211_DUR_SHSLOT : IEEE80211_DUR_SLOT; + slottime = IEEE80211_GET_SLOTTIME(ic); URTWN_LOCK(sc); for (ac = WME_AC_BE; ac < WME_NUM_AC; ac++) { |