From cca9d026091ab35f3d9ee7ea0d3d6abcba3a7b48 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Dec 2023 20:56:45 +0100 Subject: [PATCH] [RTL8852BU] Update for upstream change netif_napi_add() => netif_napi_add_weight() https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b48b89f Add missing new argument to cfg80211_ch_switch_notify() https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b8c9024 Signed-off-by: MichaIng --- drivers/staging/rtl8852bu/os_dep/linux/ioctl_cfg80211.c | 8 +++++++- drivers/staging/rtl8852bu/os_dep/linux/os_intfs.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8852bu/os_dep/linux/ioctl_cfg80211.c b/drivers/staging/rtl8852bu/os_dep/linux/ioctl_cfg80211.c index 17078a4c8b7f..51a816641d37 100755 --- a/drivers/staging/rtl8852bu/os_dep/linux/ioctl_cfg80211.c +++ b/drivers/staging/rtl8852bu/os_dep/linux/ioctl_cfg80211.c @@ -483,7 +483,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_notfiy() --- * A new parameter, bool quiet, is added from Linux kernel v5.11, @@ -504,7 +506,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, if (!rtw_cfg80211_allow_ch_switch_notify(adapter)) goto exit; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); +#else cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); +#endif #else int freq = rtw_ch2freq(ch); diff --git a/drivers/staging/rtl8852bu/os_dep/linux/os_intfs.c b/drivers/staging/rtl8852bu/os_dep/linux/os_intfs.c index 87fe3b82611d..49822a148373 100755 --- a/drivers/staging/rtl8852bu/os_dep/linux/os_intfs.c +++ b/drivers/staging/rtl8852bu/os_dep/linux/os_intfs.c @@ -291,7 +291,7 @@ int rtw_ndev_init(struct net_device *dev) rtw_adapter_proc_init(dev); #ifdef CONFIG_RTW_NAPI - netif_napi_add(dev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); + netif_napi_add_weight(dev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); #endif /* CONFIG_RTW_NAPI */ return 0;