} else {
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) */
#endif /* CUSTOM_BLOCK_DEAUTH_AT_EAP_FAILURE */
- dhd_wait_pend8021x(dev);
+// dhd_wait_pend8021x(dev);
scb_val.val = DOT11_RC_DEAUTH_LEAVING;
err = wldev_ioctl_set(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON, &scb_val,
sizeof(scb_val_t));
}
if (!cfg->event_workq) {
+ WL_ERR(("event_workq alloc_workqueue failed\n"));
ret = -ENOMEM;
} else {
INIT_WORK(&cfg->event_work, wl_event_handler);
init_waitqueue_head(&cfg->netif_change_event);
init_completion(&cfg->send_af_done);
init_completion(&cfg->iface_disable);
- wl_init_eq(cfg);
- err = wl_init_priv_mem(cfg);
- if (err)
- return err;
- if (wl_create_event_handler(cfg))
- return -ENOMEM;
- wl_init_event_handler(cfg);
mutex_init(&cfg->usr_sync);
mutex_init(&cfg->event_sync);
mutex_init(&cfg->scan_complete);
mutex_init(&cfg->if_sync);
+ mutex_init(&cfg->pm_sync);
#ifdef WLTDLS
mutex_init(&cfg->tdls_sync);
#endif /* WLTDLS */
+ wl_init_eq(cfg);
+ err = wl_init_priv_mem(cfg);
+ if (err)
+ return err;
+ if (wl_create_event_handler(cfg))
+ return -ENOMEM;
+ wl_init_event_handler(cfg);
err = wl_init_scan(cfg);
if (err)
return err;
wl_destroy_event_handler(cfg);
wl_flush_eq(cfg);
wl_link_down(cfg);
- del_timer_sync(&cfg->scan_timeout);
+ if (cfg->scan_timeout.function)
+ del_timer_sync(&cfg->scan_timeout);
#ifdef DHD_LOSSLESS_ROAMING
- del_timer_sync(&cfg->roam_timeout);
+ if (cfg->roam_timeout.function)
+ del_timer_sync(&cfg->roam_timeout);
#endif
wl_deinit_priv_mem(cfg);
if (wl_cfg80211_netdev_notifier_registered) {
{
struct wireless_dev *wdev = ndev->ieee80211_ptr;
- if (!wdev)
+ if (!wdev || !wdev->wiphy)
return NULL;
return wiphy_priv(wdev->wiphy);
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
wdev->netdev = ndev;
cfg->state_notifier = wl_notifier_change_state;
- err = wl_alloc_netinfo(cfg, ndev, wdev, wdev->iftype, PM_ENABLE, 0);
+ err = wl_init_priv(cfg);
if (err) {
- WL_ERR(("Failed to alloc net_info (%d)\n", err));
+ WL_ERR(("Failed to init iwm_priv (%d)\n", err));
goto cfg80211_attach_out;
}
- err = wl_init_priv(cfg);
+ err = wl_alloc_netinfo(cfg, ndev, wdev, wdev->iftype, PM_ENABLE, 0);
if (err) {
- WL_ERR(("Failed to init iwm_priv (%d)\n", err));
+ WL_ERR(("Failed to alloc net_info (%d)\n", err));
goto cfg80211_attach_out;
}
#endif
INIT_DELAYED_WORK(&cfg->pm_enable_work, wl_cfg80211_work_handler);
- mutex_init(&cfg->pm_sync);
#if defined(STAT_REPORT)
err = wl_attach_stat_report(cfg);
return err;
cfg80211_attach_out:
- wl_setup_rfkill(cfg, FALSE);
- wl_free_wdev(cfg);
+ wl_cfg80211_detach(cfg);
return err;
}
WL_DBG(("In\n"));
- err = wl_create_event_handler(cfg);
- if (err) {
- WL_ERR(("wl_create_event_handler failed\n"));
- return err;
+ if (!dhd_download_fw_on_driverload) {
+ err = wl_create_event_handler(cfg);
+ if (err) {
+ WL_ERR(("wl_create_event_handler failed\n"));
+ return err;
+ }
+ wl_init_event_handler(cfg);
}
- wl_init_event_handler(cfg);
err = dhd_config_dongle(cfg);
if (unlikely(err))
return err;
}
}
- if (!dhd_download_fw_on_driverload) {
- err = wl_create_event_handler(cfg);
- if (err) {
- WL_ERR(("wl_create_event_handler failed\n"));
- return err;
- }
- wl_init_event_handler(cfg);
- }
- err = wl_init_scan(cfg);
- if (err) {
- WL_ERR(("wl_init_scan failed\n"));
- return err;
- }
+
#ifdef DHD_LOSSLESS_ROAMING
if (timer_pending(&cfg->roam_timeout)) {
del_timer_sync(&cfg->roam_timeout);
s32 wl_cfg80211_down(struct net_device *dev)
{
+ struct bcm_cfg80211 *cfg = wl_get_cfg(dev);
s32 err = 0;
- struct bcm_cfg80211 *cfg = NULL;
- if (dev == NULL)
- return err;
-
- cfg = wl_get_cfg(dev);
WL_DBG(("In\n"));
if (cfg == NULL)
return err;
-
mutex_lock(&cfg->usr_sync);
#if defined(RSSIAVG)
wl_free_rssi_cache(&g_rssi_cache_ctrl);