[PATCH] huawei: ignore ^PDPDEACT unsolicited messages
Dan Williams
dcbw at redhat.com
Tue Aug 6 14:12:14 PDT 2013
On Tue, 2013-08-06 at 10:10 -0700, Ben Chan wrote:
> ---
> plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
Pushed, thanks. At some point we'd care about this to get notification
of unexpected PDP context deactivation, possibly network-initiated or
something like that, and then we'd indicate that the bearer has been
deactivated and IP service is no longer available.
Dan
> diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
> index 15f3524..b393f31 100644
> --- a/plugins/huawei/mm-broadband-modem-huawei.c
> +++ b/plugins/huawei/mm-broadband-modem-huawei.c
> @@ -93,6 +93,7 @@ struct _MMBroadbandModemHuaweiPrivate {
> GRegex *stin_regex;
> GRegex *hcsq_regex;
> GRegex *ndisstat_regex;
> + GRegex *pdpdeact_regex;
>
> NdisdupSupport ndisdup_support;
> RfswitchSupport rfswitch_support;
> @@ -2838,6 +2839,10 @@ set_ignored_unsolicited_events_handlers (MMBroadbandModemHuawei *self)
> ports[i],
> self->priv->ndisstat_regex,
> NULL, NULL, NULL);
> + mm_at_serial_port_add_unsolicited_msg_handler (
> + ports[i],
> + self->priv->pdpdeact_regex,
> + NULL, NULL, NULL);
> }
> }
>
> @@ -2909,6 +2914,8 @@ mm_broadband_modem_huawei_init (MMBroadbandModemHuawei *self)
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> self->priv->ndisstat_regex = g_regex_new ("\\r\\n\\^NDISSTAT:.+\\r+\\n",
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> + self->priv->pdpdeact_regex = g_regex_new ("\\r\\n\\^PDPDEACT:.+\\r+\\n",
> + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
>
> self->priv->ndisdup_support = NDISDUP_SUPPORT_UNKNOWN;
> self->priv->rfswitch_support = RFSWITCH_SUPPORT_UNKNOWN;
> @@ -2934,6 +2941,7 @@ finalize (GObject *object)
> g_regex_unref (self->priv->stin_regex);
> g_regex_unref (self->priv->hcsq_regex);
> g_regex_unref (self->priv->ndisstat_regex);
> + g_regex_unref (self->priv->pdpdeact_regex);
>
> G_OBJECT_CLASS (mm_broadband_modem_huawei_parent_class)->finalize (object);
> }
More information about the ModemManager-devel
mailing list