From 0d8f32b7e8e99f593d7d7ff1afac4e6320e1d5ab Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Wed, 9 Nov 2011 13:06:25 -0800 Subject: [PATCH] net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcmdhd/wl_iw.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/bcmdhd/wl_iw.c b/drivers/net/wireless/bcmdhd/wl_iw.c index 3acdea19cb4f..ba3cc6c876ca 100644 --- a/drivers/net/wireless/bcmdhd/wl_iw.c +++ b/drivers/net/wireless/bcmdhd/wl_iw.c @@ -1667,8 +1667,8 @@ wl_control_wl_start(struct net_device *dev) #if defined(BCMLXSDMMC) sdioh_start(NULL, 1); #endif - - dhd_dev_init_ioctl(dev); + if (!ret) + dhd_dev_init_ioctl(dev); g_onoff = G_WLAN_SET_ON; } @@ -1715,7 +1715,7 @@ wl_iw_control_wl_off( g_iscan->iscan_state = ISCAN_STATE_IDLE; #endif - dhd_dev_reset(dev, 1); + ret = dhd_dev_reset(dev, 1); #if defined(WL_IW_USE_ISCAN) #if !defined(CSCAN) @@ -1738,9 +1738,6 @@ wl_iw_control_wl_off( 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"); @@ -8147,7 +8144,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data) case WLC_E_ROAM: if (status == WLC_E_STATUS_SUCCESS) { WL_ASSOC((" WLC_E_ROAM : success \n")); - return; + goto wl_iw_event_end; } break; @@ -8285,6 +8282,11 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data) case WLC_E_SCAN_COMPLETE: #if defined(WL_IW_USE_ISCAN) + if (!g_iscan) { + WL_ERROR(("Event WLC_E_SCAN_COMPLETE on g_iscan NULL!")); + goto wl_iw_event_end; + } + if ((g_iscan) && (g_iscan->tsk_ctl.thr_pid >= 0) && (g_iscan->iscan_state != ISCAN_STATE_IDLE)) { -- 2.34.1