Updated cfg80211.h's add_virtual_inf implementations with new parameter

This commit is contained in:
kimocoder 2019-08-16 17:47:09 +02:00
parent 1972751e8f
commit bb31213a73
2 changed files with 18 additions and 7 deletions

View File

@ -1,7 +1,7 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1 EXTRA_CFLAGS += -O1
#EXTRA_CFLAGS += -O3 #EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra #EXTRA_CFLAGS += -Wextra
#EXTRA_CFLAGS += -Werror #EXTRA_CFLAGS += -Werror
#EXTRA_CFLAGS += -pedantic #EXTRA_CFLAGS += -pedantic
@ -9,8 +9,8 @@ EXTRA_CFLAGS += -O1
#EXTRA_CFLAGS += -Wno-tautological-compare #EXTRA_CFLAGS += -Wno-tautological-compare
#EXTRA_CFLAGS += -Wno-incompatible-pointer-types #EXTRA_CFLAGS += -Wno-incompatible-pointer-types
#EXTRA_CFLAGS += -Wno-switch EXTRA_CFLAGS += -Wno-switch
#EXTRA_CFLAGS += -Wno-cast-function-type EXTRA_CFLAGS += -Wno-cast-function-type
EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-unused-value EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label EXTRA_CFLAGS += -Wno-unused-label
@ -20,11 +20,11 @@ EXTRA_CFLAGS += -Wno-unused
EXTRA_CFLAGS += -Wno-cast-function-type EXTRA_CFLAGS += -Wno-cast-function-type
EXTRA_CFLAGS += -Wno-date-time EXTRA_CFLAGS += -Wno-date-time
#EXTRA_CFLAGS += -Wsign-conversion #EXTRA_CFLAGS += -Wsign-conversion
#EXTRA_CFLAGS += -Wno-misleading-indentation EXTRA_CFLAGS += -Wno-misleading-indentation
EXTRA_CFLAGS += -Wno-uninitialized EXTRA_CFLAGS += -Wno-uninitialized
# Relax some warnings from '-Wextra' so we won't get flooded with warnings # Relax some warnings from '-Wextra' so we won't get flooded with warnings
#EXTRA_CFLAGS += -Wno-sign-compare -Wno-sign-conversion #EXTRA_CFLAGS += -Wno-sign-compare -Wno-sign-conversion
#EXTRA_CFLAGS += -Wno-missing-field-initializers EXTRA_CFLAGS += -Wno-missing-field-initializers
#EXTRA_CFLAGS += -Wno-type-limits #EXTRA_CFLAGS += -Wno-type-limits
#EXTRA_CFLAGS += -Wconversion -Wformat-overflow -Wswitch -Wswitch-bool #EXTRA_CFLAGS += -Wconversion -Wformat-overflow -Wswitch -Wswitch-bool
#EXTRA_CFLAGS += -Wno-tautological-compare -Wno-ignored-qualifiers #EXTRA_CFLAGS += -Wno-tautological-compare -Wno-ignored-qualifiers

View File

@ -4763,7 +4763,11 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
}; };
#endif #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; int ret = 0;
struct net_device *mon_ndev = NULL; struct net_device *mon_ndev = NULL;
@ -4794,6 +4798,9 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(mon_ndev->name, name, IFNAMSIZ); strncpy(mon_ndev->name, name, IFNAMSIZ);
mon_ndev->name[IFNAMSIZ - 1] = 0; 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)) #if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 11, 8))
mon_ndev->priv_destructor = rtw_ndev_destructor; mon_ndev->priv_destructor = rtw_ndev_destructor;
#else #else
@ -4883,7 +4890,11 @@ static int
switch (type) { switch (type) {
case NL80211_IFTYPE_MONITOR: case NL80211_IFTYPE_MONITOR:
padapter = wiphy_to_adapter(wiphy); /* TODO: get ap iface ? */ 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) if (ret == 0)
wdev = ndev->ieee80211_ptr; wdev = ndev->ieee80211_ptr;
break; break;