From 81be2f46815bd18a0b88664525aae56d54338994 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sun, 29 Oct 2023 16:29:30 +0100 Subject: [PATCH] Add kernel v6.6 support --- Makefile | 2 ++ os_dep/linux/ioctl_cfg80211.c | 19 ++++++++++++------- os_dep/linux/wifi_regd.c | 4 ++++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b6d86d0..a344591 100755 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ EXTRA_CFLAGS += -Wno-implicit-fallthrough EXTRA_CFLAGS += -Wno-cast-function-type #EXTRA_CFLAGS += -Wno-error=cast-function-type #EXTRA_CFLAGS += -Wno-parentheses-equality +EXTRA_CFLAGS += -Wno-error=incompatible-pointer-types +EXTRA_CFLAGS += -Wno-stringop-overread #EXTRA_CFLAGS += -Wno-pointer-bool-conversion EXTRA_CFLAGS += -Wno-unknown-pragmas #EXTRA_CFLAGS += -Wno-unused diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index ac0746d..0d96568 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -478,7 +478,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0); -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); #else cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); @@ -5267,10 +5267,10 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd return ret; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) -static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) -#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2)) 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); @@ -7813,6 +7813,9 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, const u8 *peer, #else u8 *peer, +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)) + int link_id, #endif u8 action_code, u8 dialog_token, @@ -10155,12 +10158,12 @@ static struct cfg80211_ops rtw_cfg80211_ops = { .del_pmksa = cfg80211_rtw_del_pmksa, .flush_pmksa = cfg80211_rtw_flush_pmksa, -#ifdef CONFIG_AP_MODE #ifdef RTW_VIRTUAL_INT .add_virtual_intf = cfg80211_rtw_add_virtual_intf, .del_virtual_intf = cfg80211_rtw_del_virtual_intf, #endif +#ifdef CONFIG_AP_MODE #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)) && !defined(COMPAT_KERNEL_RELEASE) .add_beacon = cfg80211_rtw_add_beacon, .set_beacon = cfg80211_rtw_set_beacon, @@ -10432,7 +10435,7 @@ 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 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) if (wdev->links[0].client.current_bss) { #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) if (wdev->connected) { @@ -10473,9 +10476,10 @@ int rtw_cfg80211_ndev_res_alloc(_adapter *adapter) rtw_wiphy_free(wiphy); adapter->wiphy = NULL; } -#endif exit: +#endif + return ret; } @@ -10489,6 +10493,7 @@ void rtw_cfg80211_ndev_res_free(_adapter *adapter) #endif } + int rtw_cfg80211_ndev_res_register(_adapter *adapter) { int ret = _FAIL; diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index 5f2f905..a36b7dc 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -396,6 +396,10 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) + wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; +#endif + regd = _rtw_regdomain_select(reg); wiphy_apply_custom_regulatory(wiphy, regd);