diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index 26b8f86..d256066 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -792,47 +792,10 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname) { _adapter *padapter = rtw_netdev_priv(pnetdev); -#ifdef CONFIG_EASY_REPLACEMENT - struct net_device *TargetNetdev = NULL; - _adapter *TargetAdapter = NULL; - struct net *devnet = NULL; - - if (padapter->bDongle == 1) { -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) - TargetNetdev = dev_get_by_name("wlan0"); -#else - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) - devnet = pnetdev->nd_net; - #else - devnet = dev_net(pnetdev); - #endif - TargetNetdev = dev_get_by_name(devnet, "wlan0"); -#endif - if (TargetNetdev) { - DBG_88E("Force onboard module driver disappear !!!\n"); - TargetAdapter = rtw_netdev_priv(TargetNetdev); - TargetAdapter->DriverState = DRIVER_DISAPPEAR; - - padapter->pid[0] = TargetAdapter->pid[0]; - padapter->pid[1] = TargetAdapter->pid[1]; - padapter->pid[2] = TargetAdapter->pid[2]; - - dev_put(TargetNetdev); - unregister_netdev(TargetNetdev); - - if (TargetAdapter->chip_type == padapter->chip_type) - rtw_proc_remove_one(TargetNetdev); - - padapter->DriverState = DRIVER_REPLACE_DONGLE; - } - } -#endif - if (dev_alloc_name(pnetdev, ifname) < 0) RT_TRACE(_module_os_intfs_c_,_drv_err_,("dev_alloc_name, fail!\n")); netif_carrier_off(pnetdev); - return 0; }