Add support for Linux 5.19.2 and 6.0

This commit is contained in:
Igor Pecovnik 2022-08-19 06:36:41 +02:00 committed by Carlos Garcés
parent 6ba1f32096
commit ec5c2446db

View File

@ -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)) if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
goto exit; 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); cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
#endif
#else #else
int freq = rtw_ch2freq(ch); int freq = rtw_ch2freq(ch);
@ -1123,7 +1127,11 @@ check_bss:
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) #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; 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 = 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.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; roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6;
@ -5073,7 +5081,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret; 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) static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#endif
{ {
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
@ -8837,7 +8849,7 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) {
} }
RTW_DBG("<== %s\n",__func__); RTW_DBG("<== %s\n",__func__);
return 0; return 0;
} }
#endif /* CONFIG_PNO_SUPPORT */ #endif /* CONFIG_PNO_SUPPORT */
@ -10132,7 +10144,11 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
rtw_cfg80211_indicate_scan_done(adapter, _TRUE); 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(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
if (wdev->connected) {
#else
if (wdev->current_bss) { if (wdev->current_bss) {
#endif
RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
rtw_cfg80211_indicate_disconnect(adapter, 0, 1); rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
} }