Skip to content

Commit

Permalink
rtw8852be: Fix builds with kernel 6.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
  • Loading branch information
lwfinger committed Aug 8, 2022
1 parent 8c2ce89 commit 4cff135
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,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(6, 0, 0)
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
#else
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
#endif

#else
int freq = rtw_ch2freq(ch);
Expand Down Expand Up @@ -1194,7 +1198,11 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
#endif

#if defined(CPTCFG_VERSION) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
roam_info.bssid = cur_network->network.MacAddress;
#else
roam_info.links[0].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;
Expand Down Expand Up @@ -5560,7 +5568,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret;
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
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)
#endif
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);

Expand Down Expand Up @@ -6509,6 +6521,9 @@ static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
static int cfg80211_rtw_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
unsigned int link_id,
#endif
struct cfg80211_chan_def *chandef)
{
_adapter *padapter = wiphy_to_adapter(wiphy);
Expand Down Expand Up @@ -10914,7 +10929,11 @@ 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->current_bss) {
#else
if (wdev->connected) {
#endif
RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
}
Expand Down

0 comments on commit 4cff135

Please sign in to comment.