MC7304 connection?

Aleksander Morgado aleksander at aleksander.es
Wed May 21 01:16:01 PDT 2014


On Tue, May 20, 2014 at 11:04 PM, Dan Williams <dcbw at redhat.com> wrote:
>> Now I'm confused... ModemManager will by default open the port with
>> the 802.3 flag; so why did my previous tests with MM fail? :/
>
> I was going to ask that same question, actually...  Maybe we could just
> sanity-check after opening the port, that the data format options
> actually worked?

Ok, I believe I know why it worked with qmicli but MM failed to handle
it properly.

The modem gets exposed by the kernel with 3 pairs of QMI+WWAN interfaces.

qmi_wwan 2-1.1:1.8: cdc-wdm1: USB WDM device
qmi_wwan 2-1.1:1.8 wwan0: register 'qmi_wwan' at usb-0000:00:1d.0-1.1,
WWAN/QMI device, 16:ae:fe:26:4b:78
qmi_wwan 2-1.1:1.10: cdc-wdm2: USB WDM device
qmi_wwan 2-1.1:1.10 wwan1: register 'qmi_wwan' at
usb-0000:00:1d.0-1.1, WWAN/QMI device, 16:ae:fe:26:4b:78
qmi_wwan 2-1.1:1.11: cdc-wdm3: USB WDM device
qmi_wwan 2-1.1:1.11 wwan2: register 'qmi_wwan' at
usb-0000:00:1d.0-1.1, WWAN/QMI device, 16:ae:fe:26:4b:78
systemd-udevd[9333]: renamed network interface wwan0 to wwp0s29u1u1i8
systemd-udevd[9335]: renamed network interface wwan1 to wwp0s29u1u1i10
systemd-udevd[9333]: renamed network interface wwan2 to wwp0s29u1u1i11


 In my environment, systemd will rename the interfaces when they are
plugged in, so the pairs end up being:
  * cdc-wdm1 and wwp0s29u1u1i8
  * cdc-wdm2 and wwp0s29u1u1i10
  * cdc-wdm3 and wwp0s29u1u1i11

The last pair doesn't reply to my QMI messages at all.

The interesting ones are the first and second pairs. When the modem
gets plugged in, the first pair will report by default a link-layer
protocol of Raw IP; while the second pair will report a link-layer
protocol of 802.3 Ethernet frames:

$ sudo qmicli -d /dev/cdc-wdm1 --wda-get-data-format
[/dev/cdc-wdm1] Successfully got data format
                   QoS flow header: no
               Link layer protocol: 'ip'   <-------------------
  Uplink data aggregation protocol: 'disabled'
Downlink data aggregation protocol: 'disabled'
                     NDP signature: '0'
  Uplink data aggregation max size: '0'
Downlink data aggregation max size: '0'

$ sudo qmicli -d /dev/cdc-wdm2 --wda-get-data-format
[/dev/cdc-wdm2] Successfully got data format
                   QoS flow header: no
               Link layer protocol: '802-3'  <-------------------
  Uplink data aggregation protocol: 'disabled'
Downlink data aggregation protocol: 'disabled'
                     NDP signature: '0'
  Uplink data aggregation max size: '0'
Downlink data aggregation max size: '0'


Setting up the connection on the first pair works nicely if by default
we switch to 802.3 before having the modem connected (or in the same
--wds-start-network call):

$ sudo qmicli -d /dev/cdc-wdm1 --client-no-release-cid
--wds-start-network="gprs-service.com"
--device-open-net="net-802-3|net-no-qos-header"
[/dev/cdc-wdm1] Network started
Packet data handle: '1205627368'
[/dev/cdc-wdm1] Client ID not released:
Service: 'wds'
   CID: '9'

$ sudo ip link set wwp0s29u1u1i8 up
$ sudo dhclient wwp0s29u1u1i8
$ ip addr
6: wwp0s29u1u1i8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UNKNOWN group default qlen 1000
    link/ether f6:e7:c0:80:a0:9a brd ff:ff:ff:ff:ff:ff
    inet 10.143.195.247/28 brd 10.143.195.255 scope global wwp0s29u1u1i8
       valid_lft forever preferred_lft forever
    inet6 fe80::f4e7:c0ff:fe80:a09a/64 scope link
       valid_lft forever preferred_lft forever

(all good!)

$ sudo ip link set wwp0s29u1u1i8 down

$ sudo qmicli -d /dev/cdc-wdm1 --client-cid=9 --wds-stop-network="1205627368"
Network cancelled... releasing resources
[/dev/cdc-wdm1] Network stopped


But, hey, the same sequence doesn't work in the second pair:

$ sudo qmicli -d /dev/cdc-wdm2 --client-no-release-cid
--wds-start-network="gprs-service.com"
--device-open-net="net-802-3|net-no-qos-header"
[/dev/cdc-wdm2] Network started
Packet data handle: '1205670576'
[/dev/cdc-wdm2] Client ID not released:
Service: 'wds'
   CID: '10'

$ sudo ip link set wwp0s29u1u1i10 up

$ sudo dhclient wwp0s29u1u1i10

(This command takes a long time to exit, and it actually does nothing)

$ ip addr
7: wwp0s29u1u1i10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 3a:c2:ae:92:98:d3 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::38c2:aeff:fe92:98d3/64 scope link
       valid_lft forever preferred_lft forever

$ sudo ip link set wwp0s29u1u1i10 down

$ sudo qmicli -d /dev/cdc-wdm2 --client-cid=10 --wds-stop-network="1205670576"
Network cancelled... releasing resources
[/dev/cdc-wdm2] Network stopped

Basically, the network interface in the second pair doesn't like any
of the setups. I've also tried to avoid explicitly requesting 802.3 in
this interface as by default it already comes with it (i.e. without
--device-open-net="net-802-3|net-no-qos-header") but that yielded the
same results, the WWAN interface is unusable...


Now, the problem with ModemManager failing to use the modem was
actually that even if it used cdc-wdm1 as primary control port, it
then relied on the second pair (cdc-wdm2 and wwp0s29u1u1i10) for the
actual connection in the bearer, and that failed. If I modify the
qmi_wwan driver to just peek interface #8 (i.e. ignoring #10 and #11),
it just works :)

So, what to do with these two interfaces now? Should we just ignore
them in the kernel driver? Is there anything else I could try with? I
may try to implement "WDA Set Data Format" and play with it...

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list