base-modem: make max timeouts configurable via udev rule
Add the ID_MM_MAX_TIMEOUTS udev tag to allow users and system administrators to configure the maximum number of consecutive command timeouts before a modem is invalidated and re-probed, on a per-device basis. The tag accepts an integer value >= 0, where 0 disables the timeout monitoring feature entirely. If not set, the existing default of 10 consecutive timeouts is used. This is needed for some older modems which become unresponsive during consecutive data traffic, but come back alive when traffic is lower. These modems have no further firmware updates available. This follows the same pattern as other udev-configurable device properties like ID_MM_MAX_MULTIPLEXED_LINKS. Signed-off-by: Filip Pokryvka <fpokryvk@redhat.com>
This commit is contained in:
committed by
Dan Williams
parent
e1f8061541
commit
30e4577b4d
@@ -446,6 +446,17 @@ base_modem_internal_grab_port (MMBaseModem *self,
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Check if a custom max timeouts value is set via udev */
|
||||
if (mm_kernel_device_has_global_property (kernel_device, ID_MM_MAX_TIMEOUTS)) {
|
||||
guint max_timeouts;
|
||||
|
||||
max_timeouts = mm_kernel_device_get_global_property_as_int (kernel_device, ID_MM_MAX_TIMEOUTS);
|
||||
if (max_timeouts != self->priv->max_timeouts) {
|
||||
mm_obj_dbg (self, "max timeouts overridden via udev: %u", max_timeouts);
|
||||
self->priv->max_timeouts = max_timeouts;
|
||||
}
|
||||
}
|
||||
|
||||
if (port_monitoring) {
|
||||
if (self->priv->max_timeouts > 0)
|
||||
g_signal_connect (port,
|
||||
|
||||
Reference in New Issue
Block a user