summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiji Yang2025-11-11 21:03:43 +0000
committerChristian Marangi2025-11-11 23:08:15 +0000
commitb01c68ddbde3a06d8569e4bab720b2e54eb3e2c9 (patch)
tree84c3eb85159f570c005c572958d49d8828b9d7a5
parent42ca1612a2e207d47400d4bbbd4188a1cbc96b22 (diff)
downloadopenwrt-b01c68ddbde3a06d8569e4bab720b2e54eb3e2c9.tar.gz
ipq806x: migrate wifi configuration device paths for 6.12 kernel
The device tree PCIe host node names have been changed in the new 6.12 kernel[1]. Hence we have to update the wifi device path to make sure it can work properly. This script is based on: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82 Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Link: https://github.com/openwrt/openwrt/pull/18989 (cherry picked from commit ae70dbc26787497e25faa8d67b5944b7bb9023e4) Backport the migration script that can also work backward, migrating from 6.12 to 6.6. Like going from main/master to stable 24.10. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi> Link: https://github.com/openwrt/openwrt/pull/20739 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate47
1 files changed, 47 insertions, 0 deletions
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
new file mode 100644
index 0000000000..fdacfa56b1
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# This must run before 10-wifi-detect
+
+[ "${ACTION}" = "add" ] || return
+
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+do_migrate_radio()
+{
+ local config="$1"
+
+ config_get from "$config" path
+
+ to=${from/pci\//pcie\/}
+
+ # Checks if kernel version is less than 6.12.0, if it is and the path is
+ # using the new format, then path should be migrated to the old format.
+ [ "$(get_linux_version)" -lt "612000" ] && to=${from/pcie\//pci\/}
+
+ [ "$from" = "$to" ] && return
+
+ uci set "wireless.${config}.path=${to}"
+ WIRELESS_CHANGED=true
+
+ logger -t wifi-migrate "Updated path of wireless.${config} from '${from}' to '${to}'"
+}
+
+migrate_radio()
+{
+ config_load wireless
+
+ config_foreach do_migrate_radio wifi-device
+}
+
+WIRELESS_CHANGED=false
+
+case "$(board_name)" in
+*)
+ migrate_radio
+ ;;
+esac
+
+$WIRELESS_CHANGED && uci commit wireless
+
+exit 0