From 8c722d1b95ba4fdc80c3167ae14a13a7e38da45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Tue, 25 Oct 2022 17:26:27 +0000 Subject: [PATCH 1/2] New kernels needs GCC 12 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cfb92a..3da0346 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,8 +29,8 @@ jobs: fail-fast: false matrix: kernel_version: ${{fromJson(needs.commontasks.outputs.matrix)}} - gcc_version: [9, 10, 11] - #kernel_version: [5.15-rc3,5.14.10] + gcc_version: [9, 10, 12] + # kernel_version: [6.1-rc1] steps: - name: Check Versions id: check_version @@ -38,7 +38,7 @@ jobs: run: | echo ::set-output name=skip_build::False dpkg --compare-versions "${{matrix.kernel_version}}" "ge" "5.15" - if [ $? -eq "0" ] && [ ${{matrix.gcc_version}} -lt 11 ]; + if [ $? -eq "0" ] && [ ${{matrix.gcc_version}} -lt 12 ]; then echo "GCC version not compatible" echo ::set-output name=skip_build::True From 563780d2ebe722384c10d9185055edd9905828de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Tue, 25 Oct 2022 17:02:42 +0000 Subject: [PATCH 2/2] Fix kernel 6.1 compilation wifi: cfg80211: Add link_id parameter to various key operations for MLO wifi: cfg80211: Add link_id to cfg80211_ch_switch_started_notify() net: drop the weight argument from netif_napi_add random: convert get_random_int/long into get_random_u32/u64 Link: https://lore.kernel.org/r/20220722131143.3438042-1-quic_vjakkam@quicinc.com Link: https://lore.kernel.org/r/20220722131143.3438042-2-quic_vjakkam@quicinc.com Link: https://lore.kernel.org/r/20220730052643.1959111-4-quic_vjakkam@quicinc.com Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org Link: https://github.com/torvalds/linux/commit/e7a7b84e33178db4a839c5e1773247be17597c1f Link: https://github.com/torvalds/linux/commit/de492c83cae0af72de370b9404aacda93dafcad5 Link: https://github.com/torvalds/linux/commit/c440408cf6901eeb2c09563397e24a9097907078 --- os_dep/linux/ioctl_cfg80211.c | 29 ++++++++++++++++++++++++----- os_dep/linux/os_intfs.c | 6 +++++- os_dep/osdep_service.c | 6 +++--- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 5a69217..dbbf10f 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -439,7 +439,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) if (started) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) + cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)) cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false); #else cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0); @@ -1693,6 +1695,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 @@ -1837,6 +1842,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 @@ -2002,6 +2010,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)) */ @@ -2022,10 +2033,14 @@ 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 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE) + 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 +#endif ) { _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); @@ -2070,7 +2085,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 diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 52b800c..1630e78 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1673,7 +1673,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name) u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); #ifdef CONFIG_RTW_NAPI - netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); + netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)) + , RTL_NAPI_WEIGHT +#endif + ); #endif /* CONFIG_RTW_NAPI */ #if defined(CONFIG_IOCTL_CFG80211) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index c3a8411..e6954c3 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1617,8 +1617,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(4, 11, 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; @@ -1627,7 +1628,6 @@ inline u32 rtw_random32(void) #else return random32(); #endif -#endif } void rtw_buf_free(u8 **buf, u32 *buf_len)