summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/bcm4329/Kconfig40
-rw-r--r--drivers/net/wireless/bcm4329/Makefile23
-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
5 files changed, 84 insertions, 4 deletions
diff --git a/drivers/net/wireless/bcm4329/Kconfig b/drivers/net/wireless/bcm4329/Kconfig
index ca5760d32385..0f07a7847acd 100644
--- a/drivers/net/wireless/bcm4329/Kconfig
+++ b/drivers/net/wireless/bcm4329/Kconfig
@@ -25,3 +25,43 @@ config BCM4329_NVRAM_PATH
default "/proc/calibration"
---help---
Path to the calibration file.
+
+config BCM4329_WIFI_CONTROL_FUNC
+ bool "Use bcm4329_wlan device"
+ depends on BCM4329
+ default n
+ ---help---
+ Use this option to get various parameters from architecture specific
+ bcm4329_wlan platform device. Say n if unsure.
+
+if BCM4329_WIFI_CONTROL_FUNC
+
+config BCM4329_DHD_USE_STATIC_BUF
+ bool "Use static buffer"
+ depends on BCM4329
+ default n
+ ---help---
+ Use static buffer from kernel heap allocated during bcm4329_wlan
+ platform device creation.
+
+config BCM4329_HW_OOB
+ bool "Use out of band interrupt"
+ depends on BCM4329
+ default n
+ ---help---
+ Use out of band interrupt for wake on wireless.
+
+config BCM4329_OOB_INTR_ONLY
+ bool "Use out of band interrupt only"
+ depends on BCM4329
+ default n
+ ---help---
+ Use out of band interrupt for all interrupts(including SDIO interrupts).
+
+config BCM4329_GET_CUSTOM_MAC_ENABLE
+ bool "Use custom mac address"
+ depends on BCM4329
+ default n
+ ---help---
+ Use mac address provided by bcm4329_wlan platform device.
+endif
diff --git a/drivers/net/wireless/bcm4329/Makefile b/drivers/net/wireless/bcm4329/Makefile
index 3f49a643e8ff..bffe59160c54 100644
--- a/drivers/net/wireless/bcm4329/Makefile
+++ b/drivers/net/wireless/bcm4329/Makefile
@@ -3,13 +3,28 @@ DHDCFLAGS = -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD -DBCMWPA2 \
-DUNRELEASEDCHIP -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64 \
-DDHD_FIRSTREAD=64 -DDHD_GPL -DDHD_SCHED -DBDC -DTOE -DDHD_BCMEVENTS \
-DSHOW_EVENTS -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS \
- -Wall -Wstrict-prototypes -Werror -DOOB_INTR_ONLY -DCUSTOMER_HW2 \
- -DDHD_USE_STATIC_BUF -DMMC_SDIO_ABORT -DDHD_DEBUG_TRAP -DSOFTAP \
- -DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT \
- -DGET_CUSTOM_MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP -DCSCAN -DHW_OOB \
+ -Wall -Wstrict-prototypes -Werror -DCUSTOMER_HW2 -DMMC_SDIO_ABORT \
+ -DDHD_DEBUG_TRAP -DSOFTAP -DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT \
+ -DPKT_FILTER_SUPPORT -DSET_RANDOM_MAC_SOFTAP -DCSCAN \
-DKEEP_ALIVE \
-Idrivers/net/wireless/bcm4329 -Idrivers/net/wireless/bcm4329/include
+ifeq ($(CONFIG_BCM4329_WIFI_CONTROL_FUNC),y)
+DHDCFLAGS += -DCONFIG_WIFI_CONTROL_FUNC
+endif
+ifeq ($(CONFIG_BCM4329_DHD_USE_STATIC_BUF),y)
+DHDCFLAGS += -DDHD_USE_STATIC_BUF
+endif
+ifeq ($(CONFIG_BCM4329_OOB_INTR_ONLY),y)
+DHDCFLAGS += -DOOB_INTR_ONLY
+endif
+ifeq ($(CONFIG_BCM4329_GET_CUSTOM_MAC_ENABLE),y)
+DHDCFLAGS += -DGET_CUSTOM_MAC_ENABLE
+endif
+ifeq ($(CONFIG_BCM4329_HW_OOB),y)
+DHDCFLAGS += -DHW_OOB
+endif
+
DHDOFILES = dhd_linux.o linux_osl.o bcmutils.o dhd_common.o dhd_custom_gpio.o \
wl_iw.o siutils.o sbutils.o aiutils.o hndpmu.o bcmwifi.o dhd_sdio.o \
dhd_linux_sched.o dhd_cdc.o bcmsdh_sdmmc.o bcmsdh.o bcmsdh_linux.o \
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 f9b9eceb91c7..1742deaf74b0 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 */
@@ -4122,6 +4126,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);
}
@@ -4154,6 +4161,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;