return -EINVAL;
mutex_lock(&g_monitor.lock);
for (i = 0; i < DHD_MAX_IFS; i++) {
- if (g_monitor.mon_if[i].mon_ndev == ndev) {
+ if (g_monitor.mon_if[i].mon_ndev == ndev ||
+ g_monitor.mon_if[i].real_ndev == ndev) {
g_monitor.mon_if[i].real_ndev = NULL;
- g_monitor.mon_if[i].mon_ndev = NULL;
if (rtnl_is_locked()) {
rtnl_unlock();
rollback_lock = true;
}
- unregister_netdev(ndev);
- free_netdev(ndev);
+ unregister_netdev(g_monitor.mon_if[i].mon_ndev);
+ free_netdev(g_monitor.mon_if[i].mon_ndev);
+ g_monitor.mon_if[i].mon_ndev = NULL;
g_monitor.monitor_state = MONITOR_STATE_INTERFACE_DELETED;
- ndev = NULL;
break;
}
}
rollback_lock = false;
}
- if (ndev)
+ if (g_monitor.monitor_state !=
+ MONITOR_STATE_INTERFACE_DELETED)
MON_PRINT("interface not found in monitor IF array, is this a monitor IF? 0x%p\n",
ndev);
mutex_unlock(&g_monitor.lock);
struct wl_priv *wl = WL_PRIV_GET();
s32 timeout = -1;
s32 ret = 0;
- if (dev && dev->type == ARPHRD_IEEE80211_RADIOTAP) {
- ret = dhd_del_monitor(dev);
- goto exit;
- }
+
if (wl->p2p_supported) {
memcpy(p2p_mac.octet, wl->p2p->int_addr.octet, ETHER_ADDR_LEN);
if (wl->p2p->vif_created) {
} else {
WL_ERR(("IFDEL didn't complete properly"));
}
+ ret = dhd_del_monitor(dev);
}
}
-exit:
return ret;
}