From aae6d88228ca80211bef24bb1a8d97c736f4eced Mon Sep 17 00:00:00 2001 From: etar125 Date: Fri, 2 May 2025 15:38:55 +0300 Subject: [PATCH 1/2] Fix build errors --- os_dep/linux/ioctl_cfg80211.c | 4 ++-- os_dep/linux/usb_intf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 61ca863..d708e0c 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4462,14 +4462,14 @@ 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) + struct cfg80211_ap_update *info) { int ret = 0; _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); 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); + ret = rtw_add_beacon(adapter, info->beacon.head, info->beacon.head_len, info->beacon.tail, info->beacon.tail_len); return ret; } diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index 705c084..1037307 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -316,7 +316,7 @@ struct rtw_usb_drv usb_drv = { .usbdrv.supports_autosuspend = 1, #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)) .usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown, #else .usbdrv.driver.shutdown = rtw_dev_shutdown, From 31672de19d36bc2e39abd0c9ac0cfdcc39de6fca Mon Sep 17 00:00:00 2001 From: etar125 Date: Fri, 2 May 2025 23:06:26 +0300 Subject: [PATCH 2/2] Fix for old kernels --- os_dep/linux/ioctl_cfg80211.c | 12 ++++++++++-- os_dep/linux/usb_intf.c | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index d708e0c..a01cb50 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4462,14 +4462,22 @@ 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_ap_update *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->beacon.head, info->beacon.head_len, info->beacon.tail, info->beacon.tail_len); + ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len); return ret; } diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index 1037307..9529580 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -316,7 +316,7 @@ struct rtw_usb_drv usb_drv = { .usbdrv.supports_autosuspend = 1, #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,