[oe] compat-wireless recipe

Elvis Dowson elvis.dowson at mac.com
Wed Dec 22 19:51:45 UTC 2010


Hi,
      Is there a recipe for compat-wireless? 

http://linuxwireless.org/en/users/Download/stable/

Support for the TI wl1271 wlan module is only available in mainline kernel 2.6.37-rc6 onwards, and the compat-wireless package provides backports of the wl1271 driver for android-kernel-2.6.32.

http://linuxwireless.org/en/users/Drivers/wl12xx

I just need a recipe to incorporate it into my root file system build. 

Here is the full logical flow to replicating the process, if someone could help me write a recipe for this, it would be great. I can write simple recipes based off git and local file repos, but I don't know how to handle and process the compat-wireless ways of dealing with things.

Best regards,

Elvis


Technote android-2.6.32-009: How to backport wl12xx drivers from linux-2.6.37-rc6 kernel to android-rowboat-eclair-2.6.32 kernel


Overview

This document describes how to backport the wl12xx drivers from the linux-2.6.37-rc6 kernel to the android-rowboat-eclair-2.6.32 kernel.


Procedure


Step 01.00: Download the compat-wireless package.

http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.37/compat-wireless-2.6.37-rc6-3.tar.bz2

Step 02.00: Configure and build the wl12xx driver.

Step 02.01: Modify environment variables in .bashrc

#
# Environment setup for u-boot and linux kernel
#

export ARCH=arm
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-
export CROSSCOMPILER=armv7a
export CROSSTOOLCHAIN=${OVEROTOP}/tmp/sysroots/x86_64-linux/usr/${CROSSCOMPILER}
export KERNEL_DIR="/tool/patches/android-rowboat-2.6.32-kernel-patchwork"
export UIMAGE_DIR="${KERNEL_DIR}/arch/arm/boot"
export KLIB="${KERNEL_DIR}"
export KLIB_BUILD="${KERNEL_DIR}"


Step 02.02: Select the driver

$ cd /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork
$ ./scripts/driver-select wl12xx

Step 02.03: Apply patches to fix various compilation errors.

 Problem 01: error: redefinition of ‘netdev_alloc_skb_ip_align’

$ make
./scripts/gen-compat-autoconf.sh config.mk > include/linux/compat_autoconf.h
make -C /tool/patches/android-rowboat-2.6.32-kernel-patchwork M=/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork modules
make[1]: Entering directory `/tool/patches/android-rowboat-2.6.32-kernel-patchwork'
 CC [M]  /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/compat/main.o
In file included from /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/include/linux/compat-2.6.h:28,
                from <command-line>:0:
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/include/linux/compat-2.6.33.h:56:1: warning: "NETDEV_POST_INIT" redefined
In file included from include/linux/memory_hotplug.h:6,
                from include/linux/mmzone.h:653,
                from include/linux/gfp.h:4,
                from include/linux/kmod.h:22,
                from include/linux/module.h:13,
                from include/linux/textsearch.h:7,
                from include/linux/skbuff.h:27,
                from include/linux/if_ether.h:124,
                from include/linux/netdevice.h:29,
                from /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/include/linux/compat-2.6.29.h:5,
                from /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/include/linux/compat-2.6.h:24,
                from <command-line>:0:
include/linux/notifier.h:204:1: warning: this is the location of the previous definition
In file included from /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/include/linux/compat-2.6.h:28,
                from <command-line>:0:
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/include/linux/compat-2.6.33.h:58: error: redefinition of ‘netdev_alloc_skb_ip_align’
include/linux/skbuff.h:1487: error: previous definition of ‘netdev_alloc_skb_ip_align’ was here
make[3]: *** [/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/compat/main.o] Error 1
make[2]: *** [/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/compat] Error 2
make[1]: *** [_module_/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork] Error 2
make[1]: Leaving directory `/tool/patches/android-rowboat-2.6.32-kernel-patchwork'
make: *** [modules] Error 2

Solution: Apply the following patch.

diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index c2dbc1b..468a074 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -52,19 +52,6 @@ static inline void compat_release_firmware(const struct firmware *fw)
#define IFF_DONT_BRIDGE 0x800          /* disallow bridging this ether dev */
/* source: include/linux/if.h */

-/* this will never happen on older kernels */
-#define NETDEV_POST_INIT 0xffff
-
-static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
-                unsigned int length)
-{
-       struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
-
-       if (NET_IP_ALIGN && skb)
-               skb_reserve(skb, NET_IP_ALIGN);
-       return skb;
-}
-
#if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)

#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)


 Problem 02: Multiple errors in function ‘ieee80211_led_init’:

