[PATCH 2/2 v3] mbimcli: new '--ms-query-firmware-id' action

Bjørn Mork bjorn at mork.no
Thu Feb 27 05:58:38 PST 2014


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 


Bjørn


More information about the libmbim-devel mailing list