<div dir="auto">Hey!<br><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Sep 12, 2017 17:31, "Dan Williams" <<a href="mailto:dcbw@redhat.com">dcbw@redhat.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">If a suspend/resume cycle happens or ModemManager is restarted (e.g.<br>
after a crash) the modem may be left with a given session id<br>
connected. With this change we're forcing a session disconnection<br>
before we attempt a session connection.<br>
<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=102231" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=102231</a><br>
</div>(cherry picked from commit 0c7f3380ae96698e496abce1e55c52<wbr>d21449d57a)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">Good for mm-1-6</span><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/mm-bearer-mbim.c | 49 ++++++++++++++++++++++++++++++<wbr>+++++++++++++++++++<br>
1 file changed, 49 insertions(+)<br>
<br>
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c<br>
index 5be16d8..4bf3f1d 100644<br>
--- a/src/mm-bearer-mbim.c<br>
+++ b/src/mm-bearer-mbim.c<br>
@@ -221,6 +221,7 @@ typedef enum {<br>
<div class="quoted-text"> CONNECT_STEP_FIRST,<br>
CONNECT_STEP_PACKET_SERVICE,<br>
CONNECT_STEP_PROVISIONED_<wbr>CONTEXTS,<br>
+ CONNECT_STEP_ENSURE_<wbr>DISCONNECTED,<br>
CONNECT_STEP_CONNECT,<br>
CONNECT_STEP_IP_CONFIGURATION,<br>
CONNECT_STEP_LAST<br>
</div>@@ -638,6 +639,23 @@ connect_set_ready (MbimDevice *device,<br>
<div class="quoted-text"> }<br>
<br>
static void<br>
+ensure_disconnected_ready (MbimDevice *device,<br>
+ GAsyncResult *res,<br>
</div>+ ConnectContext *ctx)<br>
+{<br>
+ MbimMessage *response;<br>
+<br>
<div class="quoted-text">+ /* Ignore all errors, just go on */<br>
+ response = mbim_device_command_finish (device, res, NULL);<br>
+ if (response)<br>
+ mbim_message_unref (response);<br>
+<br>
+ /* Keep on */<br>
+ ctx->step++;<br>
</div>+ connect_context_step (ctx);<br>
+}<br>
+<br>
+static void<br>
<div class="quoted-text"> provisioned_contexts_query_<wbr>ready (MbimDevice *device,<br>
GAsyncResult *res,<br>
</div> ConnectContext *ctx)<br>
@@ -815,6 +833,37 @@ connect_context_step (ConnectContext *ctx)<br>
<div class="quoted-text"> mbim_message_unref (message);<br>
return;<br>
<br>
+ case CONNECT_STEP_ENSURE_<wbr>DISCONNECTED: {<br>
+ MbimMessage *message;<br>
+ GError *error = NULL;<br>
+<br>
+ message = (mbim_message_connect_set_new (<br>
</div>+ ctx->self->priv->session_id,<br>
<div class="quoted-text">+ MBIM_ACTIVATION_COMMAND_<wbr>DEACTIVATE,<br>
+ "",<br>
+ "",<br>
+ "",<br>
+ MBIM_COMPRESSION_NONE,<br>
+ MBIM_AUTH_PROTOCOL_NONE,<br>
+ MBIM_CONTEXT_IP_TYPE_DEFAULT,<br>
+ mbim_uuid_from_context_type (MBIM_CONTEXT_TYPE_INTERNET),<br>
+ &error));<br>
+ if (!message) {<br>
</div>+ g_simple_async_result_take_<wbr>error (ctx->result, error);<br>
+ connect_context_complete_and_<wbr>free (ctx);<br>
<div class="quoted-text">+ return;<br>
+ }<br>
+<br>
+ mbim_device_command (ctx->device,<br>
+ message,<br>
+ 30,<br>
+ NULL,<br>
+ (GAsyncReadyCallback)ensure_<wbr>disconnected_ready,<br>
</div>+ ctx);<br>
<div class="quoted-text">+ mbim_message_unref (message);<br>
+ return;<br>
+ }<br>
+<br>
case CONNECT_STEP_CONNECT: {<br>
const gchar *apn;<br>
const gchar *user;<br>
--<br>
</div>2.9.5<br>
</blockquote></div><br></div></div>