summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-07-25 21:45:17 +0200
committerJohannes Berg <johannes.berg@intel.com>2013-08-06 11:00:59 +0200
commite7f1935c11269bc53cd52425b1025657adddb839 (patch)
tree84bffeddf3dec06016bd0c8c53c09eb3d43a6502 /include/linux
parent73da7d5bab79ad7e16ff44d67c3fe8b9c0b33e5b (diff)
downloadop-kernel-dev-e7f1935c11269bc53cd52425b1025657adddb839.zip
op-kernel-dev-e7f1935c11269bc53cd52425b1025657adddb839.tar.gz
wireless: make TU conversion macros available
A few places in the code (mac80211 and iwlmvm) use the same TU_TO_JIFFIES() macro and could use TU_TO_EXP_TIME() that mac80211 has. Make these available to everyone and use them. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ieee80211.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b3ce299..23a8877 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2288,4 +2288,8 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
return !!(tim->virtual_map[index] & mask);
}
+/* convert time units */
+#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
+#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))
+
#endif /* LINUX_IEEE80211_H */
OpenPOWER on IntegriCloud