From 07bc2163cc2444832f8f39abfe834ba227a06120 Mon Sep 17 00:00:00 2001 From: morrownr Date: Sat, 25 Nov 2023 14:10:47 -0600 Subject: [PATCH] support for kernel 6.7 --- Makefile | 9 ++++++++- README.md | 2 +- os_dep/linux/ioctl_cfg80211.c | 13 +++++++++++- save-log.sh | 37 ----------------------------------- 4 files changed, 21 insertions(+), 40 deletions(-) delete mode 100755 save-log.sh diff --git a/Makefile b/Makefile index 9364b54..998c802 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,12 @@ EXTRA_CFLAGS += -DCONFIG_LED_ENABLE EXTRA_CFLAGS += -Wno-address EXTRA_CFLAGS += -Wframe-larger-than=1648 +# gcc-13 +EXTRA_CFLAGS += -Wno-enum-int-mismatch +EXTRA_CFLAGS += -Wno-stringop-overread +EXTRA_CFLAGS += -Wno-enum-conversion +EXTRA_CFLAGS += -Wno-int-in-bool-context + GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ) ifeq ($(GCC_VER_49),1) EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later @@ -2504,7 +2510,8 @@ sign: @mokutil --import MOK.der @$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der 8821cu.ko -sign-install: sign install +sign-install: + sign install backup_rtlwifi: @echo "Making backup rtlwifi drivers" diff --git a/README.md b/README.md index 4168da9..820e194 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ the hardware to test the above. ### Compatible Kernels - Kernels: 4.19 - 5.11 (Realtek) -- Kernels: 5.12 - 6.6 (community support) +- Kernels: 5.12 - 6.7 (community support) Note: Kernels earlier than 4.19 may work but are not tested or supported. diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 5bcceff..f98ee71 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -5326,8 +5326,11 @@ static int cfg80211_rtw_add_beacon(struct wiphy *wiphy, struct net_device *ndev, } rtw_mi_scan_abort(adapter, _TRUE); rtw_mi_buddy_set_scan_deny(adapter, 300); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)) + ret = rtw_add_beacon(adapter, ap->beacon.head, ap->beacon.head_len, ap->beacon.tail, ap->beacon.tail_len); +#else ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len); - +#endif exit: return ret; } @@ -5449,7 +5452,11 @@ exit: } static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)) + struct cfg80211_ap_update *ap) +#else struct cfg80211_beacon_data *info) +#endif { int ret = 0; _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); @@ -5469,7 +5476,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd if (info->assocresp_ies_len > 0) rtw_cfg80211_set_assocresp_ies(ndev, info->assocresp_ies, info->assocresp_ies_len); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)) + ret = rtw_add_beacon(adapter, ap->beacon.head, ap->beacon.head_len, ap->beacon.tail, ap->beacon.tail_len); +#else ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len); +#endif return ret; } diff --git a/save-log.sh b/save-log.sh deleted file mode 100755 index 68e1c72..0000000 --- a/save-log.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# Purpose: Save a log file with RTW lines only. -# -# To make this file executable: -# -# $ chmod +x save-log.sh -# -# To execute this file: -# -# $ sudo ./save-log.sh -# -# or -# -# $ sudo sh save-log.sh - -SCRIPT_NAME="save-log.sh" - -if [ "$(id -u)" -ne 0 ]; then - echo "You must run this script with superuser (root) privileges." - echo "Try: \"sudo ./${SCRIPT_NAME}\"" - exit 1 -fi - -# deletes existing log -rm -f -- rtw.log - -dmesg | cut -d"]" -f2- | grep "RTW" >> rtw.log -RESULT=$? - -if [ "$RESULT" != "0" ]; then - echo "An error occurred while running: ${SCRIPT_NAME}" - echo "Did you set a log level > 0 ?" - exit 1 -else - echo "rtw.log saved successfully." -fi