memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
}
-#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, proc_net);
-#else
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
-#endif
if (rtw_proc == NULL) {
DBG_8723A(KERN_ERR "Unable to create rtw_proc directory\n");
return;
if(rtw_proc_cnt == 0)
{
if(rtw_proc){
-#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- remove_proc_entry(rtw_proc_name, proc_net);
-#else
- remove_proc_entry(rtw_proc_name, init_net.proc_net);
-#endif
+ remove_proc_entry(rtw_proc_name,
+ init_net.proc_net);
rtw_proc = NULL;
}
}
if(rtw_proc){
remove_proc_entry("ver_info", rtw_proc);
-#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- remove_proc_entry(rtw_proc_name, proc_net);
-#else
remove_proc_entry(rtw_proc_name, init_net.proc_net);
-#endif
rtw_proc = NULL;
}
}
#ifdef CONFIG_LAYER2_ROAMING
registry_par->max_roaming_times = (u8)rtw_max_roaming_times;
-#ifdef CONFIG_INTEL_WIDI
- registry_par->max_roaming_times = (u8)rtw_max_roaming_times + 2;
-#endif // CONFIG_INTEL_WIDI
#endif
#ifdef CONFIG_IOL
#endif
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
static const struct net_device_ops rtw_netdev_ops = {
.ndo_open = netdev_open,
.ndo_stop = netdev_close,
.ndo_get_stats = rtw_net_get_stats,
.ndo_do_ioctl = rtw_ioctl,
};
-#endif
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
{
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_8723A("Force onboard module driver disappear !!!\n");
TargetAdapter = rtw_netdev_priv(TargetNetdev);
padapter = rtw_netdev_priv(pnetdev);
padapter->pnetdev = pnetdev;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
- SET_MODULE_OWNER(pnetdev);
-#endif
-
//pnetdev->init = NULL;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
DBG_8723A("register rtw_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_ops;
-#else
- pnetdev->open = netdev_open;
- pnetdev->stop = netdev_close;
- pnetdev->hard_start_xmit = rtw_xmit_entry;
- pnetdev->set_mac_address = rtw_net_set_mac_address;
- pnetdev->get_stats = rtw_net_get_stats;
- pnetdev->do_ioctl = rtw_ioctl;
-#endif
-
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
pnetdev->features |= NETIF_F_IP_CSUM;
rtw_hal_sreset_init(padapter);
#endif
-#ifdef CONFIG_INTEL_WIDI
- if(rtw_init_intel_widi(padapter) == _FAIL)
- {
- DBG_8723A("Can't rtw_init_intel_widi\n");
- ret8=_FAIL;
- goto exit;
- }
-#endif //CONFIG_INTEL_WIDI
-
-#ifdef CONFIG_WAPI_SUPPORT
- padapter->WapiSupport = true; //set true temp, will revise according to Efuse or Registry value later.
- rtw_wapi_init(padapter);
-#endif
-
#ifdef CONFIG_BR_EXT
spin_lock_init(&padapter->br_ext_lock);
#endif // CONFIG_BR_EXT
RT_TRACE(_module_os_intfs_c_,_drv_info_,("==>rtw_free_drv_sw"));
-#ifdef CONFIG_WAPI_SUPPORT
- rtw_wapi_free(padapter);
-#endif
-
//we can call rtw_p2p_enable here, but:
// 1. rtw_p2p_enable may have IO operation
// 2. rtw_p2p_enable is bundled with wext interface
}
#endif
-
-#ifdef CONFIG_INTEL_WIDI
- rtw_free_intel_widi(padapter);
-#endif //CONFIG_INTEL_WIDI
-
free_mlme_ext_priv(&padapter->mlmeextpriv);
#ifdef CONFIG_TDLS
return 0;
}
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
static const struct net_device_ops rtw_netdev_if2_ops = {
.ndo_open = netdev_if2_open,
.ndo_stop = netdev_if2_close,
.ndo_select_queue = rtw_select_queue,
#endif
};
-#endif
#include <usb_hal.h>
if (!pnetdev)
goto error_rtw_drv_if2_init;
-#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
DBG_8723A("register rtw_netdev_if2_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_if2_ops;
-#else
- pnetdev->open = netdev_if2_open;
- pnetdev->stop = netdev_if2_close;
-#endif
#ifdef CONFIG_NO_WIRELESS_HANDLERS
pnetdev->wireless_handlers = NULL;
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
{
struct net_device *br_netdev;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
- br_netdev = dev_get_by_name(CONFIG_BR_EXT_BRNAME);
-#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
struct net *devnet = NULL;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
- devnet = netdev->nd_net;
-#else // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
devnet = dev_net(netdev);
-#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
-#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
if (br_netdev) {
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; //set this at the end
#endif //CONFIG_IOCTL_CFG80211
-#ifdef CONFIG_WAPI_SUPPORT
- rtw_wapi_disable_tx(padapter);
-#endif
-
RT_TRACE(_module_os_intfs_c_,_drv_info_,("-871x_drv - drv_close\n"));
DBG_8723A("-871x_drv - drv_close, bup=%d\n", padapter->bup);