Hi,

2016-11-14 14:51 GMT+01:00 Daniele Palmas <dnl...@gmail.com>:
> Hi,
>
> I'm struggling with Telit LE922 modem that presents an MBIM device.
> The modem works fine in Windows, while in Linux (tested with 4.9 rc1)
> data connection is not functional: using ifconfig I can see
>
> wwp0s20u8i2 Link encap:Ethernet  HWaddr e6:c0:3b:97:80:de
>           inet addr:176.246.94.9  Bcast:176.246.94.11  Mask:255.255.255.252
>           UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1 errors:15 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:40 (40.0 B)
>
> so the issue seems to be in tx.
>
> I'm using an USB hw sniffer for trying to understand the problem; this
> is an example of a NCM packet with Windows 10 driver:
>
> 4E 43 4D 48 0C 00 0B 02 48 00 38 00 45 00 00 28
> 78 E8 40 00 80 06 63 68 05 5C 7A E5 D8 3A C6 03
> E9 08 01 BB FB 36 F0 EA C6 8C D8 CB 50 10 80 00
> 9B 16 00 00 00 00 00 00 49 50 53 00 10 00 00 00
> 0C 00 28 00 00 00 00 00
>
> 16 bit NTB, with NDP at the end. So I enabled CDC_NCM_FLAG_NDP_TO_END,
> but still the device is not properly working.
>
> This is the first properly transmitted acked packet in Linux:
>
> 4E 43 4D 48 0C 00 00 00 80 00 34 00 46 C0 00 28
> 00 00 40 00 01 02 F4 F9 B0 F6 5E 09 E0 00 00 16
> 94 04 00 00 22 00 F9 02 00 00 00 01 04 00 00 00
> E0 00 00 FB 49 50 53 00 10 00 00 00 0C 00 28 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> that looks like quite similar than the Windows one (besides the final 
> padding).
>
> Then all the following out packets are nacked, e.g:
>
> 4E 43 4D 48 0C 00 01 00 D8 00 8C 00 45 00 00 3E
> 05 71 40 00 40 11 0C E8 B0 F6 5E 09 0A 85 0E D2
> B3 30 00 35 00 2A D3 57 58 6A 01 00 00 01 00 00
> 00 00 00 00 05 64 61 69 73 79 06 75 62 75 6E 74
> 75 03 63 6F 6D 00 00 01 00 01 00 00 45 00 00 3E
> 2A EC 40 00 40 11 91 8A B0 F6 5E 09 0A 84 64 B5
> B3 30 00 35 00 2A 7D 75 58 6A 01 00 00 01 00 00
> 00 00 00 00 05 64 61 69 73 79 06 75 62 75 6E 74
> 75 03 63 6F 6D 00 00 01 00 01 00 00 49 50 53 00
> 14 00 00 00 0C 00 3E 00 4C 00 3E 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00
>
> Those packets look good to me: the main difference with Windows is the
> presence of more than one datagram, but, as far as I understand, this
> should not be a problem since the modem reports:
>
> dwNtbInMaxSize=16384 dwNtbOutMaxSize=16384 wNdpOutPayloadRemainder=0
> wNdpOutDivisor=4 wNdpOutAlignment=4 wNtbOutMaxDatagrams=16 flags=0x20
>
> while in Windows it seems that always only one datagram is sent.
>
> My thought is that the problem is in the modem firmware: in some way,
> the first acked packet is breaking things inside the modem that is not
> able to receive packets anymore, but maybe there is some other
> problems in the tx packets created by the driver and I'm not able to
> catch it.
>

I was wrong, the problem is not with the first packet.

The problem is in cdc_ncm, function cdc_ncm_bind_common, line

usleep_range(10000, 20000);

It seems that LE922 needs an higher timeout; changing the line to

usleep_range(70000, 80000);

makes the modem to work fine.

I will submit a patch for this.

Regards,
Daniele

> Does someone have an hint about this?
>
> Is there a way to configure the cdc_mbim driver in order to have
> exactly the same packet format sent in Windows?
>
> USB traces taken with TotalPhase Datacenter are available at
>
> https://drive.google.com/open?id=0B1kPnH2g8ISIZWJiV05qeWN5dVE
>
> Thanks,
> Daniele
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to