[openwrt/openwrt] qualcommax: ipq50xx: add PCI path migration script

LEDE Commits lede-commits at lists.infradead.org
Tue May 13 10:58:33 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9d15c1a020f77cafb2b86f94045418767047095a

commit 9d15c1a020f77cafb2b86f94045418767047095a
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Tue May 13 13:19:22 2025 +0200

    qualcommax: ipq50xx: add PCI path migration script
    
    PCI paths of IPQ50xx devices have changed now that linux,pci-domain is set
    in the DTSI, so add a migration script for wireless config.
    
    Link: https://github.com/openwrt/openwrt/pull/18789
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../etc/hotplug.d/ieee80211/05-wifi-migrate        | 60 ++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
new file mode 100644
index 0000000000..d3ad319a31
--- /dev/null
+++ b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# This must run before 10-wifi-detect
+
+[ "${ACTION}" = "add" ] || return
+
+. /lib/functions.sh
+
+check_radio()
+{
+	local cfg="$1" to="$2"
+
+	config_get path "$cfg" path
+
+	[ "$path" = "$to" ] && PATH_EXISTS=true
+}
+
+do_migrate_radio()
+{
+	local cfg="$1" from="$2" to="$3"
+
+	config_get path "$cfg" path
+
+	[ "$path" = "$from" ] || return
+
+	uci set "wireless.${cfg}.path=${to}"
+	WIRELESS_CHANGED=true
+
+	logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
+}
+
+migrate_radio()
+{
+	local from="$1" to="$2"
+
+	config_load wireless
+
+	# Check if there is already a section with the target path: In this case, the system
+	# was already upgraded to a version without this migration script before; better bail out,
+	# as we can't be sure we don't break more than we fix.
+	PATH_EXISTS=false
+	config_foreach check_radio wifi-device "$to"
+	$PATH_EXISTS && return
+
+	config_foreach do_migrate_radio wifi-device "$from" "$to"
+}
+
+WIRELESS_CHANGED=false
+
+case "$(board_name)" in
+linksys,mr5500|\
+linksys,mx5500|\
+linksys,spnmx56)
+	migrate_radio 'soc at 0/a0000000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0' 'soc at 0/a0000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
+	;;
+esac
+
+$WIRELESS_CHANGED && uci commit wireless
+
+exit 0




More information about the lede-commits mailing list