From 68da7390fb81aa895791e6b049645a18cb20cbe4 Mon Sep 17 00:00:00 2001 From: lean Date: Tue, 1 Mar 2022 22:44:19 +0800 Subject: [PATCH] rockchip: add workaroud for usb wlan up at firstboot --- package/kernel/mt76/Makefile | 2 +- ...x-mt76-driver-build-with-kernel-5.15.patch | 34 ------------------- target/linux/rockchip/Makefile | 2 +- .../etc/uci-defaults/yyy-usb-wifi-up | 4 +++ 4 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch create mode 100644 target/linux/rockchip/armv8/base-files/etc/uci-defaults/yyy-usb-wifi-up diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 431c57a24..bda23ceb8 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mt76 -PKG_RELEASE=4 +PKG_RELEASE=5 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= diff --git a/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch b/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch deleted file mode 100644 index de4018e7e..000000000 --- a/package/kernel/mt76/patches/001-fix-mt76-driver-build-with-kernel-5.15.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b450c426085843114e443fd63c342f52544d00f3 Mon Sep 17 00:00:00 2001 -From: W_Y_CPP <383152993@qq.com> -Date: Mon, 28 Feb 2022 21:19:03 -0500 -Subject: [PATCH] fix mt76 driver build with kernel 5.15 - ---- - eeprom.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/eeprom.c b/eeprom.c -index cc74c372d..975a0c0bd 100644 ---- a/eeprom.c -+++ b/eeprom.c -@@ -95,10 +95,15 @@ mt76_eeprom_override(struct mt76_phy *phy) - struct device_node *np = dev->dev->of_node; - const u8 *mac = NULL; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) -+ if (np) -+ of_get_mac_address(np, phy->macaddr); -+#else - if (np) - mac = of_get_mac_address(np); -- if (!IS_ERR_OR_NULL(mac)) -- ether_addr_copy(phy->macaddr, mac); -+ if (!IS_ERR_OR_NULL(mac)) -+ ether_addr_copy(phy->macaddr, mac); -+#endif - #endif - - if (!is_valid_ether_addr(phy->macaddr)) { --- -2.17.1 - diff --git a/target/linux/rockchip/Makefile b/target/linux/rockchip/Makefile index bd52c8c2b..3dcae9b34 100644 --- a/target/linux/rockchip/Makefile +++ b/target/linux/rockchip/Makefile @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs kmod-gpio-button-hotplug \ automount autocore-arm autosamba fdisk cfdisk e2fsprogs ethtool haveged htop \ - luci-app-zerotier luci-app-ipsec-vpnd + luci-app-zerotier luci-app-ipsec-vpnd wpad-openssl kmod-mt76x2u usbutils KERNELNAME:=Image dtbs diff --git a/target/linux/rockchip/armv8/base-files/etc/uci-defaults/yyy-usb-wifi-up b/target/linux/rockchip/armv8/base-files/etc/uci-defaults/yyy-usb-wifi-up new file mode 100644 index 000000000..03ac7337d --- /dev/null +++ b/target/linux/rockchip/armv8/base-files/etc/uci-defaults/yyy-usb-wifi-up @@ -0,0 +1,4 @@ +#!/bin/sh + +sleep 10 +[ -n "$(cat /proc/net/wireless | grep wlan)" ] && wifi config && wifi \ No newline at end of file