diff options
author | Shih-Yuan Lee (FourDollars) <sylee@canonical.com> | 2015-09-24 16:32:41 +0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-09-24 12:57:10 +0200 |
commit | bc15bede4aeca0651a5c85fb54d407453e7d5af8 (patch) | |
tree | f60f5deb883511efd8dc86b355f588fff45ef349 | |
parent | 6cf74ebfae1dccf807bb34d88f2cd024d4b14da7 (diff) | |
download | libmbim-bc15bede4aeca0651a5c85fb54d407453e7d5af8.tar.gz |
libmbim-glib: Increase the retry interval to 5 seconds.
Sierra Mobile Broadband EM7455 won't work while the retry interval is
only one second.
https://bugs.freedesktop.org/show_bug.cgi?id=91189
Signed-off-by: Shih-Yuan Lee (FourDollars) <sylee@canonical.com>
-rw-r--r-- | src/libmbim-glib/mbim-device.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libmbim-glib/mbim-device.c b/src/libmbim-glib/mbim-device.c index d434665..c0bb5da 100644 --- a/src/libmbim-glib/mbim-device.c +++ b/src/libmbim-glib/mbim-device.c @@ -33,6 +33,7 @@ #include <gudev/gudev.h> #include <sys/ioctl.h> #define IOCTL_WDM_MAX_COMMAND _IOR('H', 0xA0, guint16) +#define RETRY_TIMEOUT_SECS 5 #include "mbim-utils.h" #include "mbim-device.h" @@ -1117,7 +1118,7 @@ typedef struct { GCancellable *cancellable; DeviceOpenContextStep step; MbimDeviceOpenFlags flags; - guint timeout; + gint timeout; } DeviceOpenContext; static void @@ -1190,8 +1191,8 @@ open_message_ready (MbimDevice *self, /* Check if we should be retrying */ if (g_error_matches (error, MBIM_CORE_ERROR, MBIM_CORE_ERROR_TIMEOUT)) { /* The timeout will tell us how many retries we should do */ - ctx->timeout--; - if (ctx->timeout) { + ctx->timeout -= RETRY_TIMEOUT_SECS; + if (ctx->timeout > 0) { g_error_free (error); open_message (ctx); return; @@ -1231,7 +1232,7 @@ open_message (DeviceOpenContext *ctx) ctx->self->priv->max_control_transfer); mbim_device_command (ctx->self, request, - 1, /* 1s per retry */ + RETRY_TIMEOUT_SECS, ctx->cancellable, (GAsyncReadyCallback)open_message_ready, ctx); |