summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2024-09-11 22:44:30 +0000
committerChristian Marangi2025-11-18 12:15:12 +0000
commit66a7e04e9e10247978c301a679428cbfc001e6ea (patch)
tree08708306aa9ad959a2a343ffc4136a56c61ea03e
parente5ad92c588ce0d4ce9238a9dc920b345313417a8 (diff)
downloadopenwrt-66a7e04e9e10247978c301a679428cbfc001e6ea.tar.gz
apm821xx: rename pciex to pcie
Fixes: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie" Matches upstream commit: 86bc917d2ac117ec922dbf8ed92ca989bf333281 Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19425 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate47
-rw-r--r--target/linux/apm821xx/dts/apm82181.dtsi2
2 files changed, 48 insertions, 1 deletions
diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate b/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
new file mode 100644
index 0000000000..0496092084
--- /dev/null
+++ b/target/linux/apm821xx/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/pciex\//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\//pciex\/}
+
+ [ "$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
diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi
index 5f80467d74..5b7d907311 100644
--- a/target/linux/apm821xx/dts/apm82181.dtsi
+++ b/target/linux/apm821xx/dts/apm82181.dtsi
@@ -418,7 +418,7 @@
#size-cells = <0>;
};
- PCIE0: pciex@d00000000 {
+ PCIE0: pcie@d00000000 {
device_type = "pci"; /* see ppc4xx_pci_find_bridge */
#interrupt-cells = <1>;
#size-cells = <2>;