};
} __packed;
-static struct host_if_drv *terminated_handle;
static struct mutex hif_deinit_lock;
/* 'msg' should be free by the caller for syc */
int result;
struct wilc_drv_handler drv;
+ if (!hif_drv)
+ return -EFAULT;
+
wid.id = WID_SET_DRV_HANDLER;
wid.type = WID_STR;
wid.size = sizeof(drv);
mutex_lock(&hif_deinit_lock);
- terminated_handle = hif_drv;
-
del_timer_sync(&hif_drv->scan_timer);
del_timer_sync(&hif_drv->connect_timer);
del_timer_sync(&vif->periodic_rssi);
hif_drv->hif_state = HOST_IF_IDLE;
kfree(hif_drv);
-
+ vif->hif_drv = NULL;
vif->wilc->clients_count--;
- terminated_handle = NULL;
mutex_unlock(&hif_deinit_lock);
return result;
}
return;
hif_drv = vif->hif_drv;
- if (!hif_drv || hif_drv == terminated_handle) {
+ if (!hif_drv) {
netdev_err(vif->ndev, "driver not init[%p]\n", hif_drv);
return;
}
hif_drv = vif->hif_drv;
- if (!hif_drv || hif_drv == terminated_handle) {
+ if (!hif_drv) {
mutex_unlock(&hif_deinit_lock);
return;
}
return;
hif_drv = vif->hif_drv;
- if (!hif_drv || hif_drv == terminated_handle)
+ if (!hif_drv)
return;
if (hif_drv->usr_scan_req.scan_result) {