aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/wilc_sleep.c
diff options
context:
space:
mode:
authorJohnny Kim <johnny.kim@atmel.com>2015-05-11 14:30:56 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 13:36:53 -0700
commitc5c77ba18ea66aa05441c71e38473efb787705a4 (patch)
tree346d9f9d956b97650977db976e45f01d31223154 /drivers/staging/wilc1000/wilc_sleep.c
parentstaging: panel: fix stackdump (diff)
downloadlinux-dev-c5c77ba18ea66aa05441c71e38473efb787705a4.tar.xz
linux-dev-c5c77ba18ea66aa05441c71e38473efb787705a4.zip
staging: wilc1000: Add SDIO/SPI 802.11 driver
This driver is for the wilc1000 which is a single chip IEEE 802.11 b/g/n device. The driver works together with cfg80211, which is the kernel side of configuration management for wireless devices because the wilc1000 chipset is fullmac where the MLME is managed in hardware. The driver worked from kernel version 2.6.38 and being now ported to several others since then. A TODO file is included as well in this commit. Signed-off-by: Johnny Kim <johnny.kim@atmel.com> Signed-off-by: Rachel Kim <rachel.kim@atmel.com> Signed-off-by: Dean Lee <dean.lee@atmel.com> Signed-off-by: Chris Park <chris.park@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_sleep.c')
-rw-r--r--drivers/staging/wilc1000/wilc_sleep.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/staging/wilc1000/wilc_sleep.c b/drivers/staging/wilc1000/wilc_sleep.c
new file mode 100644
index 000000000000..368157175f40
--- /dev/null
+++ b/drivers/staging/wilc1000/wilc_sleep.c
@@ -0,0 +1,36 @@
+
+#include "wilc_oswrapper.h"
+
+#ifdef CONFIG_WILC_SLEEP_FEATURE
+
+/*
+ * @author mdaftedar
+ * @date 10 Aug 2010
+ * @version 1.0
+ */
+void WILC_Sleep(WILC_Uint32 u32TimeMilliSec)
+{
+ if (u32TimeMilliSec <= 4000000) {
+ WILC_Uint32 u32Temp = u32TimeMilliSec * 1000;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
+ usleep_range(u32Temp, u32Temp);
+#else
+ udelay(u32Temp);
+#endif
+ } else {
+ msleep(u32TimeMilliSec);
+ }
+
+}
+#endif
+
+/* #ifdef CONFIG_WILC_SLEEP_HI_RES */
+void WILC_SleepMicrosec(WILC_Uint32 u32TimeMicoSec)
+{
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
+ usleep_range(u32TimeMicoSec, u32TimeMicoSec);
+ #else
+ udelay(u32TimeMicoSec);
+ #endif
+}
+/* #endif */