[PATCH] bearer-mbim: stop trying to reload stats on OperationNotAllowed

Dan Williams dcbw at redhat.com
Mon Aug 7 15:40:36 UTC 2017


On Sun, 2017-08-06 at 13:21 +0200, Aleksander Morgado wrote:
> The Sierra Wireless EM7345 reports OperationNotAllowed when trying to
> load stats, just cancel stats reloading if so.

LGTM.

>     ModemManager[8318]: [/dev/cdc-wdm1] Received message
> (translated)...
>     >>>>>> Header:
>     >>>>>>   length      = 48
>     >>>>>>   type        = command-done (0x80000003)
>     >>>>>>   transaction = 24
>     >>>>>> Fragment header:
>     >>>>>>   total   = 1
>     >>>>>>   current = 0
>     >>>>>> Contents:
>     >>>>>>   status error = 'OperationNotAllowed' (0x0000001c)
>     >>>>>>   service      = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-
> 133ec2aae6df)
>     >>>>>>   cid          = 'packet-statistics' (0x00000014)
> ---
>  src/mm-bearer-mbim.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
> index 62f774d4..6d7aea6d 100644
> --- a/src/mm-bearer-mbim.c
> +++ b/src/mm-bearer-mbim.c
> @@ -169,6 +169,9 @@ packet_statistics_query_ready (MbimDevice
> *device,
>          stats->rx_bytes = in_octets;
>          stats->tx_bytes = out_octets;
>          g_task_return_pointer (task, stats, g_free);
> +    } else if (g_error_matches (error, MBIM_STATUS_ERROR,
> MBIM_STATUS_ERROR_OPERATION_NOT_ALLOWED)) {
> +        g_clear_error (&error);
> +        g_task_return_new_error (task, MM_CORE_ERROR,
> MM_CORE_ERROR_UNSUPPORTED, "operation not allowed");
>      } else
>          g_task_return_error (task, error);
>  


More information about the ModemManager-devel mailing list