From: Jan Rękorajski Date: Tue, 10 Oct 2017 21:00:31 +0000 (+0200) Subject: - updated to 5.1.5 from https://github.com/zebulon2/rtl8812au X-Git-Tag: auto/th/rtl8812au-5.1.5_19247.20160830-0.20171010.1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frtl8812au.git;a=commitdiff_plain;h=6738afa - updated to 5.1.5 from https://github.com/zebulon2/rtl8812au This driver is based on version from Tenda: http://www.tenda.com.cn/product/download/U12.html --- diff --git a/disable-debug.patch b/disable-debug.patch deleted file mode 100644 index f0d1851..0000000 --- a/disable-debug.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/include/autoconf.h b/include/autoconf.h -index 6f579b3..61b6c74 100644 ---- a/include/autoconf.h -+++ b/include/autoconf.h -@@ -364,14 +364,14 @@ - /* - * Debug Related Config - */ --#define DBG 1 -+#define DBG 0 - --#define CONFIG_DEBUG /* DBG_871X, etc... */ -+//#define CONFIG_DEBUG /* DBG_871X, etc... */ - //#define CONFIG_DEBUG_RTL871X /* RT_TRACE, RT_PRINT_DATA, _func_enter_, _func_exit_ */ - - #define CONFIG_PROC_DEBUG - --#define DBG_CONFIG_ERROR_DETECT -+//#define DBG_CONFIG_ERROR_DETECT - //#define DBG_CONFIG_ERROR_DETECT_INT - //#define DBG_CONFIG_ERROR_RESET - diff --git a/enable-cfg80211-support.patch b/enable-cfg80211-support.patch deleted file mode 100644 index c108983..0000000 --- a/enable-cfg80211-support.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/include/autoconf.h b/include/autoconf.h -index 6f579b3..c6511d8 100644 ---- a/include/autoconf.h -+++ b/include/autoconf.h -@@ -38,11 +38,11 @@ - #define PLATFORM_LINUX 1 - - --//#define CONFIG_IOCTL_CFG80211 1 -+#define CONFIG_IOCTL_CFG80211 1 - - #ifdef CONFIG_IOCTL_CFG80211 -- //#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */ -- #define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER -+ #define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */ -+ //#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER - //#define CONFIG_DEBUG_CFG80211 - //#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2 - #define CONFIG_SET_SCAN_DENY_TIMER diff --git a/gcc-4.9.patch b/gcc-4.9.patch index 19dfc2c..f2eb93b 100644 --- a/gcc-4.9.patch +++ b/gcc-4.9.patch @@ -1,6 +1,7 @@ ---- rtl8812au_linux-master/core/rtw_debug.c~ 2014-07-21 15:06:45.000000000 +0200 -+++ rtl8812au_linux-master/core/rtw_debug.c 2014-12-11 21:38:17.142784499 +0100 -@@ -62,8 +62,15 @@ +diff -ur -x '*~' rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_debug.c rtl8812AU_linux_v5.1.5_19247.20160830-gcc/core/rtw_debug.c +--- rtl8812AU_linux_v5.1.5_19247.20160830/core/rtw_debug.c 2016-08-30 04:28:15.000000000 +0200 ++++ rtl8812AU_linux_v5.1.5_19247.20160830-gcc/core/rtw_debug.c 2017-10-10 21:57:47.919763413 +0200 +@@ -46,8 +46,15 @@ void dump_drv_version(void *sel) { @@ -8,11 +9,11 @@ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdate-time" +#endif - DBG_871X_SEL_NL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION); - DBG_871X_SEL_NL(sel, "build time: %s %s\n", __DATE__, __TIME__); + RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION); + RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#pragma GCC diagnostic pop +#endif } - void dump_log_level(void *sel) + void dump_drv_cfg(void *sel) diff --git a/linux-3.11.patch b/linux-3.11.patch deleted file mode 100644 index 9fe8378..0000000 --- a/linux-3.11.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c -index ca56b4c..659305f 100644 ---- a/os_dep/linux/os_intfs.c -+++ b/os_dep/linux/os_intfs.c -@@ -660,7 +660,11 @@ u16 rtw_recv_select_queue(struct sk_buff *skb) - - static int rtw_ndev_notifier_call(struct notifier_block * nb, unsigned long state, void *ndev) - { -+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3,11,0)) -+ struct net_device *dev = netdev_notifier_info_to_dev(ndev); -+#else - struct net_device *dev = ndev; -+#endif - - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) - if (!dev->netdev_ops || dev->netdev_ops->ndo_do_ioctl != rtw_ioctl) diff --git a/linux-3.18.patch b/linux-3.18.patch deleted file mode 100644 index 8ee9323..0000000 --- a/linux-3.18.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- rtl8812au_linux-master/include/ioctl_cfg80211.h~ 2015-01-25 14:44:27.000000000 +0100 -+++ rtl8812au_linux-master/include/ioctl_cfg80211.h 2015-01-25 14:50:42.520814117 +0100 -@@ -145,9 +145,11 @@ - #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp) - #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) - #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp) --#else -+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)) - // 3.12 added a flags argument which is just set to zero - #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0, gfp) -+#else -+#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0) - #endif - - #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE) diff --git a/linux-4.0.patch b/linux-4.0.patch deleted file mode 100644 index f6ce0c3..0000000 --- a/linux-4.0.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c.orig 2015-04-18 20:34:59.846186483 +0200 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2015-04-18 20:36:51.399524482 +0200 -@@ -1736,16 +1736,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; - - } -@@ -3425,7 +3425,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); ---- rtl8812au_linux-master/os_dep/linux/rtw_android.c~ 2014-07-21 15:06:45.000000000 +0200 -+++ rtl8812au_linux-master/os_dep/linux/rtw_android.c 2015-04-18 20:42:32.736205424 +0200 -@@ -342,7 +342,11 @@ - { - int cmd_num; - for(cmd_num=0 ; cmd_num= KERNEL_VERSION(4,0,0)) -+ if(0 == 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; diff --git a/linux-4.1.patch b/linux-4.1.patch deleted file mode 100644 index d3e0b73..0000000 --- a/linux-4.1.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c.orig 2015-09-27 12:11:20.000000000 +0200 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2015-09-27 13:53:42.644724720 +0200 -@@ -3741,7 +3737,11 @@ - }; - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) -+static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, unsigned char name_assign_type, struct net_device **ndev) -+#else - static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct net_device **ndev) -+#endif - { - int ret = 0; - struct net_device* mon_ndev = NULL; -@@ -3772,6 +3772,9 @@ - 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 - mon_ndev->destructor = rtw_ndev_destructor; - - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) -@@ -3836,6 +3839,9 @@ - #else - char *name, - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) -+ unsigned char name_assign_type, -+#endif - enum nl80211_iftype type, u32 *flags, struct vif_params *params) - { - int ret = 0; -@@ -3853,7 +3859,11 @@ - ret = -ENODEV; - break; - case NL80211_IFTYPE_MONITOR: -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) -+ ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, name_assign_type, &ndev); -+#else - ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, &ndev); -+#endif - break; - - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) -@@ -4130,12 +4140,15 @@ - } - - static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -- const u8 *mac) -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) -+ u8 *mac) { -+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)) -+ const u8 *mac) { - #else -- u8 *mac) --#endif -+ struct station_del_parameters *params) - { -+ const u8 *mac = params->mac; -+#endif - int ret=0; - _irqL irqL; - _list *phead, *plist; diff --git a/linux-4.11.9.patch b/linux-4.11.9.patch deleted file mode 100644 index 166138f..0000000 --- a/linux-4.11.9.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c~ 2017-07-15 22:35:08.000000000 +0900 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2017-07-15 22:35:33.436437371 +0900 -@@ -3792,7 +3792,12 @@ - #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,9)) - mon_ndev->destructor = rtw_ndev_destructor; -+#else -+ mon_ndev->needs_free_netdev = true; -+ mon_ndev->priv_destructor = rtw_ndev_destructor; -+#endif - - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) - mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops; ---- rtl8812au_linux-master/os_dep/linux/os_intfs.c~ 2017-07-15 22:29:21.000000000 +0900 -+++ rtl8812au_linux-master/os_dep/linux/os_intfs.c 2017-07-15 22:34:47.048201499 +0900 -@@ -2651,7 +2651,9 @@ - if (ndev->ieee80211_ptr) - rtw_mfree((u8 *)ndev->ieee80211_ptr, sizeof(struct wireless_dev)); - #endif -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,9)) - free_netdev(ndev); -+#endif - } - - #ifdef CONFIG_ARP_KEEP_ALIVE diff --git a/linux-4.11.patch b/linux-4.11.patch deleted file mode 100644 index 4f77368..0000000 --- a/linux-4.11.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- rtl8812au_linux-master/include/osdep_service_linux.h~ 2014-07-21 15:06:45.000000000 +0200 -+++ rtl8812au_linux-master/include/osdep_service_linux.h 2017-05-10 00:55:04.866491028 +0200 -@@ -46,6 +46,9 @@ - #endif - #include - #include -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -+ #include -+#endif - #include - #include - #include diff --git a/linux-4.12.patch b/linux-4.12.patch deleted file mode 100644 index df3b9ad..0000000 --- a/linux-4.12.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 1d3af1e8e931f6fee3ceb26cee4c8b214bb8384c Mon Sep 17 00:00:00 2001 -From: Mauro Rossi -Date: Sat, 13 May 2017 22:30:17 +0200 -Subject: [PATCH] rtl8812au: add support for kernel 4.12 - -/home/utente/nougat-x86_kernel_49/kernel/os_dep/linux/ioctl_cfg80211.c:803:3: -error: too many arguments to function 'cfg80211_roamed' - cfg80211_roamed(padapter->pnetdev - ^ - -/home/utente/nougat-x86_kernel_49/kernel/os_dep/linux/ioctl_cfg80211.c:6580:18: -error: 'WIPHY_FLAG_SUPPORTS_SCHED_SCAN' undeclared (first use in this function) - wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; - ^ ---- - os_dep/linux/ioctl_cfg80211.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c -index e040059..1cca0dd 100755 ---- a/os_dep/linux/ioctl_cfg80211.c -+++ b/os_dep/linux/ioctl_cfg80211.c -@@ -794,16 +794,32 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) - struct ieee80211_channel *notify_channel; - u32 freq; - u16 channel = cur_network->network.Configuration.DSConfig; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -+ struct cfg80211_roam_info roam_info = {}; -+#endif - - if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); - else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); - - notify_channel = ieee80211_get_channel(wiphy, freq); - #endif - - DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -+ roam_info.channel = notify_channel; -+ roam_info.bssid = cur_network->network.MacAddress; -+ roam_info.req_ie = -+ pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2; -+ roam_info.req_ie_len = -+ pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2; -+ roam_info.resp_ie = -+ pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6; -+ roam_info.resp_ie_len = -+ pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6; -+ cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); -+#else - cfg80211_roamed(padapter->pnetdev - #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) - , notify_channel -@@ -810,6 +826,7 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) - , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 - , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 - , GFP_ATOMIC); -+#endif - } - else - { -@@ -6577,7 +6594,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy) - #endif - - #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) - wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; -+#else // kernel >= 4.12 -+ wiphy->max_sched_scan_reqs = 1; -+#endif - #ifdef CONFIG_PNO_SUPPORT - wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; - #endif ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c~ 2017-08-01 11:09:27.000000000 +0200 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2017-08-01 11:11:56.007409963 +0200 -@@ -1824,7 +1824,11 @@ - */ - static int cfg80211_rtw_change_iface(struct wiphy *wiphy, - struct net_device *ndev, -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) - enum nl80211_iftype type, u32 *flags, -+#else -+ enum nl80211_iftype type, -+#endif - struct vif_params *params) - { - enum nl80211_iftype old_type; -@@ -3882,7 +3882,11 @@ - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) - unsigned char name_assign_type, - #endif -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) - enum nl80211_iftype type, u32 *flags, struct vif_params *params) -+#else -+ enum nl80211_iftype type, struct vif_params *params) -+#endif - { - int ret = 0; - struct net_device* ndev = NULL; diff --git a/linux-4.2.patch b/linux-4.2.patch deleted file mode 100644 index b76e0a8..0000000 --- a/linux-4.2.patch +++ /dev/null @@ -1,144 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c.orig 2015-09-27 12:11:20.000000000 +0200 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2015-09-27 13:53:42.644724720 +0200 -@@ -860,17 +860,17 @@ - #endif //CONFIG_P2P - - if (!padapter->mlmepriv.not_indic_disco) { -- DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state); -- -- if(pwdev->sme_state==CFG80211_SME_CONNECTING) -+ if (check_fwstate(pmlmepriv, WIFI_UNDER_LINKING)) { - cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0, - WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); -- else if(pwdev->sme_state==CFG80211_SME_CONNECTED) -+ } else { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) - cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC); -- //else -- //DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state); -- -- DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); -+#else -+ cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, false, GFP_ATOMIC); -+#endif -+ } -+ DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); - } - } - ---- rtl8812au_linux-master/hal/hal_com_phycfg.c.orig 2015-09-27 13:54:46.694957018 +0200 -+++ rtl8812au_linux-master/hal/hal_com_phycfg.c 2015-09-27 13:57:14.855000882 +0200 -@@ -2575,7 +2575,7 @@ - #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE - - extern char *rtw_phy_file_path; --char file_path[PATH_LENGTH_MAX]; -+char rtw_file_path[PATH_LENGTH_MAX]; - - #define GetLineFromBuffer(buffer) strsep(&buffer, "\n") - -@@ -2597,11 +2597,11 @@ - - if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; -@@ -2696,11 +2696,11 @@ - - if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; -@@ -3149,11 +3149,11 @@ - - if ((pHalData->bb_phy_reg_pg_len == 0) && (pHalData->bb_phy_reg_pg == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; -@@ -3212,11 +3212,11 @@ - - if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; -@@ -3348,11 +3348,11 @@ - - if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; -@@ -3626,11 +3626,11 @@ - - if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; -@@ -3995,11 +3995,11 @@ - - if ((pHalData->rf_tx_pwr_lmt_len == 0) && (pHalData->rf_tx_pwr_lmt == NULL)) - { -- rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); -+ rtw_merge_string(rtw_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - -- if (rtw_is_file_readable(file_path) == _TRUE) -+ if (rtw_is_file_readable(rtw_file_path) == _TRUE) - { -- rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); -+ rlen = rtw_retrive_from_file(rtw_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) - { - rtStatus = _SUCCESS; diff --git a/linux-4.3.patch b/linux-4.3.patch deleted file mode 100644 index 9976219..0000000 --- a/linux-4.3.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- rtl8812au_linux-master/include/rtw_debug.h~ 2014-07-21 15:06:45.000000000 +0200 -+++ rtl8812au_linux-master/include/rtw_debug.h 2015-11-12 19:40:33.446227638 +0100 -@@ -227,7 +227,7 @@ - if (sel == RTW_DBGDUMP)\ - _DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ - else {\ -- if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ -+ _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ - } \ - }while(0) - -@@ -237,7 +237,7 @@ - if (sel == RTW_DBGDUMP)\ - DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ - else {\ -- if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ -+ _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ - } \ - }while(0) - diff --git a/linux-4.6.patch b/linux-4.6.patch deleted file mode 100644 index b6d7e03..0000000 --- a/linux-4.6.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/rtw_android.c~ 2016-06-19 17:56:30.000000000 +0200 -+++ rtl8812au_linux-master/os_dep/linux/rtw_android.c 2016-06-19 17:57:23.699243076 +0200 -@@ -574,7 +574,11 @@ - goto exit; - } - #ifdef CONFIG_COMPAT -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) - if (is_compat_task()) { -+#else -+ if (in_compat_syscall()) { -+#endif - /* User space is 32-bit, use compat ioctl */ - compat_android_wifi_priv_cmd compat_priv_cmd; - diff --git a/linux-4.7.patch b/linux-4.7.patch deleted file mode 100644 index 7cea561..0000000 --- a/linux-4.7.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c.orig 2016-08-01 21:49:34.559616222 +0200 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2016-08-01 21:50:12.690473128 +0200 -@@ -25,6 +25,13 @@ - - #include - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) -+#define ieee80211_band nl80211_band -+#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ -+#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ -+#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS -+#endif -+ - #define RTW_MAX_MGMT_TX_CNT (8) - - #define RTW_SCAN_IE_LEN_MAX 2304 ---- rtl8812au_linux-master/os_dep/linux/wifi_regd.c.orig 2016-08-01 21:49:41.259767005 +0200 -+++ rtl8812au_linux-master/os_dep/linux/wifi_regd.c 2016-08-01 21:50:02.516911448 +0200 -@@ -10,6 +10,13 @@ - - #include - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) -+#define ieee80211_band nl80211_band -+#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ -+#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ -+#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS -+#endif -+ - static struct country_code_to_enum_rd allCountries[] = { - {COUNTRY_CODE_USER, "RD"}, - }; -@@ -559,4 +566,4 @@ - - _rtw_reg_notifier_apply(wiphy, request, reg); - } --#endif //CONFIG_IOCTL_CFG80211 -\ No newline at end of file -+#endif //CONFIG_IOCTL_CFG80211 diff --git a/linux-4.8.patch b/linux-4.8.patch deleted file mode 100644 index 8cee88e..0000000 --- a/linux-4.8.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c.orig 2016-10-11 22:43:33.301619693 +0200 -+++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2016-10-11 22:45:03.937470268 +0200 -@@ -1946,7 +1946,14 @@ - } - else - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = aborted -+ }; -+ cfg80211_scan_done(pwdev_priv->scan_request, &info); -+#else - cfg80211_scan_done(pwdev_priv->scan_request, aborted); -+#endif - } - - pwdev_priv->scan_request = NULL; diff --git a/rtl8812au.spec b/rtl8812au.spec index 43cb3df..6c58ba3 100644 --- a/rtl8812au.spec +++ b/rtl8812au.spec @@ -1,4 +1,3 @@ -# TODO: consider migrating to https://github.com/zebulon2/rtl8812au / https://aur.archlinux.org/packages/rtl8812au-v5-dkms-git/ # # Conditional build: %bcond_with verbose # verbose build (V=1) @@ -6,38 +5,22 @@ # nothing to be placed to debuginfo package %define _enable_debug_packages 0 -%define rel 16 -%define snap 20140901 +%define rel 1 +%define snap 20171010 %define pname rtl8812au Summary: Driver for AC1200 (802.11ac) Wireless Dual-Band USB Adapter Name: %{pname}%{_alt_kernel} -Version: 4.3.2_11100.20140411 +Version: 5.1.5_19247.20160830 Release: 0.%{snap}.%{rel}%{?_pld_builder:@%{_kernel_ver_str}} License: GPL Group: Base/Kernel -#Source0: https://github.com/abperiasamy/rtl8812AU_8821AU_linux/archive/master/%{name}-%{version}-%{snap}.tar.gz -Source0: https://github.com/austinmarton/rtl8812au_linux/archive/master/%{pname}-%{version}-%{snap}.tar.gz -# Source0-md5: 693825ab344b68a1217f20ab8dd98b82 +Source0: https://github.com/zebulon2/rtl8812au/archive/v5.1.5/%{pname}-%{version}-%{snap}.tar.gz +# Source0-md5: 41bc57b642e5eda5a449b3b80f0e90fe # good luck finding this chip on Realtek website :/ #URL: http://www.realtek.com.tw/ -URL: https://github.com/austinmarton/rtl8812au_linux -Patch0: linux-3.11.patch -Patch1: disable-debug.patch -Patch2: enable-cfg80211-support.patch -Patch3: update-cfg80211-support.patch -Patch4: warnings.patch -Patch5: gcc-4.9.patch -Patch6: linux-3.18.patch -Patch7: linux-4.0.patch -Patch8: linux-4.1.patch -Patch9: linux-4.2.patch -Patch10: linux-4.3.patch -Patch11: linux-4.6.patch -Patch12: linux-4.7.patch -Patch13: linux-4.8.patch -Patch14: linux-4.11.patch -Patch15: linux-4.11.9.patch -Patch16: linux-4.12.patch +#URL: http://www.tenda.com.cn/product/download/U12.html +URL: https://github.com/zebulon2/rtl8812au +Patch0: gcc-4.9.patch BuildRequires: rpmbuild(macros) >= 1.701 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2} BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n) @@ -77,25 +60,8 @@ Driver for AC1200 (802.11ac) Wireless Dual-Band USB Adapter\ %{expand:%create_kernel_packages} %prep -#%setup -q -n %{pname}-%{version} -%setup -q -n rtl8812au_linux-master +%setup -q -n %{pname}-5.1.5 %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 %build %{expand:%build_kernel_packages} diff --git a/update-cfg80211-support.patch b/update-cfg80211-support.patch deleted file mode 100644 index ca270d1..0000000 --- a/update-cfg80211-support.patch +++ /dev/null @@ -1,209 +0,0 @@ -diff --git a/include/ioctl_cfg80211.h b/include/ioctl_cfg80211.h -index df878ea..b3431c3 100644 ---- a/include/ioctl_cfg80211.h -+++ b/include/ioctl_cfg80211.h -@@ -143,8 +143,11 @@ bool rtw_cfg80211_pwr_mgmt(_adapter *adapter); - #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp) - #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) - #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp) --#else -+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) - #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp) -+#else -+// 3.12 added a flags argument which is just set to zero -+#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0, gfp) - #endif - - #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE) -diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c -index 3abcad9..3a5f667 100644 ---- a/os_dep/linux/ioctl_cfg80211.c -+++ b/os_dep/linux/ioctl_cfg80211.c -@@ -642,6 +642,11 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) - struct wlan_network *cur_network = &(pmlmepriv->cur_network); - struct wireless_dev *pwdev = padapter->rtw_wdev; - struct cfg80211_bss *bss = NULL; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) -+ WLAN_BSSID_EX *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network); -+ struct ieee80211_channel *chan = NULL; -+ u32 freq; -+#endif - - DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); - if (pwdev->iftype != NL80211_IFTYPE_ADHOC) -@@ -693,7 +698,20 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" BSS not found !!\n", FUNC_ADPT_ARG(padapter)); - } - //notify cfg80211 that device joined an IBSS -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) -+ if (!(pnetwork) || !(padapter->rtw_wdev)) -+ return; -+ -+ if (pnetwork->Configuration.DSConfig <= RTW_CH_MAX_2G_CHANNEL) -+ freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_2GHZ); -+ else -+ freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_5GHZ); -+ -+ chan = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq); -+ cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, chan, GFP_ATOMIC); -+#else - cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, GFP_ATOMIC); -+#endif - } - - void rtw_cfg80211_indicate_connect(_adapter *padapter) -@@ -792,14 +810,18 @@ check_bss: - } - else - { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) - DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state); -+#endif - cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress - , pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2 - , pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2 - , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 - , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 - , WLAN_STATUS_SUCCESS, GFP_ATOMIC); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) - DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); -+#endif - } - } - -@@ -1666,7 +1692,11 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, - - static int cfg80211_rtw_get_station(struct wiphy *wiphy, - struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -+ const u8 *mac, struct station_info *sinfo) -+#else - u8 *mac, struct station_info *sinfo) -+#endif - { - int ret = 0; - _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); -@@ -4070,7 +4096,11 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) - #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) - - static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -+ const u8 *mac, struct station_parameters *params) -+#else - u8 *mac, struct station_parameters *params) -+#endif - { - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - -@@ -4078,7 +4104,11 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev - } - - static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -+ const u8 *mac) -+#else - u8 *mac) -+#endif - { - int ret=0; - _irqL irqL; -@@ -4169,7 +4195,11 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev - } - - static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -+ const u8 *mac, struct station_parameters *params) -+#else - u8 *mac, struct station_parameters *params) -+#endif - { - DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - -@@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, - #else - struct net_device *ndev, - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) -+ struct cfg80211_mgmt_tx_params *params, -+#else - struct ieee80211_channel *chan, - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) - bool offchan, -@@ -5017,11 +5046,17 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - bool dont_wait_for_ack, - #endif -+#endif - u64 *cookie) - { - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) - struct net_device *ndev = wdev_to_ndev(wdev); - #endif -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) -+ struct ieee80211_channel *chan = params->chan; -+ const u8 *buf = params->buf; -+ size_t len = params->len; -+#endif - int ret = 0; - int tx_ret; - u32 dump_limit = RTW_MAX_MGMT_TX_CNT; -@@ -5897,7 +5932,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) - #endif - - #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) -+ wiphy->wowlan = &wowlan_stub; -+#else - wiphy->wowlan = wowlan_stub; -+#endif - #endif - - #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c -index faa2c14..6c1b90d 100644 ---- a/os_dep/linux/wifi_regd.c -+++ b/os_dep/linux/wifi_regd.c -@@ -270,9 +270,14 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy) - #ifdef CONFIG_DFS - if (!(ch->flags & IEEE80211_CHAN_DISABLED)) - ch->flags |= IEEE80211_CHAN_RADAR | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) -+ IEEE80211_CHAN_NO_IR; -+#else - IEEE80211_CHAN_NO_IBSS; - #endif - -+#endif -+ - #if 0 - /* - * We always enable radar detection/DFS on this -@@ -357,7 +362,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy) - ch = ieee80211_get_channel(wiphy, freq); - if (ch) { - if (channel_set[i].ScanType == SCAN_PASSIVE) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) -+ ch->flags = IEEE80211_CHAN_NO_IR; -+#else - ch->flags = IEEE80211_CHAN_PASSIVE_SCAN; -+#endif - else - ch->flags = 0; - } -@@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, - - wiphy->reg_notifier = reg_notifier; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) -+ wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; -+ wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; -+ wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; -+ -+#else - wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; - wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY; - wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS; -+#endif - - regd = _rtw_regdomain_select(reg); - wiphy_apply_custom_regulatory(wiphy, regd); diff --git a/warnings.patch b/warnings.patch deleted file mode 100644 index fc29dea..0000000 --- a/warnings.patch +++ /dev/null @@ -1,146 +0,0 @@ -diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c -index 255453b..87e6840 100644 ---- a/core/rtw_ioctl_set.c -+++ b/core/rtw_ioctl_set.c -@@ -31,7 +31,7 @@ extern void indicate_wx_scan_complete_event(_adapter *padapter); - (addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \ - ) - --u8 rtw_validate_bssid(u8 *bssid) -+u8 rtw_validate_bssid(const u8 *bssid) - { - u8 ret = _TRUE; - -@@ -525,7 +525,7 @@ _func_exit_; - - } - --u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid) -+u8 rtw_set_802_11_connect(_adapter* padapter, const u8 *bssid, NDIS_802_11_SSID *ssid) - { - _irqL irqL; - u8 status = _SUCCESS; -diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c -index f03f727..d425120 100644 ---- a/core/rtw_sta_mgt.c -+++ b/core/rtw_sta_mgt.c -@@ -685,7 +685,7 @@ _func_exit_; - } - - /* any station allocated can be searched by hash list */ --struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) -+struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr) - { - - _irqL irqL; -@@ -696,7 +696,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) - - u32 index; - -- u8 *addr; -+ const u8 *addr; - - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; - -diff --git a/include/osdep_service.h b/include/osdep_service.h -index 76026b9..25809e4 100644 ---- a/include/osdep_service.h -+++ b/include/osdep_service.h -@@ -255,8 +255,8 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a - extern void* rtw_malloc2d(int h, int w, int size); - extern void rtw_mfree2d(void *pbuf, int h, int w, int size); - --extern void _rtw_memcpy(void* dec, void* sour, u32 sz); --extern int _rtw_memcmp(void *dst, void *src, u32 sz); -+extern void _rtw_memcpy(void* dec, const void* sour, u32 sz); -+extern int _rtw_memcmp(const void *dst, const void *src, u32 sz); - extern void _rtw_memset(void *pbuf, int c, u32 sz); - - extern void _rtw_init_listhead(_list *list); -diff --git a/include/rtw_ioctl_set.h b/include/rtw_ioctl_set.h -index da08376..10b3507 100644 ---- a/include/rtw_ioctl_set.h -+++ b/include/rtw_ioctl_set.h -@@ -60,10 +60,10 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter* padapter, NDIS_802_11_SSID *pssid, i - u8 rtw_set_802_11_infrastructure_mode(_adapter * padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); - u8 rtw_set_802_11_remove_wep(_adapter * padapter, u32 keyindex); - u8 rtw_set_802_11_ssid(_adapter * padapter, NDIS_802_11_SSID * ssid); --u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid); -+u8 rtw_set_802_11_connect(_adapter* padapter, const u8 *bssid, NDIS_802_11_SSID *ssid); - u8 rtw_set_802_11_remove_key(_adapter * padapter, NDIS_802_11_REMOVE_KEY * key); - --u8 rtw_validate_bssid(u8 *bssid); -+u8 rtw_validate_bssid(const u8 *bssid); - u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid); - - u16 rtw_get_cur_max_rate(_adapter *adapter); -diff --git a/include/sta_info.h b/include/sta_info.h -index 15964d7..553d5ab 100644 ---- a/include/sta_info.h -+++ b/include/sta_info.h -@@ -443,7 +443,7 @@ struct sta_priv { - }; - - --__inline static u32 wifi_mac_hash(u8 *mac) -+__inline static u32 wifi_mac_hash(const u8 *mac) - { - u32 x; - -@@ -471,7 +471,7 @@ struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset) - extern struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr); - extern u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta); - extern void rtw_free_all_stainfo(_adapter *padapter); --extern struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr); -+extern struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr); - extern u32 rtw_init_bcmc_stainfo(_adapter* padapter); - extern struct sta_info* rtw_get_bcmc_stainfo(_adapter* padapter); - extern u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr); -diff --git a/include/wifi.h b/include/wifi.h -index dff95b4..d148ba8 100644 ---- a/include/wifi.h -+++ b/include/wifi.h -@@ -431,7 +431,7 @@ enum WIFI_REG_DOMAIN { - (addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \ - ) - --__inline static int IS_MCAST(unsigned char *da) -+__inline static int IS_MCAST(const unsigned char *da) - { - if ((*da) & 0x01) - return _TRUE; -diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c -index 3abcad9..4b6ce41 100644 ---- a/os_dep/linux/ioctl_cfg80211.c -+++ b/os_dep/linux/ioctl_cfg80211.c -@@ -2584,7 +2610,7 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key - return 0; - } - --static int rtw_cfg80211_set_wpa_ie(_adapter *padapter, u8 *pie, size_t ielen) -+static int rtw_cfg80211_set_wpa_ie(_adapter *padapter, const u8 *pie, size_t ielen) - { - u8 *buf=NULL, *pos=NULL; - u32 left; -diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c -index 97a904b..ae46f26 100644 ---- a/os_dep/osdep_service.c -+++ b/os_dep/osdep_service.c -@@ -804,7 +804,7 @@ void rtw_mfree2d(void *pbuf, int h, int w, int size) - rtw_mfree((u8 *)pbuf, h*sizeof(void*) + w*h*size); - } - --void _rtw_memcpy(void* dst, void* src, u32 sz) -+void _rtw_memcpy(void* dst, const void* src, u32 sz) - { - - #if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD) -@@ -821,7 +821,7 @@ void _rtw_memcpy(void* dst, void* src, u32 sz) - - } - --int _rtw_memcmp(void *dst, void *src, u32 sz) -+int _rtw_memcmp(const void *dst, const void *src, u32 sz) - { - - #if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)