ERROR: mbim message timeout - (using umbim on OpenWRT)

Aleksander Morgado aleksander at
Thu Mar 12 11:34:04 PDT 2015

On Thu, Mar 12, 2015 at 2:31 PM, Bjørn Mork <bjorn at> wrote:
>> There is actually code for MBIM_CID_IP_CONFIGURATION in the umbim source
>> but it is not used in the connection script. I tried to add it and it gets
>> DNS and gateway configuration right, but the IP address if wrong (I only
>> tested ipv4 configuration, nor sure if ipv6 works).
> Yes, I noticed that as well a while ago.  Actually went as far as
> thinking I could fix it.  That's when I discovered the design thinko in
> the data/ script: They try to convert every MBIM message
> into a static sized struct.
> That will obviously never work for any message with variable sized
> fields.  At least not any message varying at multiple places, and not
> just the end.  The MBIM_CID_IP_CONFIGURATION reply is a very complex
> message, with flags indicating the presence of IPv4 and/or IPv6 data,
> and each of those sets containing multple variable length arrays of
> addresses.  You just cannot create a single struct matching that...
> But that's what they try to do:
> struct mbim_basic_connect_ip_configuration_r {
>         uint32_t sessionid;
>         /* enum MbimIPConfigurationAvailableFlag */
>         uint32_t ipv4configurationavailable;
>         /* enum MbimIPConfigurationAvailableFlag */
>         uint32_t ipv6configurationavailable;
>         uint32_t ipv4addresscount;
>         /* struct mbimipv4element */
>         uint32_t ipv4address;
>         uint32_t ipv6addresscount;
>         /* struct mbimipv6element */
>         uint32_t ipv6address;
>         /* array type: ref-ipv4 */
>         uint32_t ipv4gateway;
>         /* array type: ref-ipv6 */
>         uint32_t ipv6gateway;
>         uint32_t ipv4dnsservercount;
>         /* array type: ipv4-array */
>         uint32_t ipv4dnsserver;
>         uint32_t ipv6dnsservercount;
>         /* array type: ipv6-array */
>         uint32_t ipv6dnsserver;
>         uint32_t ipv4mtu;
>         uint32_t ipv6mtu;
> } __attribute__((packed));
> Not really a show stopper.  Anything can be fixed.  It just wasn't the
> quick fix I imagined it would be, so I decided to let it be.

As opposed to QMI, which has the TLVs, MBIM messages are fixed in
format and more or less separate the "static" fixed-size part of the
message and the "dynamic" part. E.g. a string is defined by
size+offset in the static part and then its contents are given in the
dynamic part. That means that it would be possible to create structs
where at least the fixed-size part is defined in the struct. I've got
a WIP implementation doing that partially, as I also wanted to use
MBIM in an embedded system which didn't have glib.


More information about the libmbim-devel mailing list