[PATCH v2 2/2] huawei: delay processing of network initiated bearer disconnection
Aleksander Morgado
aleksander at lanedo.com
Thu Sep 19 01:28:29 PDT 2013
On 09/19/2013 10:12 AM, Ben Chan wrote:
> void
> mm_broadband_bearer_huawei_report_connection_status (MMBroadbandBearerHuawei *self,
> @@ -651,10 +673,25 @@ mm_broadband_bearer_huawei_report_connection_status (MMBroadbandBearerHuawei *se
>
> /* We already use ^NDISSTATQRY? to poll the connection status, so only
> * handle network-initiated disconnection here. */
> - if (!connected) {
> - mm_dbg ("Disconnect bearer '%s'", mm_bearer_get_path (MM_BEARER (self)));
> - mm_bearer_report_status (MM_BEARER (self), MM_BEARER_STATUS_DISCONNECTED);
> - }
> + if (connected)
> + return;
> +
> + /* Ignore multiple disconnect signals, while we're still processing one */
> + if (self->priv->network_disconnect_pending_id != 0)
> + return;
> +
> + mm_dbg ("Post delayed task to disconnect bearer '%s'", mm_bearer_get_path (MM_BEARER (self)));
> + /* A firmware bug in MU736 causes the network initiated network
> + * disconnect signal to fire prematurely. We must give modem a little
> + * time to actually disconnect the bearer. Otherwise, it is possible to
> + * confuse the modem if a reconnect is attempted too soon.
> + *
> + * Since this is a small timeout, we currently do this for all Huawei modems.
> + */
> + mm_bearer_report_status (MM_BEARER (self), MM_BEARER_STATUS_DISCONNECTING);
This doesn't change the value of the actual bearer status property, does it?
> + self->priv->network_disconnect_pending_id = g_timeout_add_seconds (4,
> + (GSourceFunc) network_disconnect_3gpp_delayed,
> + self);
> }
>
Couldn't we re-use the new report_status() method in MMBearerClass to
handle this mm_broadband_bearer_huawei_report_connection_status()?
In order not to directly cleanup stuff in the parent classes, the Huawei
modem could use mm_bearer_report_status(DISCONNECTING) when it receives
a network-initiated disconnection notification (so parent methods won't
do anything as they only do something upon DISCONNECTED). Then, once the
timeout happens, the bearer does mm_bearer_report_status(DISCONNECTED)
itself.
--
Aleksander
More information about the ModemManager-devel
mailing list