Index: head/sys/dev/bwn/if_bwn.c =================================================================== --- head/sys/dev/bwn/if_bwn.c +++ head/sys/dev/bwn/if_bwn.c @@ -2721,8 +2721,7 @@ BWN_LOCK(sc); if (sc->sc_flags & BWN_FLAG_RUNNING) { mac = (struct bwn_mac *)sc->sc_curmac; - bwn_set_slot_time(mac, - (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20); + bwn_set_slot_time(mac, IEEE80211_GET_SLOTTIME(ic)); } BWN_UNLOCK(sc); } Index: head/sys/dev/otus/if_otus.c =================================================================== --- head/sys/dev/otus/if_otus.c +++ head/sys/dev/otus/if_otus.c @@ -2423,7 +2423,7 @@ OTUS_LOCK_ASSERT(sc); - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); otus_write(sc, AR_MAC_REG_SLOT_TIME, slottime << 10); (void)otus_write_barrier(sc); } Index: head/sys/dev/ral/rt2560.c =================================================================== --- head/sys/dev/ral/rt2560.c +++ head/sys/dev/ral/rt2560.c @@ -2254,7 +2254,7 @@ uint32_t tmp; #ifndef FORCE_SLOTTIME - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); #else /* * Setting slot time according to "short slot time" capability @@ -2272,13 +2272,13 @@ * (-1Mb~-2Mb lower) and the _whole_ BSS would stop using short * slot time. */ - slottime = 20; + slottime = IEEE80211_DUR_SLOT; #endif /* update the MAC slot boundaries */ tx_sifs = RAL_SIFS - RT2560_TXRX_TURNAROUND; tx_pifs = tx_sifs + slottime; - tx_difs = tx_sifs + 2 * slottime; + tx_difs = IEEE80211_DUR_DIFS(tx_sifs, slottime); eifs = (ic->ic_curmode == IEEE80211_MODE_11B) ? 364 : 60; tmp = RAL_READ(sc, RT2560_CSR11); Index: head/sys/dev/ral/rt2661.c =================================================================== --- head/sys/dev/ral/rt2661.c +++ head/sys/dev/ral/rt2661.c @@ -2090,7 +2090,7 @@ uint8_t slottime; uint32_t tmp; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); tmp = RAL_READ(sc, RT2661_MAC_CSR9); tmp = (tmp & ~0xff) | slottime; Index: head/sys/dev/ral/rt2860.c =================================================================== --- head/sys/dev/ral/rt2860.c +++ head/sys/dev/ral/rt2860.c @@ -3048,7 +3048,7 @@ tmp = RAL_READ(sc, RT2860_BKOFF_SLOT_CFG); tmp &= ~0xff; - tmp |= (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + tmp |= IEEE80211_GET_SLOTTIME(ic); RAL_WRITE(sc, RT2860_BKOFF_SLOT_CFG, tmp); } Index: head/sys/dev/usb/wlan/if_rum.c =================================================================== --- head/sys/dev/usb/wlan/if_rum.c +++ head/sys/dev/usb/wlan/if_rum.c @@ -2068,7 +2068,7 @@ 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); Index: head/sys/dev/usb/wlan/if_run.c =================================================================== --- head/sys/dev/usb/wlan/if_run.c +++ head/sys/dev/usb/wlan/if_run.c @@ -5186,7 +5186,7 @@ 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); } Index: head/sys/dev/usb/wlan/if_ural.c =================================================================== --- head/sys/dev/usb/wlan/if_ural.c +++ head/sys/dev/usb/wlan/if_ural.c @@ -1771,7 +1771,7 @@ 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 Index: head/sys/dev/usb/wlan/if_urtw.c =================================================================== --- head/sys/dev/usb/wlan/if_urtw.c +++ head/sys/dev/usb/wlan/if_urtw.c @@ -4291,18 +4291,18 @@ 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); Index: head/sys/dev/usb/wlan/if_urtwn.c =================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c +++ head/sys/dev/usb/wlan/if_urtwn.c @@ -3621,8 +3621,7 @@ 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++) { Index: head/sys/net80211/ieee80211_phy.h =================================================================== --- head/sys/net80211/ieee80211_phy.h +++ head/sys/net80211/ieee80211_phy.h @@ -53,6 +53,10 @@ #define IEEE80211_DUR_SHSLOT 9 /* ERP short slottime */ #define IEEE80211_DUR_OFDM_SLOT 9 /* OFDM slottime */ +#define IEEE80211_GET_SLOTTIME(ic) \ + ((ic->ic_flags & IEEE80211_F_SHSLOT) ? \ + IEEE80211_DUR_SHSLOT : IEEE80211_DUR_SLOT) + /* * DIFS (microseconds). */