From b4e71299d5d9d32e60e20e30980b7470d7e3d694 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Thu, 14 Feb 2019 19:31:50 +0100 Subject: [PATCH] Updated cfg80211.h's add_virtual_inf implementations with new parameter --- os_dep/linux/ioctl_cfg80211.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 8d155d6..f32d7a9 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4431,7 +4431,11 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = { }; #endif -static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct net_device **ndev) +static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) + unsigned char name_assign_type, +#endif + struct net_device **ndev) { int ret = 0; struct net_device *mon_ndev = NULL; @@ -4462,6 +4466,9 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(mon_ndev->name, name, IFNAMSIZ); mon_ndev->name[IFNAMSIZ - 1] = 0; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) + mon_ndev->name_assign_type = name_assign_type; +#endif #if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 11, 8)) mon_ndev->priv_destructor = rtw_ndev_destructor; #else @@ -4551,7 +4558,11 @@ static int switch (type) { case NL80211_IFTYPE_MONITOR: padapter = wiphy_to_adapter(wiphy); /* TODO: get ap iface ? */ - ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, &ndev); + ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) + name_assign_type, +#endif + &ndev); if (ret == 0) wdev = ndev->ieee80211_ptr; break;