aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-bearer.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-11-10 23:01:10 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-11-14 09:41:43 +0000
commit5d150ed23e122c06e1a4add0ca9c6f7e07502a17 (patch)
treee3d1a8b52a4a3bc0220aa2a4134f1837a5f1235a /src/mm-base-bearer.h
parentda77dc7152b76728de0ce63cedf96ceb30f37046 (diff)
core,plugins: consolidate connection/disconnection timeout values
Each different plugin or protocol had a different connection attempt value. E.g. QMI and MBIM both used 60s max for the connection attempt, while the u-blox plugin had up to 180s for ECM based connection setups. This commit consolidates all plugins and protocols to use the same timeout values for commands that may take long to respond, e.g. a connection atempt under low signal quality conditions. A value of 180s for the connection attempt steps and 120s for a disconnection attempt step is considered. Note, though, that in some cases (like a IPv4v6 setup attempt using QMI) we may have more than one such long step, so this doesn't mean that a connection attempt will always take less than 180s. Users of the connection/disconnection APIs should be able to handle the case where the attempt times out in their side (e.g. with a lower DBus request timeout), and which would not mean the actual request they did really failed. E.g. a connection attempt with a DBus timeout of 30s may fail in the user with a timeout error, but the attempt would still go on for as much as the plugin/protocol needs. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/270
Diffstat (limited to 'src/mm-base-bearer.h')
-rw-r--r--src/mm-base-bearer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mm-base-bearer.h b/src/mm-base-bearer.h
index 729fa6a8..1c1f96ea 100644
--- a/src/mm-base-bearer.h
+++ b/src/mm-base-bearer.h
@@ -43,6 +43,17 @@ MMBearerIpConfig *mm_bearer_connect_result_peek_ipv6_config (MMBearerConnec
/*****************************************************************************/
+/* Default timeout values to be used in the steps of a connection or
+ * disconnection attempt that may take long to complete. Note that the actual
+ * connection attempt from the user may have a different timeout, but we don't
+ * really fully care about that, it's a problem to consider in the user side.
+ * In the daemon itself, what we want and require is to be in sync with the
+ * state of the modem. */
+#define MM_BASE_BEARER_DEFAULT_CONNECTION_TIMEOUT 180
+#define MM_BASE_BEARER_DEFAULT_DISCONNECTION_TIMEOUT 120
+
+/*****************************************************************************/
+
#define MM_TYPE_BASE_BEARER (mm_base_bearer_get_type ())
#define MM_BASE_BEARER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_BEARER, MMBaseBearer))
#define MM_BASE_BEARER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BASE_BEARER, MMBaseBearerClass))