struct wake_lock wl_rxwake; /* Wifi rx wakelock */
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
struct mutex wl_start_lock; /* mutex when START called to prevent any other Linux calls */
#endif
spinlock_t wakelock_spinlock;
break;
}
+ dhd_os_start_lock(&dhd->pub);
for (i = 0; i < DHD_MAX_IFS; i++) {
if (dhd->iflist[i]) {
}
DHD_OS_WAKE_UNLOCK(&dhd->pub);
+ dhd_os_start_unlock(&dhd->pub);
+
}
DHD_TRACE(("%s: stopped\n", __FUNCTION__));
complete_and_exit(&tsk->completed, 0);
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_init(&dhd->wl_wifi, WAKE_LOCK_SUSPEND, "wlan_wake");
wake_lock_init(&dhd->wl_rxwake, WAKE_LOCK_SUSPEND, "wlan_rx_wake");
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
+ mutex_init(&dhd->wl_start_lock);
#endif
dhd_state |= DHD_ATTACH_STATE_WAKELOCKS_INIT;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
void dhd_os_start_lock(dhd_pub_t *pub)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
if (dhd)
mutex_lock(&dhd->wl_start_lock);
+#endif
}
void dhd_os_start_unlock(dhd_pub_t *pub)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
if (dhd)
mutex_unlock(&dhd->wl_start_lock);
+#endif
}
-#endif
#ifdef SOFTAP
unsigned long dhd_os_spin_lock(dhd_pub_t *pub)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
-static struct mutex wl_start_lock;
static struct mutex wl_cache_lock;
static struct mutex wl_softap_lock;
wl_control_wl_start(struct net_device *dev)
{
int ret = 0;
+ wl_iw_t *iw;
WL_TRACE(("Enter %s \n", __FUNCTION__));
WL_ERROR(("%s: dev is null\n", __FUNCTION__));
return -1;
}
-
- DHD_OS_MUTEX_LOCK(&wl_start_lock);
+
+ iw = *(wl_iw_t **)netdev_priv(dev);
+
+ if (!iw) {
+ WL_ERROR(("%s: wl is null\n", __FUNCTION__));
+ return -1;
+ }
+
+ dhd_os_start_lock(iw->pub);
if (g_onoff == G_WLAN_SET_OFF) {
dhd_customer_gpio_wlan_ctrl(WLAN_RESET_ON);
}
WL_TRACE(("Exited %s\n", __FUNCTION__));
- DHD_OS_MUTEX_UNLOCK(&wl_start_lock);
+ dhd_os_start_unlock(iw->pub);
return ret;
}
)
{
int ret = 0;
+ wl_iw_t *iw;
WL_TRACE(("Enter %s\n", __FUNCTION__));
return -1;
}
- DHD_OS_MUTEX_LOCK(&wl_start_lock);
+ iw = *(wl_iw_t **)netdev_priv(dev);
+
+ if (!iw) {
+ WL_ERROR(("%s: wl is null\n", __FUNCTION__));
+ return -1;
+ }
+
+ dhd_os_start_lock(iw->pub);
#ifdef SOFTAP
ap_cfg_running = FALSE;
sdioh_stop(NULL);
#endif
-
net_os_set_dtim_skip(dev, 0);
dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF);
wl_iw_send_priv_event(dev, "STOP");
}
- DHD_OS_MUTEX_UNLOCK(&wl_start_lock);
+ dhd_os_start_unlock(iw->pub);
WL_TRACE(("Exited %s\n", __FUNCTION__));
#endif
DHD_OS_MUTEX_INIT(&wl_cache_lock);
- DHD_OS_MUTEX_INIT(&wl_start_lock);
DHD_OS_MUTEX_INIT(&wl_softap_lock);
#if defined(WL_IW_USE_ISCAN)