Sierra Wireless 3G/4G modem drivers for Linux 3.8

I recently forward-ported the latest Sierra Wireless Linux kernel modules to kernel 3.8 to get an Aircard 320U working under Ubuntu 13.04. Along the way I also ported to 3.6 for Ubuntu 12.10 and the Raspberry Pi.

It’s on github at http://github.com/amarburg/sierra_wireless_forward_port

It’s not brilliant kernel hacking, but it got me up and running.

Here’s a bit from the readme:

I recently purchased a Sierra Wireless (now Netgear) Aircard 320U USB 3G/4G modem for some testing. I selected the Aircard 320U based partly on its technical specs (compatibility with the major New Zealand providers), as well as the fact they actually bother to provide support for Linux.

The unit is supported by two kernel modules. sierra is a USB-serial module, which enumerates a number of /dev/ttyUSB* serial devices. These allow direct communication with the modem. For example, I’m using /dev/ttyUSB2 to send AT-style commands to the modem.

The sierra_net module appears as a USB-network driver. As such, the modem appears directly as a network device (wwan0 for me) without any additional mucking about with PPP, etc.

Sierra provides instruction for building their kernel source. Unfortunately, the last entry is for “v3.2_1740″ for kernel 3.0.x. As I’m using a relatively recent Ubuntu installation, I’m running a 3.8 kernel.

The Linux 3.8 kernel provides the sierra (no version number) and sierra_net (v2.0) drivers, but I was unable to get these drivers to enumerate the Aircard 320U. The tarball from Sierra lists sierra v.1.7.40 and sierra_net v.3.2, but out of the box the Sierra code would not build under kernel 3.8.x (changing USB APIs, I imagine).

It seemed like a case of the kernel containing old code which was being ported forward with each new kernel rev, while the vendor was providing updated code, but not keeping up with kernel dev. Seemed like a straightforward call to forward-port the driver, which you see here.

I should disclaim I didn’t do this using my deep knowledge of the Linux kernel APIs, but by a “monkey-see-monkey-do” port between the Sierra code and the current kernel code. It works for me, on Ubuntu 13.04, with an Aircard 320U. Maybe it will work for you too?

I was briefly testing under Ubuntu 12.10, so I also ported to 3.6. I’ve also been able to use this code to run the Sierra on a RaspberryPi running Raspbian (kernel 3.6.y). Actually building the kernel modules was mildly inconvenient, instructions can be found on the internet.

2 thoughts on “Sierra Wireless 3G/4G modem drivers for Linux 3.8

  1. Thanks for this post
    I am quite a noob, I have tried installing it on my raspberry pi (latest wheezy, updated).
    I have installed the kernel headers and ran the makefile with the locations of the header as an argument. So the “make” command now runs successfully
    However the “sudo make install” return an error :

    ERROR: could not insert ‘sierra’: Exec format error
    make: *** [install_sierra] Error 1

    What am I missing? Is it “building the kernel modules” that I need to do ?
    You mention that instructions can be found on the internet, however I am not sure where to start looking…Could please point me to the right direction?

    • If I recall correctly, this means the kernel sources on the Pi (used for the compilation) aren’t exactly the same version as the running kernel. It’s a pain — I never got compilation on the kernel to work.

      I did all of my development by cross-compiling (building on my desktop). I followed:

      http://bchavez.bitarmory.com/archive/2013/01/16/compiling-kernel-modules-for-raspberry-pi.aspx

      The simplest thing to do is copy my source files (sierra.c and sierra_net.c) in the appropriate places in the source tree — overwriting the existing versions — before you make.

      I haven’t had time to really work out the best possible solution for building the kernel modules …. I wish the whole development process was a simpler.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>