Skip to content

Commit

Permalink
linux kernel 5.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mabrand authored and MaxG87 committed Sep 24, 2020
1 parent ced3f17 commit 89189d6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions os_dep/linux/ioctl_cfg80211.c
Expand Up @@ -7480,14 +7480,26 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
return ret;
}

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))

static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wdev,
#else
struct net_device *ndev,
#endif
u16 frame_type, bool reg)

#else
static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct mgmt_frame_regs *upd)
#endif
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
u32 rtw_mask = BIT(IEEE80211_STYPE_PROBE_REQ >> 4);
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev);
#endif
Expand All @@ -7502,10 +7514,19 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
pwdev_priv = adapter_wdev_data(adapter);

#ifdef CONFIG_DEBUG_CFG80211
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
frame_type, reg);
#else
RTW_INFO(FUNC_ADPT_FMT " old_regs:%x new_regs:%x\n",
FUNC_ADPT_ARG(adapter), pwdev_priv->mgmt_mask, upd->interface_stypes);
#endif
#endif

/* Wait QC Verify */
return;

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
switch (frame_type) {
case IEEE80211_STYPE_AUTH: /* 0x00B0 */
if (reg > 0)
Expand All @@ -7530,6 +7551,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
default:
break;
}
#endif

exit:
return;
Expand Down Expand Up @@ -9918,7 +9940,14 @@ static struct cfg80211_ops rtw_cfg80211_ops = {

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx,

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
#else
.update_mgmt_frame_registrations =
cfg80211_rtw_update_mgmt_frame_register,
#endif

#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx,
#endif
Expand Down
4 changes: 4 additions & 0 deletions os_dep/linux/ioctl_cfg80211.h
Expand Up @@ -168,6 +168,10 @@ struct rtw_wdev_priv {
bool block_scan;
bool power_mgmt;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(5,8,0)
u32 mgmt_mask;
#endif

/* report mgmt_frame registered */
u16 report_mgmt;

Expand Down

0 comments on commit 89189d6

Please sign in to comment.