From ab222a7253c06c5ac9f73009ce3de3bd3dcd7d94 Mon Sep 17 00:00:00 2001 From: Sergei Kotlyachkov Date: Wed, 19 Jun 2024 20:57:34 -0400 Subject: [PATCH] Fix builds with kernels 6.8+ --- os_dep/linux/ioctl_cfg80211.c | 10 ++++++++-- os_dep/linux/os_intfs.c | 4 ++++ os_dep/linux/usb_intf.c | 2 +- os_dep/linux/wifi_regd.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 9723052..52bdbd6 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -5394,11 +5394,17 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, } static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev, - struct cfg80211_beacon_data *info) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0) + struct cfg80211_ap_update *params) +#else + struct cfg80211_beacon_data *info) +#endif { int ret = 0; _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0) + struct cfg80211_beacon_data *info = ¶ms->beacon; +#endif RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index b2c138d..7d05d25 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -146,6 +146,10 @@ int rtw_early_mode = 1; int rtw_led_ctrl = 1; /* default led blink */ #endif +#if !defined(strlcpy) +#define strlcpy(a, b, c) strscpy(a, b, c) +#endif + int rtw_usb_rxagg_mode = 2;/* RX_AGG_DMA=1, RX_AGG_USB=2 */ module_param(rtw_usb_rxagg_mode, int, 0644); diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index 0aa365b..b80b214 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -358,7 +358,7 @@ struct rtw_usb_drv usb_drv = { .usbdrv.reset_resume = rtw_resume, #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)) .usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown, #else .usbdrv.driver.shutdown = rtw_dev_shutdown, diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index 81e1dc7..519b47c 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -405,7 +405,7 @@ int rtw_regd_init(struct wiphy *wiphy) wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)) wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; #endif