extern int dhd_os_wake_lock_timeout(dhd_pub_t *pub);
extern int dhd_os_wake_lock_timeout_enable(dhd_pub_t *pub);
+extern void dhd_os_start_lock(dhd_pub_t *pub);
+extern void dhd_os_start_unlock(dhd_pub_t *pub);
+
typedef struct dhd_if_event {
uint8 ifidx;
uint8 action;
int hang_was_sent;
+ struct mutex wl_start_lock;
+
/* Thread to issue ioctl for multicast */
long sysioc_pid;
struct semaphore sysioc_sem;
DAEMONIZE("dhd_sysioc");
while (down_interruptible(&dhd->sysioc_sem) == 0) {
+ dhd_os_start_lock(&dhd->pub);
dhd_os_wake_lock(&dhd->pub);
for (i = 0; i < DHD_MAX_IFS; i++) {
if (dhd->iflist[i]) {
+ DHD_TRACE(("%s: interface %d\n",__FUNCTION__, i));
#ifdef SOFTAP
in_ap = (ap_net_dev != NULL);
#endif /* SOFTAP */
}
}
dhd_os_wake_unlock(&dhd->pub);
+ dhd_os_start_unlock(&dhd->pub);
}
complete_and_exit(&dhd->sysioc_exited, 0);
}
struct sockaddr *sa = (struct sockaddr *)addr;
int ifidx;
+ DHD_TRACE(("%s: Enter\n",__FUNCTION__));
ifidx = dhd_net2idx(dhd, dev);
if (ifidx == DHD_BAD_IF)
return -1;
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int ifidx;
+ DHD_TRACE(("%s: Enter\n",__FUNCTION__));
ifidx = dhd_net2idx(dhd, dev);
if (ifidx == DHD_BAD_IF)
return;
wake_lock_init(&dhd->wl_wifi, WAKE_LOCK_SUSPEND, "wlan_wake");
wake_lock_init(&dhd->wl_rxwake, WAKE_LOCK_SUSPEND, "wlan_rx_wake");
#endif
+ mutex_init(&dhd->wl_start_lock);
/* Link to info module */
dhd->pub.info = dhd;
}
return ret;
}
+
+void dhd_os_start_lock(dhd_pub_t *pub)
+{
+ dhd_info_t *dhd = (dhd_info_t *)(pub->info);
+
+ if (dhd)
+ mutex_lock(&dhd->wl_start_lock);
+}
+
+void dhd_os_start_unlock(dhd_pub_t *pub)
+{
+ dhd_info_t *dhd = (dhd_info_t *)(pub->info);
+
+ if (dhd)
+ mutex_unlock(&dhd->wl_start_lock);
+}
} while (0)
static int g_onoff = G_WLAN_SET_ON;
-wl_iw_extra_params_t g_wl_iw_params;
-static struct mutex wl_start_lock;
+wl_iw_extra_params_t g_wl_iw_params;
static struct mutex wl_cache_lock;
extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
int
wl_control_wl_start(struct net_device *dev)
{
+ wl_iw_t *iw;
int ret = 0;
WL_TRACE(("Enter %s \n", __FUNCTION__));
return -1;
}
- mutex_lock(&wl_start_lock);
+ iw = *(wl_iw_t **)netdev_priv(dev);
+ 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__));
- mutex_unlock(&wl_start_lock);
+ dhd_os_start_unlock(iw->pub);
return ret;
}
struct iw_request_info *info
)
{
+ wl_iw_t *iw;
int ret = 0;
+
WL_TRACE(("Enter %s\n", __FUNCTION__));
if (!dev) {
return -1;
}
- mutex_lock(&wl_start_lock);
+ iw = *(wl_iw_t **)netdev_priv(dev);
+ dhd_os_start_lock(iw->pub);
#ifdef SOFTAP
ap_cfg_running = FALSE;
wl_iw_send_priv_event(dev, "STOP");
}
- mutex_unlock(&wl_start_lock);
+ dhd_os_start_unlock(iw->pub);
WL_TRACE(("Exited %s\n", __FUNCTION__));
return 0;
}
-int wl_iw_attach(struct net_device *dev, void * dhdp)
+int wl_iw_attach(struct net_device *dev, void *dhdp)
{
int params_size;
wl_iw_t *iw;
#endif
mutex_init(&wl_cache_lock);
- mutex_init(&wl_start_lock);
#if defined(WL_IW_USE_ISCAN)
if (!dev)