[PATCH 2/2 v3] mbimcli: new '--ms-query-firmware-id' action
Ben Chan
benchan at chromium.org
Thu Feb 27 10:30:05 PST 2014
On Thu, Feb 27, 2014 at 5:58 AM, Bjørn Mork <bjorn at mork.no> wrote:
> Aleksander Morgado <aleksander at aleksander.es> writes:
>
> > 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)...
> >>>>>>>>> Header:
> >>>>>>>>> length = 48
> >>>>>>>>> type = command-done (0x80000003)
> >>>>>>>>> transaction = 2
> >>>>>>>>> Fragment header:
> >>>>>>>>> total = 1
> >>>>>>>>> current = 0
> >>>>>>>>> Contents:
> >>>>>>>>> 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.
>
> Yes, you should never touch the InformationBuffer unless the status
> field indicates success, except for the messages where an
> InformationBuffer is explicitly allowed on errors. Section 9.4.5 "USE
> OF THE STATUS CODES" lists these CIDs with a non-empty InformationBuffer
> on error:
>
> MBIM_CID_REGISTER_STATE
> MBIM_CID_PACKET_SERVICE
> MBIM_CID_CONNECT
> MBIM_CID_SERVICE_ACTIVATION
>
>
Thanks for pointing that out. There are a few places in mbimcli that don't
check the status code in the command-done message before parsing the
response. I've submitted a patch to fix that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libmbim-devel/attachments/20140227/00dca6fc/attachment.html>
More information about the libmbim-devel
mailing list