diff options
author | Rahul Bansal <rbansal@nvidia.com> | 2010-12-13 16:51:46 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:52:02 -0800 |
commit | a1d6ab25ad8d33d382c725e8515a441404a6e148 (patch) | |
tree | 5ad2d3954283de4d3e3c3106ffe7dc231776285d /drivers/net | |
parent | 4bae9b6137755fbcba289e32af70fb90f809a313 (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
Original-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>
Rebase-Id: Ra548a45038befb153207f78f373cf433fe89dccb
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/bcm4329/dhd.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/dhd_linux.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/dhd_sdio.c | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd.h b/drivers/net/wireless/bcm4329/dhd.h index 0b2e9c23e3ca..795eca6d6394 100644 --- a/drivers/net/wireless/bcm4329/dhd.h +++ b/drivers/net/wireless/bcm4329/dhd.h @@ -48,6 +48,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 @@ -169,6 +173,9 @@ typedef struct dhd_pub { wl_country_t dhd_cspec; /* Current Locale info */ 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 5f5b418abc26..b673e0c27c3c 100644 --- a/drivers/net/wireless/bcm4329/dhd_linux.c +++ b/drivers/net/wireless/bcm4329/dhd_linux.c @@ -2199,6 +2199,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; @@ -2604,6 +2608,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 e9093e810624..ca08e036eb7e 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 */ @@ -4125,6 +4129,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); } @@ -4157,6 +4164,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; |