1From cde2dbf6e94e00fcf198422b03de01d3090675d9 Mon Sep 17 00:00:00 2001 2From: Jesper Skov <jb1811@jyskebank.dk> 3Date: Fri, 25 Oct 2019 10:10:29 +0200 4Subject: [PATCH] Fix kernel 5.3 driver crashes, from aircrack-ng/rtl8812au#421 5 6[Upstream: https://github.com/abperiasamy/rtl8812AU_8821AU_linux/commit/822b485d36d6f72304a219c3be228f40968b542b.patch] 7Signed-off-by: Peter Seiderer <ps.report@gmx.net> 8Signed-off-by: Christian Stewart <christian@paral.in> 9--- 10 os_dep/linux/rtw_cfgvendor.c | 45 ++++++++++++++++++++++++++++++++++++ 11 1 file changed, 45 insertions(+) 12 13diff --git a/os_dep/linux/rtw_cfgvendor.c b/os_dep/linux/rtw_cfgvendor.c 14index e7ba90a..81fc8af 100644 15--- a/os_dep/linux/rtw_cfgvendor.c 16+++ b/os_dep/linux/rtw_cfgvendor.c 17@@ -1173,6 +1173,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 18 .subcmd = BRCM_VENDOR_SCMD_PRIV_STR 19 }, 20 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 21+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 22+ .policy = VENDOR_CMD_RAW_DATA, 23+#endif 24 .doit = wl_cfgvendor_priv_string_handler 25 }, 26 #if defined(GSCAN_SUPPORT) && 0 27@@ -1182,6 +1185,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 28 .subcmd = GSCAN_SUBCMD_GET_CAPABILITIES 29 }, 30 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 31+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 32+ .policy = VENDOR_CMD_RAW_DATA, 33+#endif 34 .doit = wl_cfgvendor_gscan_get_capabilities 35 }, 36 { 37@@ -1190,6 +1196,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 38 .subcmd = GSCAN_SUBCMD_SET_CONFIG 39 }, 40 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 41+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 42+ .policy = VENDOR_CMD_RAW_DATA, 43+#endif 44 .doit = wl_cfgvendor_set_scan_cfg 45 }, 46 { 47@@ -1198,6 +1207,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 48 .subcmd = GSCAN_SUBCMD_SET_SCAN_CONFIG 49 }, 50 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 51+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 52+ .policy = VENDOR_CMD_RAW_DATA, 53+#endif 54 .doit = wl_cfgvendor_set_batch_scan_cfg 55 }, 56 { 57@@ -1206,6 +1218,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 58 .subcmd = GSCAN_SUBCMD_ENABLE_GSCAN 59 }, 60 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 61+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 62+ .policy = VENDOR_CMD_RAW_DATA, 63+#endif 64 .doit = wl_cfgvendor_initiate_gscan 65 }, 66 { 67@@ -1214,6 +1229,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 68 .subcmd = GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS 69 }, 70 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 71+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 72+ .policy = VENDOR_CMD_RAW_DATA, 73+#endif 74 .doit = wl_cfgvendor_enable_full_scan_result 75 }, 76 { 77@@ -1222,6 +1240,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 78 .subcmd = GSCAN_SUBCMD_SET_HOTLIST 79 }, 80 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 81+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 82+ .policy = VENDOR_CMD_RAW_DATA, 83+#endif 84 .doit = wl_cfgvendor_hotlist_cfg 85 }, 86 { 87@@ -1230,6 +1251,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 88 .subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG 89 }, 90 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 91+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 92+ .policy = VENDOR_CMD_RAW_DATA, 93+#endif 94 .doit = wl_cfgvendor_significant_change_cfg 95 }, 96 { 97@@ -1238,6 +1262,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 98 .subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS 99 }, 100 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 101+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 102+ .policy = VENDOR_CMD_RAW_DATA, 103+#endif 104 .doit = wl_cfgvendor_gscan_get_batch_results 105 }, 106 { 107@@ -1246,6 +1273,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 108 .subcmd = GSCAN_SUBCMD_GET_CHANNEL_LIST 109 }, 110 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 111+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 112+ .policy = VENDOR_CMD_RAW_DATA, 113+#endif 114 .doit = wl_cfgvendor_gscan_get_channel_list 115 }, 116 #endif /* GSCAN_SUPPORT */ 117@@ -1256,6 +1286,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 118 .subcmd = RTT_SUBCMD_SET_CONFIG 119 }, 120 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 121+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 122+ .policy = VENDOR_CMD_RAW_DATA, 123+#endif 124 .doit = wl_cfgvendor_rtt_set_config 125 }, 126 { 127@@ -1264,6 +1297,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 128 .subcmd = RTT_SUBCMD_CANCEL_CONFIG 129 }, 130 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 131+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 132+ .policy = VENDOR_CMD_RAW_DATA, 133+#endif 134 .doit = wl_cfgvendor_rtt_cancel_config 135 }, 136 { 137@@ -1272,6 +1308,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 138 .subcmd = RTT_SUBCMD_GETCAPABILITY 139 }, 140 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 141+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 142+ .policy = VENDOR_CMD_RAW_DATA, 143+#endif 144 .doit = wl_cfgvendor_rtt_get_capability 145 }, 146 #endif /* RTT_SUPPORT */ 147@@ -1281,6 +1320,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 148 .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET 149 }, 150 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 151+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 152+ .policy = VENDOR_CMD_RAW_DATA, 153+#endif 154 .doit = rtw_cfgvendor_get_feature_set 155 }, 156 { 157@@ -1289,6 +1331,9 @@ static const struct wiphy_vendor_command rtw_vendor_cmds [] = { 158 .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX 159 }, 160 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, 161+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) 162+ .policy = VENDOR_CMD_RAW_DATA, 163+#endif 164 .doit = rtw_cfgvendor_get_feature_set_matrix 165 } 166 }; 167-- 1682.28.0 169 170