Devices and Drivers
Device manufacturers tend to only provide support for systems where they know they can get a direct ROI. The most obvious case being Windows: manufacturers will make sure that, in some way or the other, their devices are properly supported in this operating system, regardless of the incompatibilities and upgrades this operating system takes. They will end up providing device drivers for the system, and even additional software to control the device (e.g. connection managers for mobile broadband modems), and all this in order to let users use their devices easily. In the world of free software, though, everyone knows that there is no such thing as vendor-provided drivers that need to get installed in the system before using a given new device; the user expects the device to work out of the box, and for that to happen there has to be someone, somewhere in the world, doing the necessary fixes in any of the involved software components of the system.
Supporting a new modem device is usually just a matter of implementing the needed vendor-specific features to make it work. These could be just new AT commands, device-specific logic to be applied in the software which controls it (e.g. which AT port to use for PPP), or even a completely new protocol (e.g. QMI or MBIM). But the needed support gets much nastier as soon as you end up finding bugs in the device’s firmware. The firmware is the software running inside the device itself, the one your computer needs to talk to in order to have the device do something. If the device doesn’t work as it should, according to its own specifications, then there are three things you can do: throw it away; try to upgrade the firmware hoping that the manufacturer already fixed the problem; or try to workaround it. Of course, there are firmware bugs that could just be ignored if they don’t affect the normal device behaviour, but there are some others that are so bad, that useful device operation is not possible without a quick fix or workaround, as manufacturers don’t really release firmware updates very often, if ever.
The most annoying and critical thing we have recently found is the case where QMI modems connected to a LTE network (aka 4G) may end up not using an ethernet header in the packets issued by the modem through the net interface; while they do use an ethernet header if connected to 2G or 3G networks. An ethernet header is an integral part of every packet sent from the device regardless of the physical network being used, as such it’s expected by the driver software. As you may have guessed, the Linux kernel neither knows nor needs to know to which kind of network a given mobile broadband modem is connected to; but still needs to process the packets exposed by the device. From the user’s point of view, this specific issue appears as a full lack of connectivity when the modem is connected to a 4G network: the modem performs the connection procedure (e.g. through ModemManager), but then the connection manager is unable to setup an IP address in the interface (e.g. dhclient through NetworkManager). Of course, not having connectivity is quite a serious issue for a device whose main purpose is to provide connectivity, isn’t it?
But fear not; as this specific issue with the lack of ethernet headers while in LTE has already been addressed in the kernel itself by Bjørn Mork and Dan Williams, who have debugged the issue extensively and implemented a superb hack to workaround the bug. The qmi_wwan driver in the kernel will now try to detect these ethernet-header-less packets, and provide a made up header transparently, so that upper layers can reliably use the interface as any other net interface. Along with this patch, two additional firmware bug workarounds were provided: one avoiding hardcoded MAC address that may appear randomly during the communication, and another one to avoid wrong information given by the CDC functional descriptors of the device. These patches are already available in the Linux kernel since 3.9-rc8, so the latest 3.10 stable version already has them in. Upgrading to the newest stable kernel is therefore highly encouraged if you’re experiencing any of these issues.
If you are stuck using an older kernel, you will want to import the following patches:
- net: qmi_wwan: fixup missing ethernet header (firmware bug workaround)
- net: qmi_wwan: fixup destination address (firmware bug workaround)
- net: qmi_wwan: prevent duplicate mac address on link (firmware bug workaround)
Drop us a line if you still see issues with your broadband modems, and feel free to also provide “works for me” feedback!