RTL8812AU: add patch to support kernel 4.0

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2015-04-04 22:20:31 +02:00
parent 1c71f4c32f
commit a7b5c61207

View File

@ -0,0 +1,69 @@
diff -Naur RTL8812AU-b22cbdf/os_dep/linux/ioctl_cfg80211.c RTL8812AU-b22cbdf.patch/os_dep/linux/ioctl_cfg80211.c
--- RTL8812AU-b22cbdf/os_dep/linux/ioctl_cfg80211.c 2014-04-12 01:49:09.000000000 +0200
+++ RTL8812AU-b22cbdf.patch/os_dep/linux/ioctl_cfg80211.c 2015-04-04 22:08:57.188321228 +0200
@@ -20,6 +20,7 @@
#define _IOCTL_CFG80211_C_
#include <drv_types.h>
+#include <linux/version.h>
#ifdef CONFIG_IOCTL_CFG80211
@@ -1422,16 +1423,32 @@
goto exit;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
+#else
sinfo->filled |= STATION_INFO_SIGNAL;
+#endif
sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
+#else
sinfo->filled |= STATION_INFO_TX_BITRATE;
+#endif
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
+#else
sinfo->filled |= STATION_INFO_RX_PACKETS;
+#endif
sinfo->rx_packets = sta_rx_data_pkts(psta);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
+#else
sinfo->filled |= STATION_INFO_TX_PACKETS;
+#endif
sinfo->tx_packets = psta->sta_stats.tx_pkts;
}
@@ -3019,7 +3036,9 @@
ie_offset = _REASOCREQ_IE_OFFSET_;
sinfo.filled = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
+#endif
sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset;
sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset;
cfg80211_new_sta(ndev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC);
diff -Naur RTL8812AU-b22cbdf/os_dep/linux/rtw_android.c RTL8812AU-b22cbdf.patch/os_dep/linux/rtw_android.c
--- RTL8812AU-b22cbdf/os_dep/linux/rtw_android.c 2014-04-12 01:49:09.000000000 +0200
+++ RTL8812AU-b22cbdf.patch/os_dep/linux/rtw_android.c 2015-04-04 20:30:01.213141833 +0200
@@ -224,7 +224,11 @@
{
int cmd_num;
for(cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+ if(!strncasecmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
+#else
if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
+#endif
break;
return cmd_num;