diff --git a/lib/compilation-prepare.sh b/lib/compilation-prepare.sh index a56357223..8134fa5c7 100644 --- a/lib/compilation-prepare.sh +++ b/lib/compilation-prepare.sh @@ -293,6 +293,9 @@ compilation_prepare() sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8189es\/Kconfig"' \ "$kerneldir/drivers/net/wireless/Kconfig" + # add support for 5.19.2 + process_patch_file "${SRC}/patch/misc/wireless-rtl8189es-5.19.2.patch" "applying" + fi @@ -328,6 +331,9 @@ compilation_prepare() sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8189fs\/Kconfig"' \ "$kerneldir/drivers/net/wireless/Kconfig" + # add support for 5.19.2 + process_patch_file "${SRC}/patch/misc/wireless-rtl8189fs-5.19.2.patch" "applying" + fi @@ -363,6 +369,9 @@ compilation_prepare() sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8192eu\/Kconfig"' \ "$kerneldir/drivers/net/wireless/Kconfig" + # add support for 5.19.2 + process_patch_file "${SRC}/patch/misc/wireless-rtl8192eu-5.19.2.patch" "applying" + fi @@ -397,6 +406,9 @@ compilation_prepare() sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8812au\/Kconfig"' \ "$kerneldir/drivers/net/wireless/Kconfig" + # add support for 5.19.2 + process_patch_file "${SRC}/patch/misc/wireless-rtl8812au-5.19.2.patch" "applying" + fi @@ -479,6 +491,9 @@ compilation_prepare() # add support for 5.18.y process_patch_file "${SRC}/patch/misc/wireless-rtl8821cu.patch" "applying" + # add support for 5.19.2 + process_patch_file "${SRC}/patch/misc/wireless-rtl8811cu-5.19.2.patch" "applying" + fi @@ -653,6 +668,8 @@ compilation_prepare() sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8723ds\/Kconfig"' \ "$kerneldir/drivers/net/wireless/Kconfig" + process_patch_file "${SRC}/patch/misc/wireless-rtl8723ds-5.19.2.patch" "applying" + fi @@ -662,12 +679,7 @@ compilation_prepare() if linux-version compare $version ge 5.0 && [ "$EXTRAWIFI" == yes ]; then - # attach to specifics tag or branch - if linux-version compare $version ge 5.12 ; then - local rtl8723duver="branch:v5.13.4" - else - local rtl8723duver="branch:master" - fi + local rtl8723duver="branch:master" display_alert "Adding" "Wireless drivers for Realtek 8723DU chipsets ${rtl8723duver}" "info" @@ -691,7 +703,7 @@ compilation_prepare() sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8723du\/Kconfig"' \ $kerneldir/drivers/net/wireless/Kconfig - process_patch_file "${SRC}/patch/misc/wireless-rtl8723du.patch" "applying" + process_patch_file "${SRC}/patch/misc/wireless-rtl8723du-5.19.2.patch" "applying" fi diff --git a/patch/kernel/archive/sunxi-5.18/patches.armbian/wireless-Add-uwe5622-driver.patch b/patch/kernel/archive/sunxi-5.18/patches.armbian/wireless-Add-uwe5622-driver.patch index d7fdce3bb..34ad34a2d 100644 --- a/patch/kernel/archive/sunxi-5.18/patches.armbian/wireless-Add-uwe5622-driver.patch +++ b/patch/kernel/archive/sunxi-5.18/patches.armbian/wireless-Add-uwe5622-driver.patch @@ -178065,7 +178065,7 @@ new file mode 100644 index 000000000..daef880ae --- /dev/null +++ b/drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c -@@ -0,0 +1,3940 @@ +@@ -0,0 +1,3944 @@ +/* + * Copyright (C) 2015 Spreadtrum Communications Inc. + * @@ -179052,7 +179052,11 @@ index 000000000..daef880ae + return sprdwl_change_beacon(vif, beacon); +} + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int sprdwl_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else +static int sprdwl_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif +{ +#ifdef DFS_MASTER + struct sprdwl_vif *vif = netdev_priv(ndev); @@ -182237,7 +182241,7 @@ new file mode 100644 index 000000000..e81619b12 --- /dev/null +++ b/drivers/net/wireless/uwe5622/unisocwifi/cmdevt.c -@@ -0,0 +1,3615 @@ +@@ -0,0 +1,3619 @@ +/* + * Copyright (C) 2015 Spreadtrum Communications Inc. + * @@ -185536,7 +185540,11 @@ index 000000000..e81619b12 + NL80211_CHAN_HT20); + else + wl_err("%s, ch is null!\n", __func__); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(vif->ndev, &chandef, 0); ++#else + cfg80211_ch_switch_notify(vif->ndev, &chandef); ++#endif + } +} + diff --git a/patch/kernel/archive/sunxi-5.19/patches.armbian/wireless-Add-uwe5622-driver.patch b/patch/kernel/archive/sunxi-5.19/patches.armbian/wireless-Add-uwe5622-driver.patch index f4db79b28..faf26bfa9 100644 --- a/patch/kernel/archive/sunxi-5.19/patches.armbian/wireless-Add-uwe5622-driver.patch +++ b/patch/kernel/archive/sunxi-5.19/patches.armbian/wireless-Add-uwe5622-driver.patch @@ -443,7 +443,7 @@ index cb1c15012..83e0e54ee 100644 source "drivers/net/wireless/zydas/Kconfig" source "drivers/net/wireless/quantenna/Kconfig" +source "drivers/net/wireless/uwe5622/Kconfig" - + config PCMCIA_RAYCS tristate "Aviator/Raytheon 2.4GHz wireless support" diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile @@ -455,7 +455,7 @@ index a61cf6c90..952e6bdd8 100644 obj-$(CONFIG_WLAN_VENDOR_TI) += ti/ obj-$(CONFIG_WLAN_VENDOR_ZYDAS) += zydas/ +obj-$(CONFIG_SPARD_WLAN_SUPPORT) += uwe5622/ - + # 16-bit wireless PCMCIA client drivers obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o diff --git a/drivers/net/wireless/uwe5622/Kconfig b/drivers/net/wireless/uwe5622/Kconfig @@ -178065,7 +178065,7 @@ new file mode 100644 index 000000000..daef880ae --- /dev/null +++ b/drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c -@@ -0,0 +1,3940 @@ +@@ -0,0 +1,3944 @@ +/* + * Copyright (C) 2015 Spreadtrum Communications Inc. + * @@ -179052,7 +179052,11 @@ index 000000000..daef880ae + return sprdwl_change_beacon(vif, beacon); +} + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int sprdwl_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else +static int sprdwl_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif +{ +#ifdef DFS_MASTER + struct sprdwl_vif *vif = netdev_priv(ndev); @@ -182237,7 +182241,7 @@ new file mode 100644 index 000000000..e81619b12 --- /dev/null +++ b/drivers/net/wireless/uwe5622/unisocwifi/cmdevt.c -@@ -0,0 +1,3615 @@ +@@ -0,0 +1,3619 @@ +/* + * Copyright (C) 2015 Spreadtrum Communications Inc. + * @@ -185536,7 +185540,11 @@ index 000000000..e81619b12 + NL80211_CHAN_HT20); + else + wl_err("%s, ch is null!\n", __func__); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(vif->ndev, &chandef, 0); ++#else + cfg80211_ch_switch_notify(vif->ndev, &chandef); ++#endif + } +} + @@ -211811,6 +211819,6 @@ index 000000000..4e745903e +void sprdwl_deinit_work(struct sprdwl_priv *priv); + +#endif --- +-- 2.35.3 diff --git a/patch/misc/wireless-rtl8189es-5.19.2.patch b/patch/misc/wireless-rtl8189es-5.19.2.patch new file mode 100644 index 000000000..229f3395b --- /dev/null +++ b/patch/misc/wireless-rtl8189es-5.19.2.patch @@ -0,0 +1,251 @@ +From fb54d50700c3aa4d31ffb8388c0528b26d0dad32 Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Fri, 19 Aug 2022 06:54:27 +0200 +Subject: [PATCH] Support for 5.19.2 + +Signed-off-by: Igor Pecovnik +--- + .../rtl8189es/os_dep/linux/ioctl_cfg80211.c | 62 ++++++++++++------- + 1 file changed, 40 insertions(+), 22 deletions(-) + +diff --git a/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c +index 6a8ec2796cd9..4e752b944f05 100644 +--- a/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c +@@ -82,7 +82,7 @@ + #endif + + /* +- * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) ++ * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) + * when Wi-Fi driver decides to abort the scan request in the scan flow by default. + * Defining this flag makes Wi-Fi driver to return -EBUSY to the system if Wi-Fi driver is too busy to do the scan. + */ +@@ -219,7 +219,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def(struct wiphy *wiphy, struct cfg80211_cha + if (!chan) + goto exit; + +- if (bw == CHANNEL_WIDTH_20) ++ if (bw == CHANNEL_WIDTH_20) + chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT; + else if (bw == CHANNEL_WIDTH_40) + chdef->width = NL80211_CHAN_WIDTH_40; +@@ -280,7 +280,7 @@ static void rtw_get_chbw_from_cfg80211_chan_def(struct cfg80211_chan_def *chdef, + rtw_warn_on(1); + *ch = 0; + return; +- } ++ } + + switch (chdef->width) { + case NL80211_CHAN_WIDTH_20_NOHT: +@@ -439,7 +439,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 + if (ret != _SUCCESS) + goto exit; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); ++#endif + + #else + int freq = rtw_ch2freq(ch); +@@ -1112,7 +1116,11 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ roam_info.links[0].bssid = cur_network->network.MacAddress; ++#else + roam_info.bssid = cur_network->network.MacAddress; ++#endif + 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; +@@ -1614,8 +1622,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param + _rtw_memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); + _rtw_memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + padapter->securitypriv.binstallGrpkey = _TRUE; +- if (param->u.crypt.idx < 4) +- _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); ++ if (param->u.crypt.idx < 4) ++ _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); + padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx; + rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, _TRUE); + +@@ -1863,7 +1871,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + || (MLME_IS_STA(adapter) && !pairwise) + #endif +- ) { ++ ) { + /* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */ + if (is_wep_enc(sec->dot118021XGrpPrivacy)) { + if (keyid >= WEP_KEYS) +@@ -1952,7 +1960,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + } + + ret = 0; +- ++ + exit: + RTW_INFO(FUNC_NDEV_FMT + GET_KEY_PARAM_FMT_S +@@ -5138,7 +5146,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif + { + _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); + +@@ -5754,7 +5766,7 @@ static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *n + if (del_sta) { + u8 sta_addr[ETH_ALEN]; + u8 updated = _FALSE; +- ++ + _rtw_memcpy(sta_addr, del_sta->cmn.mac_addr, ETH_ALEN); + updated = ap_free_sta(adapter, del_sta, 0, 0, 1); + rtw_mesh_expire_peer(stapriv->padapter, sta_addr); +@@ -5840,7 +5852,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *nde + else + _rtw_memcpy(mac, plink->addr, ETH_ALEN); + #endif +- ++ + sinfo->filled = 0; + + if (psta) { +@@ -7979,7 +7991,7 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "path_refresh_time:%u\n", conf->path_refresh_time); + RTW_PRINT_SEL(sel, "min_discovery_timeout:%u\n", conf->min_discovery_timeout); + RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathTimeout:%u\n", conf->dot11MeshHWMPactivePathTimeout); +- RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); ++ RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)) + RTW_PRINT_SEL(sel, "dot11MeshHWMPperrMinInterval:%u\n", conf->dot11MeshHWMPperrMinInterval); + #endif +@@ -7994,11 +8006,11 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "dot11MeshForwarding:%d\n", conf->dot11MeshForwarding); + RTW_PRINT_SEL(sel, "rssi_threshold:%d\n", conf->rssi_threshold); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) + RTW_PRINT_SEL(sel, "ht_opmode:0x%04x\n", conf->ht_opmode); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathToRootTimeout:%u\n", conf->dot11MeshHWMPactivePathToRootTimeout); + RTW_PRINT_SEL(sel, "dot11MeshHWMProotInterval:%u\n", conf->dot11MeshHWMProotInterval); +@@ -8009,7 +8021,7 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "power_mode:%s\n", nl80211_mesh_power_mode_str(conf->power_mode)); + RTW_PRINT_SEL(sel, "dot11MeshAwakeWindowDuration:%u\n", conf->dot11MeshAwakeWindowDuration); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + RTW_PRINT_SEL(sel, "plink_timeout:%u\n", conf->plink_timeout); + #endif +@@ -8145,14 +8157,14 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi + if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)); + #endif + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask)) + mcfg->dot11MeshHWMPactivePathToRootTimeout = conf->dot11MeshHWMPactivePathToRootTimeout; + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) + mcfg->dot11MeshHWMProotInterval = conf->dot11MeshHWMProotInterval; + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask)) +- mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; ++ mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; + #endif + + #if 0 /* TBD */ +@@ -8210,7 +8222,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte + #endif + if (!ch) + goto exit; +- ++ + #if defined(CONFIG_80211AC_VHT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + vht = ht && ch > 14 && bw >= CHANNEL_WIDTH_80; /* VHT40/VHT20? */ + #endif +@@ -8541,7 +8553,7 @@ static int cfg80211_rtw_join_mesh(struct wiphy *wiphy, struct net_device *dev, + ret = -EINVAL; + goto exit; + } +- ++ + rtw_mesh_work(&adapter->mesh_work); + + exit: +@@ -8621,7 +8633,7 @@ static int cfg80211_rtw_del_mpath(struct wiphy *wiphy, struct net_device *dev + } + } else { + rtw_mesh_path_flush_by_iface(adapter); +- } ++ } + + exit: + return ret; +@@ -8922,13 +8934,13 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { + //rtw_sitesurvey_cmd(padapter, NULL); + rtw_sitesurvey_cmd(padapter, &parm); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +- ++ + for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) { + if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE) + break; + rtw_msleep_os(1000); + } +- ++ + _enter_critical_bh(&pmlmepriv->lock, &irqL); + cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +@@ -8936,7 +8948,7 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { + } + RTW_DBG("<== %s\n",__func__); + return 0; +- ++ + } + #endif /* CONFIG_PNO_SUPPORT */ + +@@ -9827,7 +9839,7 @@ int rtw_hostapd_acs_dump_survey(struct wiphy *wiphy, struct net_device *netdev, + #elif defined(CONFIG_RTW_ACS) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + rtw_cfg80211_set_survey_info_with_clm(padapter, idx, info); + #else +- RTW_ERR("%s: unknown acs operation!\n", __func__); ++ RTW_ERR("%s: unknown acs operation!\n", __func__); + #endif + + return ret; +@@ -10237,7 +10249,13 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + } +-- +Created with Armbian build tools https://github.com/armbian/build + diff --git a/patch/misc/wireless-rtl8189fs-5.19.2.patch b/patch/misc/wireless-rtl8189fs-5.19.2.patch new file mode 100644 index 000000000..39abb6080 --- /dev/null +++ b/patch/misc/wireless-rtl8189fs-5.19.2.patch @@ -0,0 +1,56 @@ +From 564440f99a06e17d09dabb6cc87ba2b208338de0 Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Fri, 19 Aug 2022 07:07:02 +0200 +Subject: [PATCH] Support for 5.19.2 + +Signed-off-by: Igor Pecovnik +--- + .../rtl8189fs/os_dep/linux/ioctl_cfg80211.c | 59 +++-- + 1 files changed, 272 insertions(+), 23 deletions(-) + +diff --git a/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c +index f6105decf9e2..a31856bc86b6 100644 +--- a/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c +@@ -418,8 +418,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 + ret = rtw_chbw_to_cfg80211_chan_def(wiphy, &chdef, ch, bw, offset, ht); + if (ret != _SUCCESS) + goto exit; +- ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); ++#endif + + #else + int freq = rtw_ch2freq(ch); +@@ -4967,7 +4970,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif + { + _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); + +@@ -9913,7 +9920,13 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + } +-- +Created with Armbian build tools https://github.com/armbian/build + diff --git a/patch/misc/wireless-rtl8192eu-5.19.2.patch b/patch/misc/wireless-rtl8192eu-5.19.2.patch new file mode 100644 index 000000000..a570b3105 --- /dev/null +++ b/patch/misc/wireless-rtl8192eu-5.19.2.patch @@ -0,0 +1,249 @@ +diff --git a/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c +index b26aaf7fe765..790dbe9d447d 100644 +--- a/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c +@@ -82,7 +82,7 @@ + #endif + + /* +- * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) ++ * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) + * when Wi-Fi driver decides to abort the scan request in the scan flow by default. + * Defining this flag makes Wi-Fi driver to return -EBUSY to the system if Wi-Fi driver is too busy to do the scan. + */ +@@ -323,7 +323,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def(struct wiphy *wiphy, struct cfg80211_cha + if (!chan) + goto exit; + +- if (bw == CHANNEL_WIDTH_20) ++ if (bw == CHANNEL_WIDTH_20) + chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT; + else if (bw == CHANNEL_WIDTH_40) + chdef->width = NL80211_CHAN_WIDTH_40; +@@ -357,7 +357,7 @@ static void rtw_get_chbw_from_cfg80211_chan_def(struct cfg80211_chan_def *chdef, + rtw_warn_on(1); + *ch = 0; + return; +- } ++ } + + switch (chdef->width) { + case NL80211_CHAN_WIDTH_20_NOHT: +@@ -451,7 +451,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, + if (!rtw_cfg80211_allow_ch_switch_notify(adapter)) + goto exit; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); ++#endif + + #else + int freq = rtw_ch2freq(ch); +@@ -1123,7 +1127,11 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ roam_info.links[0].bssid = cur_network->network.MacAddress; ++#else + roam_info.bssid = cur_network->network.MacAddress; ++#endif + roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2; + roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2; + roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6; +@@ -1624,8 +1632,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param + memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); + memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + padapter->securitypriv.binstallGrpkey = _TRUE; +- if (param->u.crypt.idx < 4) +- memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); ++ if (param->u.crypt.idx < 4) ++ memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); + padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx; + rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, _TRUE); + +@@ -1873,7 +1881,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + || (MLME_IS_STA(adapter) && !pairwise) + #endif +- ) { ++ ) { + /* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */ + if (is_wep_enc(sec->dot118021XGrpPrivacy)) { + if (keyid >= WEP_KEYS) +@@ -1962,7 +1970,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + } + + ret = 0; +- ++ + exit: + RTW_INFO(FUNC_NDEV_FMT + GET_KEY_PARAM_FMT_S +@@ -3441,8 +3449,8 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key + psecuritypriv->rsn_akm_suite_type = 4; + } + #endif +- else if (key_mgt == WLAN_AKM_SUITE_SAE) { +- psecuritypriv->rsn_akm_suite_type = 8; ++ else if (key_mgt == WLAN_AKM_SUITE_SAE) { ++ psecuritypriv->rsn_akm_suite_type = 8; + } else { + RTW_INFO("Invalid key mgt: 0x%x\n", key_mgt); + /* return -EINVAL; */ +@@ -5073,7 +5081,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif + { + _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); + +@@ -5689,7 +5701,7 @@ static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *n + if (del_sta) { + u8 sta_addr[ETH_ALEN]; + u8 updated = _FALSE; +- ++ + memcpy(sta_addr, del_sta->cmn.mac_addr, ETH_ALEN); + updated = ap_free_sta(adapter, del_sta, 0, 0, 1); + rtw_mesh_expire_peer(stapriv->padapter, sta_addr); +@@ -5774,7 +5786,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *nde + else + memcpy(mac, plink->addr, ETH_ALEN); + #endif +- ++ + sinfo->filled = 0; + + if (psta) { +@@ -7879,7 +7891,7 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "path_refresh_time:%u\n", conf->path_refresh_time); + RTW_PRINT_SEL(sel, "min_discovery_timeout:%u\n", conf->min_discovery_timeout); + RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathTimeout:%u\n", conf->dot11MeshHWMPactivePathTimeout); +- RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); ++ RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)) + RTW_PRINT_SEL(sel, "dot11MeshHWMPperrMinInterval:%u\n", conf->dot11MeshHWMPperrMinInterval); + #endif +@@ -7894,11 +7906,11 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "dot11MeshForwarding:%d\n", conf->dot11MeshForwarding); + RTW_PRINT_SEL(sel, "rssi_threshold:%d\n", conf->rssi_threshold); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) + RTW_PRINT_SEL(sel, "ht_opmode:0x%04x\n", conf->ht_opmode); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathToRootTimeout:%u\n", conf->dot11MeshHWMPactivePathToRootTimeout); + RTW_PRINT_SEL(sel, "dot11MeshHWMProotInterval:%u\n", conf->dot11MeshHWMProotInterval); +@@ -7909,7 +7921,7 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "power_mode:%s\n", nl80211_mesh_power_mode_str(conf->power_mode)); + RTW_PRINT_SEL(sel, "dot11MeshAwakeWindowDuration:%u\n", conf->dot11MeshAwakeWindowDuration); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + RTW_PRINT_SEL(sel, "plink_timeout:%u\n", conf->plink_timeout); + #endif +@@ -8045,14 +8057,14 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi + if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)); + #endif + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask)) + mcfg->dot11MeshHWMPactivePathToRootTimeout = conf->dot11MeshHWMPactivePathToRootTimeout; + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) + mcfg->dot11MeshHWMProotInterval = conf->dot11MeshHWMProotInterval; + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask)) +- mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; ++ mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; + #endif + + #if 0 /* TBD */ +@@ -8110,7 +8122,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte + #endif + if (!ch) + goto exit; +- ++ + #if defined(CONFIG_80211AC_VHT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + vht = ht && ch > 14 && bw >= CHANNEL_WIDTH_80; /* VHT40/VHT20? */ + #endif +@@ -8441,7 +8453,7 @@ static int cfg80211_rtw_join_mesh(struct wiphy *wiphy, struct net_device *dev, + ret = -EINVAL; + goto exit; + } +- ++ + rtw_mesh_work(&adapter->mesh_work); + + exit: +@@ -8522,7 +8534,7 @@ static int cfg80211_rtw_del_mpath(struct wiphy *wiphy, struct net_device *dev + } + } else { + rtw_mesh_path_flush_by_iface(adapter); +- } ++ } + + exit: + return ret; +@@ -8823,13 +8835,13 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { + //rtw_sitesurvey_cmd(padapter, NULL); + rtw_sitesurvey_cmd(padapter, &parm); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +- ++ + for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) { + if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE) + break; + msleep(1000); + } +- ++ + _enter_critical_bh(&pmlmepriv->lock, &irqL); + cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +@@ -8837,7 +8849,7 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { + } + RTW_DBG("<== %s\n",__func__); + return 0; +- ++ + } + #endif /* CONFIG_PNO_SUPPORT */ + +@@ -9731,7 +9743,7 @@ int rtw_hostapd_acs_dump_survey(struct wiphy *wiphy, struct net_device *netdev, + #elif defined(CONFIG_RTW_ACS) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + rtw_cfg80211_set_survey_info_with_clm(padapter, idx, info); + #else +- RTW_ERR("%s: unknown acs operation!\n", __func__); ++ RTW_ERR("%s: unknown acs operation!\n", __func__); + #endif + + return ret; +@@ -10132,7 +10144,13 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + } diff --git a/patch/misc/wireless-rtl8723ds-5.19.2.patch b/patch/misc/wireless-rtl8723ds-5.19.2.patch new file mode 100644 index 000000000..3be603bf8 --- /dev/null +++ b/patch/misc/wireless-rtl8723ds-5.19.2.patch @@ -0,0 +1,85 @@ +From f1eca7fca9691f564094a0b05ab02acbb789d0aa Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Fri, 19 Aug 2022 15:43:14 +0200 +Subject: [PATCH] patch + +Signed-off-by: Igor Pecovnik +--- + .../rtl8723ds/os_dep/linux/ioctl_cfg80211.c | 24 +++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/rtl8723ds/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8723ds/os_dep/linux/ioctl_cfg80211.c +index 86bb2a2f7fe5..54c3143067c1 100644 +--- a/drivers/net/wireless/rtl8723ds/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8723ds/os_dep/linux/ioctl_cfg80211.c +@@ -342,7 +342,7 @@ static u64 rtw_get_systime_us(void) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) + ktime_t ts; + ts = ktime_get_boottime(); +- return do_div(ts, 1000); ++ return do_div(ts, 1000); + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) + struct timespec ts; + get_monotonic_boottime(&ts); +@@ -745,7 +745,11 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ roam_info.links[0].bssid = cur_network->network.MacAddress; ++#else + roam_info.bssid = cur_network->network.MacAddress; ++#endif + 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; +@@ -4189,7 +4193,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif + { + RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); + return 0; +@@ -5547,7 +5555,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const + + if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) + ext_listen_period = 500;/*500ms*/ +-#ifdef CONFIG_P2P ++#ifdef CONFIG_P2P + else + ext_listen_period = pwdinfo->ext_listen_period; + +@@ -7049,13 +7057,25 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #else + if (wdev->current_bss) { ++ #endif + u8 locally_generated = 1; + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + cfg80211_disconnected(adapter->pnetdev, 0, NULL, 0, locally_generated, GFP_ATOMIC); + } + #elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0))) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + cfg80211_disconnected(adapter->pnetdev, 0, NULL, 0, GFP_ATOMIC); + } +-- +Created with Armbian build tools https://github.com/armbian/build + diff --git a/patch/misc/wireless-rtl8723du-5.19.2.patch b/patch/misc/wireless-rtl8723du-5.19.2.patch new file mode 100644 index 000000000..14f70c983 --- /dev/null +++ b/patch/misc/wireless-rtl8723du-5.19.2.patch @@ -0,0 +1,105 @@ +From 40ac7e29eca7d71da118a0f727b9e22456453425 Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Sat, 20 Aug 2022 07:21:47 +0200 +Subject: [PATCH] fix + +Signed-off-by: Igor Pecovnik +--- + .../wireless/rtl8723du/os_dep/ioctl_cfg80211.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/wireless/rtl8723du/Kconfig b/drivers/net/wireless/rtl8723du/Kconfig +new file mode 100644 +index 000000000..63bbe8e63 +--- /dev/null ++++ b/drivers/net/wireless/rtl8723du/Kconfig +@@ -0,0 +1,4 @@ ++config RTL8723DU ++ tristate "Realtek 8723D USB WiFi" ++ help ++ Help message of RTL8723DU +diff --git a/drivers/net/wireless/rtl8723du/Makefile b/drivers/net/wireless/rtl8723du/Makefile +index 9de45eddd..172f597e1 100644 +--- a/drivers/net/wireless/rtl8723du/Makefile ++++ b/drivers/net/wireless/rtl8723du/Makefile +@@ -25,7 +25,7 @@ CONFIG_WAKEUP_TYPE = 0x7 #bit2: deauth, bit1: unicast, bit0: magic pkt. + + CONFIG_DRVEXT_MODULE = n + +-export TopDIR ?= $(shell pwd) ++export TopDIR ?= $(src) + + ########### COMMON ################################# + HCI_NAME = usb +diff --git a/drivers/net/wireless/rtl8723du/os_dep/ioctl_cfg80211.c b/drivers/net/wireless/rtl8723du/os_dep/ioctl_cfg80211.c +index 3a74d29cb..e399cfb60 100644 +--- a/drivers/net/wireless/rtl8723du/os_dep/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8723du/os_dep/ioctl_cfg80211.c +@@ -134,7 +134,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def(struct wiphy *wiphy, struct cfg80211_cha + if (!chan) + goto exit; + +- if (bw == CHANNEL_WIDTH_20) ++ if (bw == CHANNEL_WIDTH_20) + chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT; + else if (bw == CHANNEL_WIDTH_40) + chdef->width = NL80211_CHAN_WIDTH_40; +@@ -171,7 +171,7 @@ u8 rtw_cfg80211_ch_switch_notify(struct adapter *adapter, u8 ch, u8 bw, u8 offse + if (ret != _SUCCESS) + goto exit; + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2) + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); + #else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); +@@ -1186,8 +1186,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param + memcpy(adapt->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); + memcpy(adapt->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + adapt->securitypriv.binstallGrpkey = true; +- if (param->u.crypt.idx < 4) +- memcpy(adapt->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); ++ if (param->u.crypt.idx < 4) ++ memcpy(adapt->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); + adapt->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx; + rtw_set_key(adapt, &adapt->securitypriv, param->u.crypt.idx, 1, true); + +@@ -1391,7 +1391,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + || (MLME_IS_STA(adapter) && !pairwise) + #endif +- ) { ++ ) { + /* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */ + if (is_wep_enc(sec->dot118021XGrpPrivacy)) { + if (keyid >= WEP_KEYS) +@@ -1465,7 +1465,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + } + + ret = 0; +- ++ + exit: + RTW_INFO(FUNC_NDEV_FMT + GET_KEY_PARAM_FMT_S +@@ -3783,7 +3783,7 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2) + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) + #else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) +@@ -5832,7 +5832,7 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, true); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) +-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2) + if (wdev->current_bss) { + #else + if (wdev->connected) { +-- +Created with Armbian build tools https://github.com/armbian/build + diff --git a/patch/misc/wireless-rtl8723du.patch b/patch/misc/wireless-rtl8723du.patch deleted file mode 100644 index 0010bef0c..000000000 --- a/patch/misc/wireless-rtl8723du.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/drivers/net/wireless/rtl8723du/Kconfig b/drivers/net/wireless/rtl8723du/Kconfig -new file mode 100644 -index 000000000..63bbe8e63 ---- /dev/null -+++ b/drivers/net/wireless/rtl8723du/Kconfig -@@ -0,0 +1,4 @@ -+config RTL8723DU -+ tristate "Realtek 8723D USB WiFi" -+ help -+ Help message of RTL8723DU -diff --git a/drivers/net/wireless/rtl8723du/Makefile b/drivers/net/wireless/rtl8723du/Makefile -index 9de45eddd..172f597e1 100644 ---- a/drivers/net/wireless/rtl8723du/Makefile -+++ b/drivers/net/wireless/rtl8723du/Makefile -@@ -25,7 +25,7 @@ CONFIG_WAKEUP_TYPE = 0x7 #bit2: deauth, bit1: unicast, bit0: magic pkt. - - CONFIG_DRVEXT_MODULE = n - --export TopDIR ?= $(shell pwd) -+export TopDIR ?= $(src) - - ########### COMMON ################################# - HCI_NAME = usb diff --git a/patch/misc/wireless-rtl8811cu-5.19.2.patch b/patch/misc/wireless-rtl8811cu-5.19.2.patch new file mode 100644 index 000000000..ead4413f2 --- /dev/null +++ b/patch/misc/wireless-rtl8811cu-5.19.2.patch @@ -0,0 +1,242 @@ +From 3c2f7f560304d97eb29c4616aa39c95a60470b53 Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Fri, 19 Aug 2022 08:12:57 +0200 +Subject: [PATCH] Support for 5.19.x + +Signed-off-by: Igor Pecovnik +--- + .../rtl8811cu/os_dep/linux/ioctl_cfg80211.c | 60 ++++++++++++------- + 1 file changed, 39 insertions(+), 21 deletions(-) + +diff --git a/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c +index d9c81c9947fc..d13b0bd72fde 100644 +--- a/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c +@@ -80,7 +80,7 @@ + #endif + + /* +- * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) ++ * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) + * when Wi-Fi driver decides to abort the scan request in the scan flow by default. + * Defining this flag makes Wi-Fi driver to return -EBUSY to the system if Wi-Fi driver is too busy to do the scan. + */ +@@ -321,7 +321,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def(struct wiphy *wiphy, struct cfg80211_cha + if (!chan) + goto exit; + +- if (bw == CHANNEL_WIDTH_20) ++ if (bw == CHANNEL_WIDTH_20) + chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT; + else if (bw == CHANNEL_WIDTH_40) + chdef->width = NL80211_CHAN_WIDTH_40; +@@ -355,7 +355,7 @@ static void rtw_get_chbw_from_cfg80211_chan_def(struct cfg80211_chan_def *chdef, + rtw_warn_on(1); + *ch = 0; + return; +- } ++ } + + switch (chdef->width) { + case NL80211_CHAN_WIDTH_20_NOHT: +@@ -417,7 +417,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 + if (ret != _SUCCESS) + goto exit; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); ++#endif + + #else + int freq = rtw_ch2freq(ch); +@@ -1085,7 +1089,11 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ roam_info.links[0].bssid = cur_network->network.MacAddress; ++#else + roam_info.bssid = cur_network->network.MacAddress; ++#endif + 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; +@@ -1578,8 +1586,8 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param + _rtw_memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); + _rtw_memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + padapter->securitypriv.binstallGrpkey = _TRUE; +- if (param->u.crypt.idx < 4) +- _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); ++ if (param->u.crypt.idx < 4) ++ _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); + padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx; + rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, _TRUE); + +@@ -1824,7 +1832,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + || (MLME_IS_STA(adapter) && !pairwise) + #endif +- ) { ++ ) { + /* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */ + if (is_wep_enc(sec->dot118021XGrpPrivacy)) { + if (keyid >= WEP_KEYS) +@@ -1913,7 +1921,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev + } + + ret = 0; +- ++ + exit: + RTW_INFO(FUNC_NDEV_FMT + GET_KEY_PARAM_FMT_S +@@ -4929,7 +4937,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif + { + _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); + +@@ -5585,7 +5597,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *nde + else + _rtw_memcpy(mac, plink->addr, ETH_ALEN); + #endif +- ++ + sinfo->filled = 0; + + if (psta) { +@@ -7534,7 +7546,7 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "path_refresh_time:%u\n", conf->path_refresh_time); + RTW_PRINT_SEL(sel, "min_discovery_timeout:%u\n", conf->min_discovery_timeout); + RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathTimeout:%u\n", conf->dot11MeshHWMPactivePathTimeout); +- RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); ++ RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)) + RTW_PRINT_SEL(sel, "dot11MeshHWMPperrMinInterval:%u\n", conf->dot11MeshHWMPperrMinInterval); + #endif +@@ -7549,11 +7561,11 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "dot11MeshForwarding:%d\n", conf->dot11MeshForwarding); + RTW_PRINT_SEL(sel, "rssi_threshold:%d\n", conf->rssi_threshold); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) + RTW_PRINT_SEL(sel, "ht_opmode:0x%04x\n", conf->ht_opmode); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathToRootTimeout:%u\n", conf->dot11MeshHWMPactivePathToRootTimeout); + RTW_PRINT_SEL(sel, "dot11MeshHWMProotInterval:%u\n", conf->dot11MeshHWMProotInterval); +@@ -7564,7 +7576,7 @@ void dump_mesh_config(void *sel, const struct mesh_config *conf) + RTW_PRINT_SEL(sel, "power_mode:%s\n", nl80211_mesh_power_mode_str(conf->power_mode)); + RTW_PRINT_SEL(sel, "dot11MeshAwakeWindowDuration:%u\n", conf->dot11MeshAwakeWindowDuration); + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + RTW_PRINT_SEL(sel, "plink_timeout:%u\n", conf->plink_timeout); + #endif +@@ -7700,14 +7712,14 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi + if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)); + #endif + #endif +- ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask)) + mcfg->dot11MeshHWMPactivePathToRootTimeout = conf->dot11MeshHWMPactivePathToRootTimeout; + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) + mcfg->dot11MeshHWMProotInterval = conf->dot11MeshHWMProotInterval; + if (chk_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask)) +- mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; ++ mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; + #endif + + #if 0 /* TBD */ +@@ -7765,7 +7777,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte + #endif + if (!ch) + goto exit; +- ++ + #if defined(CONFIG_80211AC_VHT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + vht = ht && ch > 14 && bw >= CHANNEL_WIDTH_80; /* VHT40/VHT20? */ + #endif +@@ -8090,7 +8102,7 @@ static int cfg80211_rtw_join_mesh(struct wiphy *wiphy, struct net_device *dev, + ret = -EINVAL; + goto exit; + } +- ++ + rtw_mesh_work(&adapter->mesh_work); + + exit: +@@ -8171,7 +8183,7 @@ static int cfg80211_rtw_del_mpath(struct wiphy *wiphy, struct net_device *dev + } + } else { + rtw_mesh_path_flush_by_iface(adapter); +- } ++ } + + exit: + return ret; +@@ -8472,13 +8484,13 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { + //rtw_sitesurvey_cmd(padapter, NULL); + rtw_sitesurvey_cmd(padapter, &parm); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +- ++ + for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) { + if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE) + break; + rtw_msleep_os(1000); + } +- ++ + _enter_critical_bh(&pmlmepriv->lock, &irqL); + cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy); + _exit_critical_bh(&pmlmepriv->lock, &irqL); +@@ -8486,7 +8498,7 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { + } + RTW_DBG("<== %s\n",__func__); + return 0; +- ++ + } + #endif /* CONFIG_PNO_SUPPORT */ + +@@ -9369,7 +9381,7 @@ int rtw_hostapd_acs_dump_survey(struct wiphy *wiphy, struct net_device *netdev, + #elif defined(CONFIG_RTW_ACS) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) + rtw_cfg80211_set_survey_info_with_clm(padapter, idx, info); + #else +- RTW_ERR("%s: unknown acs operation!\n", __func__); ++ RTW_ERR("%s: unknown acs operation!\n", __func__); + #endif + + return ret; +@@ -9679,7 +9691,13 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + } +-- +Created with Armbian build tools https://github.com/armbian/build + diff --git a/patch/misc/wireless-rtl8812au-5.19.2.patch b/patch/misc/wireless-rtl8812au-5.19.2.patch new file mode 100644 index 000000000..1b47832c4 --- /dev/null +++ b/patch/misc/wireless-rtl8812au-5.19.2.patch @@ -0,0 +1,79 @@ +From b4358f8b995eb5161eddd4d6becb48317a4fc9a1 Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Fri, 19 Aug 2022 15:10:02 +0200 +Subject: [PATCH] update to 5.19.2 + +Signed-off-by: Igor Pecovnik +--- + .../rtl8812au/os_dep/linux/ioctl_cfg80211.c | 22 +++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/drivers/net/wireless/rtl8812au/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8812au/os_dep/linux/ioctl_cfg80211.c +index ca7b7dccefaf..ea2ac44c7284 100644 +--- a/drivers/net/wireless/rtl8812au/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl8812au/os_dep/linux/ioctl_cfg80211.c +@@ -472,7 +472,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, + if (!rtw_cfg80211_allow_ch_switch_notify(adapter)) + goto exit; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); ++#endif + + #else + int freq = rtw_ch2freq(ch); +@@ -1145,7 +1149,11 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ roam_info.links[0].bssid = cur_network->network.MacAddress; ++#else + roam_info.bssid = cur_network->network.MacAddress; ++#endif + 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; +@@ -5219,7 +5227,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd + return ret; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) ++#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ++#endif + { + _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); + +@@ -6092,7 +6104,11 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy + return 0; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, unsigned int link_id, struct cfg80211_chan_def *chandef){ ++#else + static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef){ ++#endif + _adapter *padapter= wiphy_to_adapter(wiphy); + int channel; + int control_freq; +@@ -10395,7 +10411,13 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + } +-- +Created with Armbian build tools https://github.com/armbian/build + diff --git a/patch/misc/wireless-rtl88x2bu-5.19.2.patch b/patch/misc/wireless-rtl88x2bu-5.19.2.patch new file mode 100644 index 000000000..fafec11dc --- /dev/null +++ b/patch/misc/wireless-rtl88x2bu-5.19.2.patch @@ -0,0 +1,72 @@ +From cba852f17884c43440de13e7ee012b99aa06089f Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Fri, 19 Aug 2022 07:46:31 +0200 +Subject: [PATCH] Add support for 5.19.2 + +Signed-off-by: Igor Pecovnik +--- + .../rtl88x2bu/os_dep/linux/ioctl_cfg80211.c | 14 ++++++++++++++ + .../rtl88x2bu/os_dep/linux/ioctl_cfg80211.h | 5 +++++ + 2 files changed, 19 insertions(+) + +diff --git a/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.c +index e70ee8a7e009..ed9871bad372 100755 +--- a/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.c ++++ b/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.c +@@ -449,7 +449,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, + if (!rtw_cfg80211_allow_ch_switch_notify(adapter)) + goto exit; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); ++#endif + + #else + int freq = rtw_ch2freq(ch); +@@ -1162,7 +1166,11 @@ int rtw_cfg80211_indicate_connect(_adapter *padapter) + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ roam_info.links[0].bssid = cur_network->network.MacAddress; ++#else + roam_info.bssid = cur_network->network.MacAddress; ++#endif + 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; +@@ -10453,7 +10461,13 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ if (wdev->connected) { ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ if (wdev->links[0].client.current_bss) { ++ #else + if (wdev->current_bss) { ++ #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + } +diff --git a/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.h b/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.h +index 86b893da3a0e..7b85ae046ab3 100644 +--- a/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.h ++++ b/drivers/net/wireless/rtl88x2bu/os_dep/linux/ioctl_cfg80211.h +@@ -163,6 +163,11 @@ struct rtw_wdev_priv { + struct rtw_wdev_invit_info invit_info; + struct rtw_wdev_nego_info nego_info; + ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ u32 ssid_len; ++ u32 ssid; ++ #endif ++ + u8 bandroid_scan; + bool block; + bool block_scan; +-- +Created with Armbian build tools https://github.com/armbian/build +