armbian-build/patch/misc/wireless-rtl8192eu-5.19.2.patch
Igor Pečovnik aa99cb64c3
Solve compatibility issues for some of wifi patches (#4087)
* Solve compatibility issues for some of wifi patches, disable those that needs more work

* Fix 8812au

* Update to re-enable RTL88x2CS driver for 5.19.2+

* Add 8723ds and rename others

* Following naming convention

* Name

* Adjust UWE5622 for 5.19.2

* Update UWE5622 patch for sunxi

* Enable last one

* Fixes for 8723DU

Co-authored-by: Vyacheslav Bocharov <adeep@lexina.in>
2022-08-20 07:44:35 +02:00

250 lines
9.7 KiB
Diff

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);
}