[PATCH 2/2 v3] mbimcli: new '--ms-query-firmware-id' action
aleksander at aleksander.es
Thu Feb 27 05:48:34 PST 2014
On Thu, Feb 27, 2014 at 12:30 PM, Bjørn Mork <bjorn at mork.no> wrote:
>> [27 Feb 2014, 10:51:39] [Debug] [/dev/cdc-wdm1] Received message (translated)...
>>>>>>>> length = 48
>>>>>>>> type = command-done (0x80000003)
>>>>>>>> transaction = 2
>>>>>>>> Fragment header:
>>>>>>>> total = 1
>>>>>>>> current = 0
>>>>>>>> status error = 'NoDeviceSupport' (0x00000009)
>>>>>>>> service = 'invalid' (00000000-0000-0000-0000-000000000000)
>>>>>>>> cid = '(null)' (0x00000001)
The main problem is that the mbimcli ends up ignoring the status error
field, retrievable with mbim_message_command_done_get_status_code().
We should make sure we have no error before parsing the remaining
contents of the message.
> I started wondering if this reply is really according to spec or not.
> But I cannot say for sure. Anyone else know?
Yeah, no idea if the logic for handling unknown services is supported or not.
> Unless I've missed something, then the "unsupported service" behaviour
> is not clearly defined. I guess the assumption is that a well behaved
> host will never send an unsupported command.
> Well, I'm pretty sure hosts will do in the real world, so I do consider
> this an error in the spec.
Yeah, hosts can check whether a given service is supported by looking
at the "Basic Connect" "Device Services" response, but I wouldn't like
to add this check as mandatory in the MbimDevice, as that wouldn't
allow us to play with it... but it probably is a good check to do in
ModemManager for example.
> A MBIM_FUNCTION_ERROR_MSG response would have made sense IMO, but there
> are no suitable error codes so it cannot be used (without an addional
> error code for this purpose).
> The MBIM_COMMAND_DONE with a 'NoDeviceSupport' status, like the DWM-156
> do, looks like the best alternative within the current spec. It would
> have been nice if the unknown service UUID was copied from the request,
> but I cannot find any such requirement. So I guess the response above is
> OK. The 'NoDeviceSupport' is independent of CID and service anyway, so
> the service UUID doesn't really matter.
> Note that the Huawei E367 firmware doesn't respond to unknown services
> at all. AFAICS, this is also allowed by the spec. Although I do
> believe it is better to do as the DWM-156, allowing errors to be caught
> immediately instead of depending on timeouts.
>From libmbim's point of view, we just need to make sure we handle all
the possible cases graciously, I guess.
More information about the libmbim-devel