diff options
author | Andriy Voskoboinyk <avos@FreeBSD.org> | 2015-12-13 20:48:24 +0000 |
---|---|---|
committer | Andriy Voskoboinyk <avos@FreeBSD.org> | 2015-12-13 20:48:24 +0000 |
commit | bdfff33ff64cbdceaa31a4b62578b24686391d90 (patch) | |
tree | b814d4d67532060ec79203f4a600bc5f31291fbd /sys/dev/ral | |
parent | 375a8ff19bdabffdd79ec2ea0f138105adc4249e (diff) | |
download | src-bdfff33ff64cbdceaa31a4b62578b24686391d90.tar.gz src-bdfff33ff64cbdceaa31a4b62578b24686391d90.zip |
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
Notes
Notes:
svn path=/head/; revision=292165
Diffstat (limited to 'sys/dev/ral')
-rw-r--r-- | sys/dev/ral/rt2560.c | 6 | ||||
-rw-r--r-- | sys/dev/ral/rt2661.c | 2 | ||||
-rw-r--r-- | sys/dev/ral/rt2860.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index e5d75181e460..d62c470c82fe 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -2254,7 +2254,7 @@ rt2560_update_slot(struct ieee80211com *ic) 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 @@ rt2560_update_slot(struct ieee80211com *ic) * (-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); diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index cff64b18dd17..a2e955ced04b 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -2090,7 +2090,7 @@ rt2661_update_slot(struct ieee80211com *ic) 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; diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c index a572dbf47f57..944797612a2f 100644 --- a/sys/dev/ral/rt2860.c +++ b/sys/dev/ral/rt2860.c @@ -3048,7 +3048,7 @@ rt2860_updateslot(struct ieee80211com *ic) 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); } |