diff --git a/userspace/root/usr/comma/init_mss.py b/userspace/root/usr/comma/init_mss.py new file mode 100644 index 0000000..34c0d42 --- /dev/null +++ b/userspace/root/usr/comma/init_mss.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 +import signal + +# The on-chip Wi-Fi firmware runs in the SDM845 modem subsystem. +# Opening this device boots it and holds a reference; the kernel shuts it +# down when the last reference is released. Keep it open for this service's +# lifetime so Wi-Fi stays available. +# https://github.com/commaai/agnos-kernel-sdm845/blob/8b0e4d289b246a5cc1b0484b25a3f9f8d4772544/drivers/soc/qcom/subsystem_restart.c#L1215-L1251 +with open("/dev/subsys_modem", "rb"): + signal.pause() diff --git a/userspace/root/usr/lib/systemd/system/init_sys_mss.service b/userspace/root/usr/lib/systemd/system/init_sys_mss.service index 65ccb4e..bb20084 100644 --- a/userspace/root/usr/lib/systemd/system/init_sys_mss.service +++ b/userspace/root/usr/lib/systemd/system/init_sys_mss.service @@ -2,7 +2,7 @@ Description=Boot the modem subsystem, which runs the Wi-Fi firmware [Service] -ExecStart=/usr/sbin/init_mss +ExecStart=/usr/bin/python3 /usr/comma/init_mss.py Restart=on-failure [Install] diff --git a/userspace/root/usr/sbin/init_mss b/userspace/root/usr/sbin/init_mss deleted file mode 100755 index 6ca18c0..0000000 Binary files a/userspace/root/usr/sbin/init_mss and /dev/null differ