I've been trying on and off for days to build the module for my USB wireless device.

It is an Edimax EW-7811UN

I've found several resources on building modules for Debian, but none for Arch. Currently I am attempting to cross-compile using the ToolChain found on the Raspberry Pi GitHub. These are the steps I've taken:

  • Downloaded the driver sources from the Edimax website.
  • Downloaded the kernel sources from GitHub.
  • Created a specific make rule (as per the Edimax documentation) in the Edimax MakeFile:

  ARCH := arm
  CROSS_COMPILE := arm-bcm2708-linux-gnueabi-
  KVER  := 3.1.9-30-ARCH+
  KSRC := /pi-sources/lib/modules/3.1.9-30-ARCH+/build 
  MODDESTDIR := /pi-sources/lib/modules/3.1.9-30-ARCH+/kernel/drivers/net/wireless/
  • KSRC is the directory containing the kernel sources.
  • MODDESTDIR is the directory you wish the module to end up.
  • CROSS_COMPILE is my toolchain (which has been added to PATH)

First attempt at make gives this error:

fatal error: linux/smp_lock.h: No such file or directory

I found that this is an outdated header, and symlinking it to smp.h should fix the issue. However, the build still fails with source errors, that look like this:

error: field 'recv_tasklet' has incomplete type

I've done enough compiling to know this looks as if the build doesn't support the latest kernel version, but if this is so then how has it been built for Debian?

Extra information:

  • The full output here.
  • I have the same adapter, though not yet got around to trying it! Jun 13, 2012 at 17:56
  • Please let me know how you get on with it and add your experience afterward, even if its negative.
    – Jivings
    Jun 13, 2012 at 18:05
  • @Tomas, more bounty! Make sure Alex doesn't get it this time :)
    – Jivings
    Jul 30, 2012 at 12:36
  • For anyone coming across this who has a V2, it will require a different driver from downloads.fars-robotics.net/wifi-drivers/8188eu-drivers Feb 19, 2021 at 2:43

2 Answers 2


Instructions for cross-compiling

  1. Downloaded the driver sources from the Edimax website.

  2. Clone the kernel sources from GitHub.

  3. cd into your kernel source and cd into include/linux. Run

    ln -s smp.h smp_lock.h`.
  4. unzip the Edimax download and tar -xzf the driver package. cd into the driver/rtl... subdirectory.

  5. Edit include/rtw_xmit.h and add #include <linux/interrupt.h> under the other includes.

  6. Edit os_dep/osdep_service.c and add

    #include <linux/semaphore.h>
    #define init_MUTEX(sem)         sema_init(sem, 1)

    under the other includes.

  7. Edit the Makefile adding

    ifeq ($(CONFIG_PLATFORM_PI), y)
    ARCH := arm
    CROSS_COMPILE := arm-bcm2708-linux-gnueabi-
    KVER  := 3.1.9-30-ARCH+
    KSRC := ~/pi-sources
    MODDESTDIR := ~/pi-sources/lib/modules/3.1.9-30-ARCH+/kernel/drivers/net/wireless/

under similar sections.

  1. Assuming arm-bcm2708-linux-gnueabi-{gcc|ld} is in your path, run make CONFIG_PLATFORM_PI=y modules.

The module should now be compiled.

  • Build is successful! But where does the module get built to? So I can copy it onto the Pi.
    – Jivings
    Jul 19, 2012 at 12:12
  • The root of the driver package I think. Jul 19, 2012 at 12:19
  • 1
    Hm, seems to be there. Weird. What's the point in MODDESTDIR then?
    – Jivings
    Jul 19, 2012 at 12:20
  • No idea!!!!!!!!! Jul 19, 2012 at 12:20
  • In order to get this to build on the Raspberry Pi I also had to symlink the /lib/modules/3.1.9-30-ARCH+/build directory to the kernel sources.
    – Jivings
    Jul 24, 2012 at 17:42

Try copying the config.gz from /proc/config.gz on your RPi. Then gunzip it and rename it to .config and make as above.

  • 3
    Can you state why this is useful in your answer?
    – Jivings
    Jul 19, 2012 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.