summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNarayan Reddy <narayanr@nvidia.com>2013-12-20 16:38:03 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-01-24 15:01:00 -0800
commit5ba9502a920ce16c9b440eb29685d232a17f5a93 (patch)
treebccefd456b9aa404b69ac251090c3eacd9293aa8
parentc0ac4b83e1acb1b8886c78276e9fbf4c0282545c (diff)
pulled missing patches from 1.28.28.4
Bug 1422733 Change-Id: Ia23f3de0d8022a5e4f02af7145d35aa57aa69e36 Signed-off-by: Narayan Reddy <narayanr@nvidia.com> Reviewed-on: http://git-master/r/347998 Reviewed-by: Jean Huang <jeanh@nvidia.com> Tested-by: Jean Huang <jeanh@nvidia.com>
-rw-r--r--drivers/net/wireless/bcmdhd/Makefile7
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd.h2
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_linux.c21
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_sdio.c24
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/linuxver.h17
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_android.c17
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_cfg80211.c4
7 files changed, 83 insertions, 9 deletions
diff --git a/drivers/net/wireless/bcmdhd/Makefile b/drivers/net/wireless/bcmdhd/Makefile
index cd8bb72ad61f..d30e7d90f782 100644
--- a/drivers/net/wireless/bcmdhd/Makefile
+++ b/drivers/net/wireless/bcmdhd/Makefile
@@ -4,7 +4,7 @@ DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \
-DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DBCMFILEIMAGE \
-DDHDTHREAD -DDHD_DEBUG -DSDTEST -DBDC -DTOE \
-DDHD_BCMEVENTS -DSHOW_EVENTS -DPROP_TXSTATUS -DBCMDBG \
- -DCUSTOMER_HW2 \
+ -DCUSTOMER_HW2 -DUSE_KTHREAD_API \
-DMMC_SDIO_ABORT -DBCMSDIO -DBCMLXSDMMC -DBCMPLATFORM_BUS -DWLP2P \
-DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \
-DKEEP_ALIVE -DGET_CUSTOM_MAC_ENABLE -DPKT_FILTER_SUPPORT \
@@ -29,6 +29,7 @@ DHDCFLAGS += -DIOCTL_RESP_TIMEOUT=5000
DHDCFLAGS += -DRXFRAME_THREAD
DHDCFLAGS += -DDHDTCPACK_SUPPRESS
DHDCFALGS += -DCONFIG_WIFI_CONTROL_FUNC
+DHDCFLAGS += -DSYSFS_IDLETIME
ifeq ($(CONFIG_BCMDHD_HW_OOB),y)
DHDCFLAGS += -DHW_OOB -DOOB_INTR_ONLY
@@ -36,6 +37,10 @@ else
DHDCFLAGS += -DSDIO_ISR_THREAD
endif
+ifeq ($(CONFIG_BLUEDROID_PM),y)
+DHDCFLAGS += -DENABLE_WiFI_BT_TURN_ON_SYNC
+endif
+
ifeq ($(CONFIG_BCMDHD_INSMOD_NO_FW_LOAD),y)
DHDCFLAGS += -DENABLE_INSMOD_NO_FW_LOAD
endif
diff --git a/drivers/net/wireless/bcmdhd/dhd.h b/drivers/net/wireless/bcmdhd/dhd.h
index 3d5e2e19ccf4..766978f02033 100755
--- a/drivers/net/wireless/bcmdhd/dhd.h
+++ b/drivers/net/wireless/bcmdhd/dhd.h
@@ -779,7 +779,7 @@ extern uint dhd_force_tx_queueing;
#define CUSTOM_SUSPEND_BCN_LI_DTIM DEFAULT_SUSPEND_BCN_LI_DTIM
#endif
-#define DEFAULT_WIFI_TURNOFF_DELAY 0
+#define DEFAULT_WIFI_TURNOFF_DELAY 300
#define WIFI_TURNOFF_DELAY DEFAULT_WIFI_TURNOFF_DELAY
#ifdef RXFRAME_THREAD
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c
index a0c81c95fff7..9e52764c1c17 100755
--- a/drivers/net/wireless/bcmdhd/dhd_linux.c
+++ b/drivers/net/wireless/bcmdhd/dhd_linux.c
@@ -31,6 +31,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/kthread.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
@@ -562,6 +563,10 @@ static void dhd_dump_htsfhisto(histo_t *his, char *s);
int dhd_monitor_init(void *dhd_pub);
int dhd_monitor_uninit(void);
+#ifdef SYSFS_IDLETIME
+int dhd_sysfs_init(dhd_pub_t *dhdp);
+int dhd_sysfs_deinit(void);
+#endif /* SYSFS_IDLETIME */
#if defined(WL_WIRELESS_EXT)
@@ -3532,7 +3537,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen, void *dev)
if (dhd_watchdog_prio >= 0) {
/* Initialize watchdog thread */
- PROC_START(dhd_watchdog_thread, dhd, &dhd->thr_wdt_ctl, 0, "dhd_watchdog_thread");
+ PROC_START2(dhd_watchdog_thread, dhd, &dhd->thr_wdt_ctl, 0, "dhd_watchdog_thread");
} else {
dhd->thr_wdt_ctl.thr_pid = -1;
@@ -3541,7 +3546,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen, void *dev)
/* Set up the bottom half handler */
if (dhd_dpc_prio >= 0) {
/* Initialize DPC thread */
- PROC_START(dhd_dpc_thread, dhd, &dhd->thr_dpc_ctl, 0, "dhd_dpc");
+ PROC_START2(dhd_dpc_thread, dhd, &dhd->thr_dpc_ctl, 0, "dhd_dpc");
} else {
/* use tasklet for dpc */
tasklet_init(&dhd->tasklet, dhd_dpc, (ulong)dhd);
@@ -3550,7 +3555,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen, void *dev)
#ifdef RXFRAME_THREAD
bzero(&dhd->pub.skbbuf[0], sizeof(void *) * MAXSKBPEND);
/* Initialize RXF thread */
- PROC_START(dhd_rxf_thread, dhd, &dhd->thr_rxf_ctl, 0, "dhd_rxf");
+ PROC_START2(dhd_rxf_thread, dhd, &dhd->thr_rxf_ctl, 0, "dhd_rxf");
#endif
#else
/* Set up the bottom half handler */
@@ -3559,7 +3564,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen, void *dev)
#endif /* DHDTHREAD */
if (dhd_sysioc) {
- PROC_START(_dhd_sysioc_thread, dhd, &dhd->thr_sysioc_ctl, 0, "dhd_sysioc");
+ PROC_START2(_dhd_sysioc_thread, dhd, &dhd->thr_sysioc_ctl, 0, "dhd_sysioc");
} else {
dhd->thr_sysioc_ctl.thr_pid = -1;
}
@@ -3569,6 +3574,9 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen, void *dev)
INIT_WORK(&dhd->work_hang, dhd_hang_process);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
+#ifdef SYSFS_IDLETIME
+ dhd_sysfs_init(&dhd->pub);
+#endif /* SYSFS_IDLETIME */
/*
* Save the dhd_info into the priv
*/
@@ -4968,6 +4976,11 @@ void dhd_detach(dhd_pub_t *dhdp)
wake_lock_destroy(&dhd->wl_wdwake);
#endif /* CONFIG_HAS_WAKELOCK */
}
+
+#ifdef SYSFS_IDLETIME
+ dhd_sysfs_deinit();
+#endif /* SYSFS_IDLETIME */
+
}
diff --git a/drivers/net/wireless/bcmdhd/dhd_sdio.c b/drivers/net/wireless/bcmdhd/dhd_sdio.c
index 61b10746122c..f9de6efaca75 100755
--- a/drivers/net/wireless/bcmdhd/dhd_sdio.c
+++ b/drivers/net/wireless/bcmdhd/dhd_sdio.c
@@ -8209,6 +8209,30 @@ dhd_bus_membytes(dhd_pub_t *dhdp, bool set, uint32 address, uint8 *data, uint si
return dhdsdio_membytes(bus, set, address, data, size);
}
+#ifdef SYSFS_IDLETIME
+int32 dhd_get_bus_idletime(dhd_pub_t *dhdp)
+{
+ dhd_bus_t *bus = dhdp->bus;
+
+ return bus->idletime;
+}
+
+int32 dhd_set_bus_idletime(dhd_pub_t *dhdp, int32 idletime)
+{
+ dhd_bus_t *bus = dhdp->bus;
+
+ bus->idletime = idletime;
+
+ if (dhdp->busstate != DHD_BUS_DOWN && idletime == 0) {
+ dhd_os_sdlock(dhdp);
+ BUS_WAKE(bus);
+ dhd_os_sdunlock(dhdp);
+ }
+
+ return 0;
+}
+#endif /* SYSFS_IDLETIME */
+
int
dhd_enableOOB(dhd_pub_t *dhd, bool sleep)
{
diff --git a/drivers/net/wireless/bcmdhd/include/linuxver.h b/drivers/net/wireless/bcmdhd/include/linuxver.h
index 10be026d286a..05cfaeebd7cb 100755
--- a/drivers/net/wireless/bcmdhd/include/linuxver.h
+++ b/drivers/net/wireless/bcmdhd/include/linuxver.h
@@ -522,7 +522,7 @@ typedef struct {
void *parent; /* some external entity that the thread supposed to work for */
char *proc_name;
struct task_struct *p_task;
- long thr_pid;
+ pid_t thr_pid;
int prio; /* priority */
struct semaphore sema;
int terminated;
@@ -594,10 +594,23 @@ static inline bool binary_sema_up(tsk_ctl_t *tsk)
(tsk_ctl)->p_task = kthread_run(thread_func, tsk_ctl, (char*)name); \
(tsk_ctl)->thr_pid = (tsk_ctl)->p_task->pid; \
spin_lock_init(&((tsk_ctl)->spinlock)); \
- DBG_THR(("%s(): thread:%s:%lx started\n", __FUNCTION__, \
+ DBG_THR(("%s(): thread:%s:%d started\n", __FUNCTION__, \
(tsk_ctl)->proc_name, (tsk_ctl)->thr_pid)); \
}
+#ifdef USE_KTHREAD_API
+#define PROC_START2(thread_func, owner, tsk_ctl, flags, name) \
+{ \
+ sema_init(&((tsk_ctl)->sema), 0); \
+ init_completion(&((tsk_ctl)->completed)); \
+ (tsk_ctl)->parent = owner; \
+ (tsk_ctl)->terminated = FALSE; \
+ (tsk_ctl)->p_task = kthread_run(thread_func, tsk_ctl, (char*)name); \
+ (tsk_ctl)->thr_pid = (tsk_ctl)->p_task->pid; \
+ DBG_THR(("%s thr:%d created\n", __FUNCTION__, (tsk_ctl)->thr_pid)); \
+}
+#endif
+
#define PROC_STOP(tsk_ctl) \
{ \
(tsk_ctl)->terminated = TRUE; \
diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c
index f29f0e5de55d..8cccf165f958 100755
--- a/drivers/net/wireless/bcmdhd/wl_android.c
+++ b/drivers/net/wireless/bcmdhd/wl_android.c
@@ -1463,6 +1463,11 @@ static int wifi_request_edp_state(struct edp_client *pinfo, int new_state)
}
#endif
+#ifdef ENABLE_WiFI_BT_TURN_ON_SYNC
+extern void bt_wlan_lock(void);
+extern void bt_wlan_unlock(void);
+#endif
+
int wifi_set_power(int on, unsigned long msec)
{
int ret = 0;
@@ -1503,9 +1508,21 @@ int wifi_set_power(int on, unsigned long msec)
}
#endif /* ENABLE_4335BT_WAR */
+#ifdef ENABLE_WiFI_BT_TURN_ON_SYNC
+ bt_wlan_lock();
+ if (on)
+ msleep(600);
+ else
+ msleep(50);
+#endif
+
if (wifi_control_data->set_power)
ret = wifi_control_data->set_power(on);
+#ifdef ENABLE_WiFI_BT_TURN_ON_SYNC
+ bt_wlan_unlock();
+#endif
+
if (wifi_regulator && !on)
ret = regulator_disable(wifi_regulator);
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
index d670d67d2e04..180360bce785 100755
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -1401,6 +1401,7 @@ wl_cfg80211_del_virtual_iface(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev)
if (wl_get_drv_status(wl, DISCONNECTING, dev) &&
(wl_get_mode_by_netdev(wl, dev) != WL_MODE_AP)) {
WL_ERR(("Wait for Link Down event for GC !\n"));
+ INIT_COMPLETION(wl->iface_disable);
wait_for_completion_timeout
(&wl->iface_disable, msecs_to_jiffies(500));
}
@@ -1417,6 +1418,7 @@ wl_cfg80211_del_virtual_iface(struct wiphy *wiphy, bcm_struct_cfgdev *cfgdev)
*/
if (ret == 0) {
WL_ERR(("Wait for Link Down event for GO !!!\n"));
+ INIT_COMPLETION(wl->iface_disable);
wait_for_completion_timeout(&wl->iface_disable,
msecs_to_jiffies(500));
} else if (ret != BCME_UNSUPPORTED) {
@@ -8377,7 +8379,7 @@ static s32 wl_create_event_handler(struct wl_priv *wl)
/* Do not use DHD in cfg driver */
wl->event_tsk.thr_pid = -1;
- PROC_START(wl_event_handler, wl, &wl->event_tsk, 0, "wl_event_handler");
+ PROC_START2(wl_event_handler, wl, &wl->event_tsk, 0, "wl_event_handler");
if (wl->event_tsk.thr_pid < 0)
ret = -ENOMEM;
return ret;