summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Bansal <rbansal@nvidia.com>2010-12-13 16:51:46 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-12-28 23:58:40 -0800
commitf52b89b7405466ddefb65fa9337f535612e8281b (patch)
treed0262fe83cbcb82800965234b70cf03d587b8067
parent878b4b36f9a2b116197c495d3a39fd9309beadc3 (diff)
[bcm4329] WOW support in BCM driver
Making sure that Rx pkt is acknowledged and sent to network interface by wifi driver before system goes in suspend. BUG ID 767438 Change-Id: Ie88176ec11aa1d2fe4253d9b0472d13a4742d300 Reviewed-on: http://git-master/r/12703 Reviewed-by: Rakesh Kumar <krakesh@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
-rwxr-xr-x[-rw-r--r--]drivers/net/wireless/bcm4329/dhd.h7
-rw-r--r--drivers/net/wireless/bcm4329/dhd_linux.c8
-rw-r--r--drivers/net/wireless/bcm4329/dhd_sdio.c10
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd.h b/drivers/net/wireless/bcm4329/dhd.h
index 1ddf1ff61e70..41672672477e 100644..100755
--- a/drivers/net/wireless/bcm4329/dhd.h
+++ b/drivers/net/wireless/bcm4329/dhd.h
@@ -47,6 +47,10 @@
#include <asm/uaccess.h>
#include <asm/unaligned.h>
+#ifdef CONFIG_HAS_WAKELOCK
+#include <linux/wakelock.h>
+#endif
+
/* The kernel threading is sdio-specific */
#else /* LINUX */
#define ENOMEM 1
@@ -167,6 +171,9 @@ typedef struct dhd_pub {
uint8 country_code[WLC_CNTRY_BUF_SZ];
char eventmask[WL_EVENTING_MASK_LEN];
+#ifdef CONFIG_HAS_WAKELOCK
+ struct wake_lock wow_wakelock;
+#endif
} dhd_pub_t;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c
index c7ef3edd908f..a052386f28a7 100644
--- a/drivers/net/wireless/bcm4329/dhd_linux.c
+++ b/drivers/net/wireless/bcm4329/dhd_linux.c
@@ -2153,6 +2153,10 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
register_pm_notifier(&dhd_sleep_pm_notifier);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
+#ifdef CONFIG_HAS_WAKELOCK
+ wake_lock_init(&dhd->pub.wow_wakelock, WAKE_LOCK_SUSPEND, "wow_wake_lock");
+#endif
+
#ifdef CONFIG_HAS_EARLYSUSPEND
dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
dhd->early_suspend.suspend = dhd_early_suspend;
@@ -2500,6 +2504,10 @@ dhd_detach(dhd_pub_t *dhdp)
if (dhdp->prot)
dhd_prot_detach(dhdp);
+#ifdef CONFIG_HAS_WAKELOCK
+ wake_lock_destroy(&dhdp->wow_wakelock);
+#endif
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
unregister_pm_notifier(&dhd_sleep_pm_notifier);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
diff --git a/drivers/net/wireless/bcm4329/dhd_sdio.c b/drivers/net/wireless/bcm4329/dhd_sdio.c
index ac46ca91eaeb..8915857cf2c8 100644
--- a/drivers/net/wireless/bcm4329/dhd_sdio.c
+++ b/drivers/net/wireless/bcm4329/dhd_sdio.c
@@ -58,6 +58,10 @@
#include <dhdioctl.h>
#include <sdiovar.h>
+#ifdef CONFIG_HAS_WAKELOCK
+#include <linux/wakelock.h>
+#endif
+
#ifdef DHD_DEBUG
#include <hndrte_cons.h>
#endif /* DHD_DEBUG */
@@ -4182,6 +4186,9 @@ dhdsdio_dpc(dhd_bus_t *bus)
/* Handle host mailbox indication */
if (intstatus & I_HMB_HOST_INT) {
+#ifdef CONFIG_HAS_WAKELOCK
+ wake_lock_timeout(&bus->dhd->wow_wakelock, 3*HZ);
+#endif
intstatus &= ~I_HMB_HOST_INT;
intstatus |= dhdsdio_hostmail(bus);
}
@@ -4214,6 +4221,9 @@ dhdsdio_dpc(dhd_bus_t *bus)
/* On frame indication, read available frames */
if (PKT_AVAILABLE()) {
+#ifdef CONFIG_HAS_WAKELOCK
+ wake_lock_timeout(&bus->dhd->wow_wakelock, 3*HZ);
+#endif
framecnt = dhdsdio_readframes(bus, rxlimit, &rxdone);
if (rxdone || bus->rxskip)
intstatus &= ~I_HMB_FRAME_IND;