Backport the modemmanager hotplug noise reduction from master. On every boot and hotplug replay each net/tty/wwan uevent is handed to mm_report_event via the hotplug scripts, which log an info "event processed" line to daemon.info before mm_report_event decides whether the device is relevant. On a target with SQM tunnels, bridges and veth that is dozens of pointless info lines per boot. In addition, procd replays every uevent before /etc/init.d/modemmanager starts, so the live mmcli --report-kernel-event call fails with "couldn't get bus" and is logged as daemon.err per modem port. Make mm_report_event the single authority on what is worth reporting: it now returns non-zero when it drops a virtual device (keeping the QMAP/ QMI/MBIM multiplexing netdevices qmapmux*/qmimux*/mbimmux*, which are virtual but are real modem data ports) and returns success when it caches an event for a not-yet-running ModemManager. The hotplug scripts only emit their "event processed" info log when the event was actually reported. The live mmcli call is skipped while ModemManager is down; the wrapper replays the cache once it is up. This combines the master commits below into a single change; the intermediate /devices/virtual guard of7885dff933, which wrongly dropped the mux data ports, is superseded by the mm_report_event based filtering and is therefore not applied on its own. (cherry picked from commit187382d9d1) (cherry picked from commitf094afbed0) Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
OpenWrt ModemManager
Description
Cellular modem control and connectivity
Optional libraries libmbim and libqmi are available. Your modem may require additional kernel modules and/or the usb-modeswitch package.
Usage
Once installed, you can configure the 2G/3G/4G modem connections directly in /etc/config/network as in the following example:
config interface 'broadband'
option device '/sys/devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2.1'
option proto 'modemmanager'
option apn 'ac.vodafone.es'
option allowedauth 'pap chap'
option username 'vodafone'
option password 'vodafone'
option pincode '7423'
option iptype 'ipv4'
option plmn '214001'
option lowpower '1'
option signalrate '30'
option allow_roaming '1'
option force_connection '1'
option init_epsbearer '<none|default|custom>'
Only 'device' and 'proto' are mandatory options, the remaining ones are all optional.
The 'allowedauth' option allows limiting the list of authentication protocols. It is given as a space-separated list of values, including any of the following: 'pap', 'chap', 'mschap', 'mschapv2' or 'eap'. It will default to allowing all protocols.
The 'iptype' option supports any of these values: 'ipv4', 'ipv6' or 'ipv4v6'. It will default to 'ipv4' if not given.
The 'plmn' option allows to set the network operator MCCMNC.
The 'signalrate' option set's the signal refresh rate (in seconds) for the device. You can call signal info with command: mmcli -m 0 --signal-get
The 'force_connection' option is designed to ensure that the modem automatically attempts to reconnect regardless of any errors encountered during the connection process.
If there is no Circuit switch network available, then an initial EPS bearer must be set, so this could be used during the network registration process in 4G and 5G network. For this resaon a new configuration option 'init_epsbearer' was added, which could have the following values.
- none: Do not set an initial EPS bearer (default)
- default: Use the configuration option 'apn', 'iptype', 'allowedauth', 'username' and 'password' for setting the initial EPS bearer. These are the same options as when establishing a connection.
- custom: This could be used to use diffrent options when establishing a connection. The options are prefixed with an 'init'. So we have the following options 'init_apn', 'init_iptype', 'init_allowedauth', 'init_username' and 'init_password' for setting the initial EPS bearer.