aboutsummaryrefslogtreecommitdiff
path: root/net/modemmanager/files/modemmanager.common
Commit message (Collapse)AuthorAge
* modemmanager: moving the openwrt related files to subdirectoriesFlorian Eckert2024-03-05
| | | | | | | | Moving the openwrt related files to subdirectories as they are installed on the system. This change makes it immediately apparent during development where the file is to be installed in the running system. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* modemmanager: suppress mm_log debug messages by defaultFlorian Eckert2024-01-19
| | | | | | | | | The log is filled with 'debug' messages. This is not necessary and is only normaly needed during development. To suppress this message, check whether the level is 'debug' and if so, suppress it. If this message is required again, the message can be generated by commenting out this line. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* modemmanager: replace modem available check on start with the new monitore ↵Florian Eckert2024-01-19
| | | | | | | | | | | | | | | | | | | service Before this change, the status of the sysfs paths from the kernel events was cached with a cache file. This is necessary to mark configured modems as available for the netifd. Using the new monitor service via the mmcli command 'mmcli -M' simplifies the whole process. There is no need to start sub shells in the background anymore that monitors whether the modem has already been added to the ModemManager. For this purpose, a new service was added that reacts on add and remove events for modems in the ModemManager and, if necessary, marks the logical netifd interface as available. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* modemmanager: move generally applicable functions to modemmanager.commonFlorian Eckert2024-01-19
| | | | | | | | These moved functions are general functions. This is a preparatory commit so that these moved functions can also be used in other ModemManager scripts. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* modemmanager: improve cleanup of ifacesOliver Sedlbauer2023-10-30
| | | | | | | | | | Change workflow to cleanup interfaces using the sysfscache. The sysfscache stores the processed sysfs-paths. Using this instead of mmcli -L, the interfaces can be properly cleaned up even if, for example, ModemManager crashes and mmcli is no longer usable. Signed-off-by: Oliver Sedlbauer <osedlbauer@tdt.de>
* modemmanager: check status of report-kernel-eventOliver Sedlbauer2023-10-25
| | | | | | | | | | | At mm_report_modem_wait a wait status is set. When attempting to report an event (via hotplug or during startup) and the DBus is not yet available, the status in the sysfs cache is set to 'processed' incorrectly, even if mmcli fails. This is fixed by aborting the operation and logging an error when the kernel report fails. Signed-off-by: Oliver Sedlbauer <osedlbauer@tdt.de>
* modemmanager: remove sysfscache after dbus readyOliver Sedlbauer2023-10-25
| | | | | | | | | | | | | | The mm_report_events_from_cache method is called during the startup and informs the ModemManager of kernel events. Additionally, hotplug scripts inform the ModemManager of kernel events. Processed events are stored in the sysfs cache. It is possible for a hotplug script to write to the sysfs cache while the mm_report_events_from_cache method is still waiting for the ModemManager to be available on the bus during startup. This could lead to a misbehavior where modems are not recognized. To ensure a clean state on startup, the sysfs cache is cleared after the ModemManager is available, ensuring reliable processing of kernel events. Signed-off-by: Oliver Sedlbauer <osedlbauer@tdt.de>
* modemmanager: Remove hardcoded proto checkOliver Sedlbauer2023-09-01
| | | | | | | | | Modified the code to correctly determine modem availability based on the sysfs path provided in the 'device' option, instead of relying on the 'proto' value. This ensures proper configuration for custom-made protos that do not match the "modemmanager" identifier. Signed-off-by: Oliver Sedlbauer <osedlbauer@tdt.de>
* modemmanager: do not cache virtual device eventsFlorian Eckert2023-06-15
| | | | | | | | | | | On small systems with many virtual devices, the modem manager sometimes could not start because it took too long until all devices for the modem were recognised. This is because all system events that are stored in the file events.cache have to be processed. To speed up the processing, all devices under /sys/devices/virtual are now filtered out so that they do not have to be processed. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* modemmanager: refactoring hotplug debug loggingFlorian Eckert2021-12-14
| | | | | | | | | | | | | The output of the hotplug is very chatty and floods the log with messages that are not necessary in functioning operation. So that the log can be filtered. A log level was added to each message as the first opiton on mm_log function call. In addition, the facility of the hotplug script has been set to daemon, which in my view fits better than user. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* modemmanager: fix physdev sysfs path detection in PCIe modemsAleksander Morgado2021-11-12
| | | | | | | | The PCIe physdev path lookup relies on the 'vendor' and 'device' attribute files, instead of the 'idVendor' and 'idProduct' ones, which are USB specific. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
* modemmanager: increase initial timeout for event reportingAleksander Morgado2020-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the ModemManager daemon is started by the init script, we're explicitly calling mm_report_events_from_cache() so that all the hotplug events that happened before that moment are properly notified to the newly launched daemon. This initial reporting of events does a wait for the ModemManager process to be available in DBus, and if the daemon isn't registered in the bus in a given time, the process is considered failed: Sun Sep 6 16:20:02 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:02 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:03 2020 [2180]: <info> ModemManager (version 1.14.6) starting in system bus... Sun Sep 6 16:20:03 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:04 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:05 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:05 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:06 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:06 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:07 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:07 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:08 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:08 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:09 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:09 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:10 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:10 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:11 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:11 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:12 2020 ModemManager: hotplug: checking if ModemManager is available... Sun Sep 6 16:20:12 2020 ModemManager: hotplug: ModemManager not yet available Sun Sep 6 16:20:12 2020 ModemManager: hotplug: error: couldn't report initial kernel events: ModemManager not running Update the default wait time for this initial event notification from 10s to 60s, because there are cases where the daemon is slower to boot, e.g. during the first boot after a sysupgrade. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
* modemmanager: fix device unplug handlingAleksander Morgado2019-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | When a USB modem device is unplugged, we had to do two different things: first, cleanup the sysfs cache; and second, set interface as unavailable. Those two things were never being done properly due to several different issues: * The parent sysfs path retrieval logic relies on checking for which sysfs path has the vid/pid files. This logic obviously only works when the device is available, and cannot be used on e.g. removal events. * The command to cleanup the modem wait status from the sysfs cache was not removing the previous state properly, because the sysfs path variable wasn't escaped properly for the sed command. This patch handles those issues in order to have a proper device removal handling, by making sure the sysfs path is properly escaped in the sed command, and by introducing a new hotplug script that runs when the full USB device is removed. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
* modemmanager: add missing path for PID fileAleksander Morgado2019-11-07
| | | | | | | The procd based init setup uses a custom `pidfile` parameter, but the used MODEMMANAGER_PID_FILE was not being defined anywhere. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
* modemmanager: add ModemManager to packagesNicholas Smith2019-09-27
Signed-off-by: Nicholas Smith <nicholas.smith@telcoantennas.com.au>