CC [M]  /tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.o
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c: In function ‘ieee80211_led_init’:
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:59: error: invalid application of ‘sizeof’ to incomplete type ‘struct led_trigger’ 
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:63: error: dereferencing pointer to incomplete type
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:64: error: implicit declaration of function ‘led_trigger_register’
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:70: error: invalid application of ‘sizeof’ to incomplete type ‘struct led_trigger’ 
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:74: error: dereferencing pointer to incomplete type
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:81: error: invalid application of ‘sizeof’ to incomplete type ‘struct led_trigger’ 
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:85: error: dereferencing pointer to incomplete type
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:92: error: invalid application of ‘sizeof’ to incomplete type ‘struct led_trigger’ 
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:96: error: dereferencing pointer to incomplete type
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c: In function ‘ieee80211_led_exit’:
/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.c:107: error: implicit declaration of function ‘led_trigger_unregister’
make[3]: *** [/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211/led.o] Error 1
make[2]: *** [/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork/net/mac80211] Error 2
make[1]: *** [_module_/tool/patches/compat-wireless-2.6.37-rc6-3-patchwork] Error 2
make[1]: Leaving directory `/tool/patches/android-rowboat-2.6.32-kernel-patchwork'
make: *** [modules] Error 2

Solution: In the kernel config, CONFIG_LEDS_TRIGGERS is probably unset and net/mac80211/led.c should not be build at all. 

In the kernel CONFIG_MAC80211_LEDS will select CONFIG_LEDS_TRIGGERS, but in compat-wireless this should just be disabled.

Apply the following patch to fix the problem.

From 47d9c7d253a7b2a78af69f0d8177ee55df74ea0e Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke at hauke-m.de>
Date: Wed, 22 Dec 2010 19:10:34 +0100
Subject: [PATCH] compat-wireless: build led support conditionally

Do not build compat-wireless with LED support when the kernel does not
contain a led subsystem.
This fixes some compile problems when CONFIG_LEDS_TRIGGERS is not set.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
Signed-off-by: Luis R. Rodriguez <lrodriguez at atheros.com>
---
config.mk |   36 +++++++++++++++++++++++++++---------
1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/config.mk b/config.mk
index 964c646..3a38d34 100644
--- a/config.mk
+++ b/config.mk
@@ -133,7 +133,9 @@ CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel_ht
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
-CONFIG_MAC80211_LEDS=y
+ifdef CONFIG_LEDS_TRIGGERS
+ CONFIG_MAC80211_LEDS=y
+endif #CONFIG_LEDS_TRIGGERS

# enable mesh networking too
CONFIG_MAC80211_MESH=y
@@ -243,7 +245,9 @@ CONFIG_B43_PCI_AUTOSELECT=y
ifdef CONFIG_PCMCIA
CONFIG_B43_PCMCIA=y
endif #CONFIG_PCMCIA
-CONFIG_B43_LEDS=y
+ifdef CONFIG_MAC80211_LEDS
+ CONFIG_B43_LEDS=y
+endif #CONFIG_MAC80211_LEDS
CONFIG_B43_PHY_LP=y
CONFIG_B43_PHY_N=y
# CONFIG_B43_FORCE_PIO=y
@@ -252,7 +256,9 @@ CONFIG_B43_PHY_N=y
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_HWRNG=y
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
-CONFIG_B43LEGACY_LEDS=y
+ifdef CONFIG_MAC80211_LEDS
+ CONFIG_B43LEGACY_LEDS=y
+endif #CONFIG_MAC80211_LEDS
# CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
@@ -408,18 +414,24 @@ endif #CONFIG_COMPAT_KERNEL_29

CONFIG_P54_USB=m
CONFIG_RTL8187=m
-CONFIG_RTL8187_LEDS=y
+ifdef CONFIG_MAC80211_LEDS
+ CONFIG_RTL8187_LEDS=y
+endif #CONFIG_MAC80211_LEDS

CONFIG_AT76C50X_USB=m

ifndef CONFIG_COMPAT_KERNEL_28
CONFIG_AR9170_USB=m
-CONFIG_AR9170_LEDS=y
+ifdef CONFIG_MAC80211_LEDS
+ CONFIG_AR9170_LEDS=y
+endif #CONFIG_MAC80211_LEDS
endif #CONFIG_COMPAT_KERNEL_28

ifndef CONFIG_COMPAT_KERNEL_29
CONFIG_CARL9170=m
-CONFIG_CARL9170_LEDS=y
+ifdef CONFIG_MAC80211_LEDS
+ CONFIG_CARL9170_LEDS=y
+endif #CONFIG_MAC80211_LEDS
# CONFIG_CARL9170_DEBUGFS=y
# CONFIG_CARL9170_WPC=y
endif #CONFIG_COMPAT_KERNEL_29
@@ -559,7 +571,9 @@ CONFIG_RT2X00_LIB_CRYPTO=y
ifdef CONFIG_COMPAT_KERNEL_25
CONFIG_RT2X00_LIB_LEDS=n
else #CONFIG_COMPAT_KERNEL_25
-CONFIG_RT2X00_LIB_LEDS=y
+ifdef CONFIG_LEDS_CLASS
+ CONFIG_RT2X00_LIB_LEDS=y
+endif #CONFIG_LEDS_CLASS
endif #CONFIG_COMPAT_KERNEL_25
# CONFIG_RT2X00_DEBUG=y
# CONFIG_RT2X00_LIB_DEBUGFS
@@ -567,7 +581,9 @@ endif

# p54
CONFIG_P54_COMMON=m
-CONFIG_P54_LEDS=y
+ifdef CONFIG_MAC80211_LEDS
+ CONFIG_P54_LEDS=y
+endif #CONFIG_MAC80211_LEDS

# Atheros
CONFIG_ATH_COMMON=m
@@ -594,7 +610,9 @@ endif #CONFIG_COMPAT_KERNEL_27
# In more recent kernel versions use the in kernel rfkill module.
ifdef CONFIG_COMPAT_KERNEL_31
CONFIG_RFKILL_BACKPORT=m
-CONFIG_RFKILL_BACKPORT_LEDS=y
+ifdef CONFIG_LEDS_TRIGGERS
+ CONFIG_RFKILL_BACKPORT_LEDS=y
+endif #CONFIG_LEDS_TRIGGERS
CONFIG_RFKILL_BACKPORT_INPUT=y
endif #CONFIG_COMPAT_KERNEL_31

-- 
1.7.3.2.90.gd4c43

--


Step 02.03: Build the driver

$ make 


Additional patches to be added to the mainline kernel:

01. http://www.spinics.net/lists/linux-mmc/msg03966.html

02. http://permalink.gmane.org/gmane.linux.power-management.general/21579









More information about the Openembedded-devel mailing list