Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / include / linux / delay.h
index 8e68280..5e016a4 100644 (file)
@@ -65,4 +65,15 @@ static inline void ssleep(unsigned int seconds)
        msleep(seconds * 1000);
 }
 
+/* see Documentation/timers/timers-howto.rst for the thresholds */
+static inline void fsleep(unsigned long usecs)
+{
+       if (usecs <= 10)
+               udelay(usecs);
+       else if (usecs <= 20000)
+               usleep_range(usecs, 2 * usecs);
+       else
+               msleep(DIV_ROUND_UP(usecs, 1000));
+}
+
 #endif /* defined(_LINUX_DELAY_H) */