Updated cfg80211.h's add_virtual_inf implementations with new parameter

This commit is contained in:
kimocoder 2019-02-14 19:31:50 +01:00
parent 9a2618a986
commit b4e71299d5

View File

@ -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;