Skip to content

Commit

Permalink
Buildfix for Linux 6.1
Browse files Browse the repository at this point in the history
ioctl_cfg80211.c buildfix 6.1
osdep_service.c buildfix 6.1
  • Loading branch information
kelebek333 authored Aug 2, 2023
1 parent 751882b commit ff2c2fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,9 @@ _func_enter_;
}

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
#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))
Expand Down Expand Up @@ -1696,6 +1699,9 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
}

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
#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))
Expand Down Expand Up @@ -1729,6 +1735,9 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
}

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))
Expand All @@ -1750,7 +1759,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
Expand Down
4 changes: 4 additions & 0 deletions os_dep/osdep_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,7 +2347,11 @@ 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();
#else
return prandom_u32();
#endif
#elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18))
u32 random_int;
get_random_bytes( &random_int , 4 );
Expand Down

0 comments on commit ff2c2fe

Please sign in to comment.