mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-25 14:44:09 +00:00
Added kernel v6.1.x support
This commit is contained in:
parent
4430ca7ff4
commit
16453b91b4
@ -464,7 +464,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
|
||||
* called by others with block-tx.
|
||||
*/
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
|
||||
#else
|
||||
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false);
|
||||
#endif
|
||||
#else
|
||||
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0);
|
||||
#endif
|
||||
@ -1911,6 +1915,9 @@ exit:
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
, int link_id
|
||||
#endif
|
||||
, u8 key_index
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
, bool pairwise
|
||||
@ -2073,6 +2080,9 @@ addkey_end:
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
, int link_id
|
||||
#endif
|
||||
, u8 keyid
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
, bool pairwise
|
||||
@ -2261,6 +2271,9 @@ exit:
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
int link_id,
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
u8 key_index, bool pairwise, const u8 *mac_addr)
|
||||
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
|
||||
@ -2281,7 +2294,11 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
|
||||
struct net_device *ndev, u8 key_index
|
||||
struct net_device *ndev,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
, bool unicast, bool multicast
|
||||
#endif
|
||||
@ -2329,7 +2346,11 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30))
|
||||
int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy,
|
||||
struct net_device *ndev, u8 key_index)
|
||||
struct net_device *ndev,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index)
|
||||
{
|
||||
#define SET_DEF_KEY_PARAM_FMT " key_index=%d"
|
||||
#define SET_DEF_KEY_PARAM_ARG , key_index
|
||||
|
@ -2129,7 +2129,7 @@ static const struct ethtool_ops rtw_ethtool_ops = {
|
||||
.get_ethtool_stats = rtw_ethtool_get_stats,
|
||||
.get_sset_count = rtw_ethtool_get_sset_count,
|
||||
};
|
||||
#endif // LINUX_VERSION_CODE >= 3.7.8
|
||||
#endif // LINUX_VERSION_CODE >= 3.7.8
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
/* For ethtool --- */
|
||||
|
||||
@ -2141,7 +2141,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
|
||||
u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj);
|
||||
|
||||
#ifdef CONFIG_RTW_NAPI
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
|
||||
#else
|
||||
netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
|
||||
#endif
|
||||
#endif /* CONFIG_RTW_NAPI */
|
||||
|
||||
#if defined(CONFIG_IOCTL_CFG80211)
|
||||
|
@ -2914,7 +2914,9 @@ u64 rtw_division64(u64 x, u64 y)
|
||||
inline u32 rtw_random32(void)
|
||||
{
|
||||
#ifdef PLATFORM_LINUX
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
return get_random_u32();
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
|
||||
return prandom_u32();
|
||||
#elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
|
||||
u32 random_int;
|
||||
|
Loading…
Reference in New Issue
Block a user