<div dir="ltr">Greg,<div><br></div><div>The patch looks correct. Are you able to reproduce the issue and capture the MM log?</div><div><br></div><div>Thanks,</div><div>Ben</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 23, 2014 at 1:15 PM, Greg Suarez <span dir="ltr"><<a href="mailto:gpsuarez2512@gmail.com" target="_blank">gpsuarez2512@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When the MBIM modem unexpectedly loses connection the port state never<br>
gets set as disconnected thus when trying to reestablish a new<br>
connection the bearer cannot find a port in the disconnected state.<br>
<br>
Signed-off-by: Greg Suarez <<a href="mailto:gpsuarez2512@gmail.com">gpsuarez2512@gmail.com</a>><br>
---<br>
 src/mm-bearer-mbim.c | 27 +++++++++++++++++++++++++--<br>
 1 file changed, 25 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c<br>
index 358b261..c554c52 100644<br>
--- a/src/mm-bearer-mbim.c<br>
+++ b/src/mm-bearer-mbim.c<br>
@@ -950,6 +950,15 @@ disconnect_finish (MMBaseBearer *self,<br>
     return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);<br>
 }<br>
<br>
+static void<br>
+reset_bearer_connection (MMBearerMbim *self)<br>
+{<br>
+    if (self->priv->data) {<br>
+        mm_port_set_connected (self->priv->data, FALSE);<br>
+        g_clear_object (&self->priv->data);<br>
+    }<br>
+}<br>
+<br>
 static void disconnect_context_step (DisconnectContext *ctx);<br>
<br>
 static void<br>
@@ -1064,8 +1073,7 @@ disconnect_context_step (DisconnectContext *ctx)<br>
<br>
     case DISCONNECT_STEP_LAST:<br>
         /* Port is disconnected; update the state */<br>
-        mm_port_set_connected (ctx->self->priv->data, FALSE);<br>
-        g_clear_object (&ctx->self->priv->data);<br>
+        reset_bearer_connection (ctx->self);<br>
<br>
         g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);<br>
         disconnect_context_complete_and_free (ctx);<br>
@@ -1126,6 +1134,20 @@ mm_bearer_mbim_get_session_id (MMBearerMbim *self)<br>
<br>
 /*****************************************************************************/<br>
<br>
+static void<br>
+report_connection_status (MMBaseBearer *self,<br>
+                          MMBearerConnectionStatus status)<br>
+{<br>
+    if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED)<br>
+        /* Cleanup all connection related data */<br>
+        reset_bearer_connection (MM_BEARER_MBIM (self));<br>
+<br>
+    /* Chain up parent's report_connection_status() */<br>
+    MM_BASE_BEARER_CLASS (mm_bearer_mbim_parent_class)->report_connection_status (self, status);<br>
+}<br>
+<br>
+/*****************************************************************************/<br>
+<br>
 MMBaseBearer *<br>
 mm_bearer_mbim_new (MMBroadbandModemMbim *modem,<br>
                     MMBearerProperties *config,<br>
@@ -1221,6 +1243,7 @@ mm_bearer_mbim_class_init (MMBearerMbimClass *klass)<br>
     base_bearer_class->connect_finish = connect_finish;<br>
     base_bearer_class->disconnect = disconnect;<br>
     base_bearer_class->disconnect_finish = disconnect_finish;<br>
+    base_bearer_class->report_connection_status = report_connection_status;<br>
<br>
     properties[PROP_SESSION_ID] =<br>
         g_param_spec_uint (MM_BEARER_MBIM_SESSION_ID,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
<br>
_______________________________________________<br>
ModemManager-devel mailing list<br>
<a href="mailto:ModemManager-devel@lists.freedesktop.org">ModemManager-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel</a><br>
</font></span></blockquote></div><br></div>