Page MenuHomeFreeBSD

usb: umb: locate MBIM data interface using IAD
Needs ReviewPublic

Authored by luca.piccirillo_gmail.com on Tue, Aug 4, 11:01 AM.
Tags
None
Referenced Files
F168586784: D58641.id183375.diff
Sat, Aug 29, 3:43 AM
F168481174: D58641.diff
Fri, Aug 28, 2:55 PM
Unknown Object (File)
Wed, Aug 26, 10:36 AM
Unknown Object (File)
Sun, Aug 23, 9:06 PM
Unknown Object (File)
Fri, Aug 21, 9:33 PM
Unknown Object (File)
Thu, Aug 20, 1:01 PM
Unknown Object (File)
Tue, Aug 18, 7:24 PM
Unknown Object (File)
Sun, Aug 16, 7:26 PM
Subscribers

Details

Summary

Some MBIM devices do not provide a CDC Union Functional Descriptor.

umb_attach() contains a misleading comment claiming that the driver
also examines matching Interface Association Descriptors to identify
the MBIM data interface. However, the implementation only examines the
CDC Union descriptor. If that descriptor is absent, data_ifaceno
remains unset and attachment fails.

Implement the IAD fallback described by the existing comment. Locate
the IAD containing the MBIM control interface, then search the
interfaces within that association for a CDC data interface.

This allows also MDM9200-based Sierra Wireless AirPrime modems to
attach in its MBIM USB configuration. The tested device associates MBIM
control interface 12 with CDC data interface 13 using an IAD, without
providing a CDC Union descriptor.

Without this change, attachment fails with:

umb0: error: no data interface found
Test Plan

This change only takes effect for devices that were previously erroring out.
I take an MBIM device without CDC UD and with IAD, in my case it was an MC7710.
I tested in UDUSBCOMP=14 which is a double configuration composition having in its Config2
an equivalent composition which only presents MBIM interfaces.
I also tested UDUSBCOMP=13 which is another double configuration composition having in its
Config2 an equivalent composition which presents DM, NMEA, AT and MBIM interfaces.

As a reference, here is the MC7710 compositions table:

!UDPID: 68A2
!UDUSBCOMP: 14

AT!UDUSBCOMP=?
0  - HIP  DM    NMEA  AT    MDM1  MDM2  MDM3  MS  NOT SUPPORTED
1  - HIP  DM    NMEA  AT    MDM1  MS              NOT SUPPORTED
2  - HIP  DM    NMEA  AT    NIC1  MS              NOT SUPPORTED
3  - HIP  DM    NMEA  AT    MDM1  NIC1  MS        NOT SUPPORTED
4  - HIP  DM    NMEA  AT    NIC1  NIC2  NIC3  MS  NOT SUPPORTED
5  - HIP  DM    NMEA  AT    ECM1  MS              NOT SUPPORTED
6  - DM   NMEA  AT    QMI                         SUPPORTED
7  - DM   NMEA  AT    RMNET1 RMNET2 RMNET3        SUPPORTED
8  - DM   NMEA  AT    MBIM                        SUPPORTED
9  - MBIM                                         SUPPORTED
10 - NMEA MBIM                                    SUPPORTED
11 - DM   MBIM                                    SUPPORTED
12 - DM   NMEA  MBIM                              SUPPORTED
13 - Config1: comp6    Config2: comp8             SUPPORTED
14 - Config1: comp6    Config2: comp9             SUPPORTED
15 - Config1: comp6    Config2: comp10            SUPPORTED
16 - Config1: comp6    Config2: comp11            SUPPORTED
17 - Config1: comp6    Config2: comp12            SUPPORTED
18 - Config1: comp7    Config2: comp8             SUPPORTED
19 - Config1: comp7    Config2: comp9             SUPPORTED
20 - Config1: comp7    Config2: comp10            SUPPORTED
21 - Config1: comp7    Config2: comp11            SUPPORTED
22 - Config1: comp7    Config2: comp12            SUPPORTED

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped