From: Johannes Berg Date: Thu, 25 Jul 2013 19:45:17 +0000 (+0200) Subject: wireless: make TU conversion macros available X-Git-Tag: 1.9.9~2 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=68d9a6e4e90314d0e4ad31d2926409954267f1dd;p=carl9170fw.git 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 Signed-off-by: Christian Lamparter --- diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index be8083d..77b2ebd 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -2306,4 +2306,8 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim, return !!(tim->virtual_map[indexn0] & 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 */