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
@@ -350,6 +350,22 @@
|
|||||||
*/
|
*/
|
||||||
#define ID_MM_AT_NETWORK_TIME_BROKEN "ID_MM_AT_NETWORK_TIME_BROKEN"
|
#define ID_MM_AT_NETWORK_TIME_BROKEN "ID_MM_AT_NETWORK_TIME_BROKEN"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID_MM_MAX_TIMEOUTS:
|
||||||
|
*
|
||||||
|
* This is a device-specific tag that allows users to specify the maximum number
|
||||||
|
* of consecutive command timeouts allowed before the modem is marked as invalid
|
||||||
|
* and re-probed.
|
||||||
|
*
|
||||||
|
* An integer value greater or equal than 0 must be given. The value 0 in this
|
||||||
|
* tag completely disables the timeout monitoring feature.
|
||||||
|
*
|
||||||
|
* If not given, the default value of 10 consecutive timeouts is used.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define ID_MM_MAX_TIMEOUTS "ID_MM_MAX_TIMEOUTS"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following symbols are deprecated. We don't add them to -compat
|
* The following symbols are deprecated. We don't add them to -compat
|
||||||
* because this -tags file is not really part of the installed API.
|
* because this -tags file is not really part of the installed API.
|
||||||
|
|||||||
@@ -446,6 +446,17 @@ base_modem_internal_grab_port (MMBaseModem *self,
|
|||||||
#endif
|
#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 (port_monitoring) {
|
||||||
if (self->priv->max_timeouts > 0)
|
if (self->priv->max_timeouts > 0)
|
||||||
g_signal_connect (port,
|
g_signal_connect (port,
|
||||||
|
|||||||
Reference in New Issue
Block a user