Siduction Forum

BUGS => Bug Archive (DE/EN) => 2012.1 => Topic started by: ralul on 2012/06/01, 14:48:54

Title: [solved] broadcom wl.ko doesnt build with linux-3.4
Post by: ralul on 2012/06/01, 14:48:54
Linx-3.4 headers miss a system.h for building a proprietary broadcom-sta wl.ko module

dkms doesnt recognize architecture. I edited the Makefile to run compilation by hand this command:

Code: [Select]
KVER=3.4-0.towo.4-siduction-amd64 \
KDIR=/lib/modules/3.4-0.towo.4-siduction-amd64/build\ KERNELRELEASE=3.4-0.towo.4-siduction-amd64 make all

/var/lib/dkms/broadcom-sta/5.100.82.112/build/src/wl/sys/wl_linux.c:43:24: fatal error: asm/system.h: Datei oder Verzeichnis nicht gefunden

Also openSUSE doesn't build wl.ko
Both build Nvidia.
Both linux-3.4 header directories
miss arch/x86/system.h
but arch/arm/system.h exists for SUSE headers

PS: I need to use the proprietary broadcom-sta,
because of my very special Mac Mini Hardware:
03:00.0 Network controller [0280]: Broadcom
Corporation BCM4321 802.11a/b/g/n [14e4:4328](rev 05)

I will have to use old linux kernels all my life :(
Title: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: ralul on 2012/06/01, 15:01:00
This surely is not a bug of siduction but upstream!
Posting here to remind people having the same hardware ...

Found a patch to just let system.h go away:
Code: [Select]
--- a/amd64/src/wl/sys/wl_linux.c
+++ b/amd64/src/wl/sys/wl_linux.c
@@ -40,7 +40,9 @@
 #include <linux>
 #define WLC_MAXBSSCFG          1

+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
 #include <asm>
+#endif
 #include <asm>
 #include <asm>
 #include <asm>
--- a/i386/src/wl/sys/wl_linux.c
+++ b/i386/src/wl/sys/wl_linux.c
@@ -40,7 +40,9 @@
 #include <linux>
 #define WLC_MAXBSSCFG          1

+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
 #include <asm>
+#endif
 #include <asm>
 #include <asm>
 #include <asm>
Title: RE: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: towo on 2012/06/01, 15:32:35
I have uploaded a fixed broadcom-sta to our fixes repo.
Tested only over module-assistant, so i can't say, if dkms is also working.
Title: RE: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: ralul on 2012/06/01, 15:36:03
Yes that is another problem - not finding the right architecture. But it is a dkms problem! But I wonder why nvidia works? Perhaps the second call to dkms gets an arch parameter lost ?
Title: RE: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: towo on 2012/06/01, 15:50:17
Finding the right ARCH should work with the code in the Makefile.
The code works without problem by hand:
Code: [Select]

towo:Defiant> egrep 'CONFIG_X86_(32|64)=y' /lib/modules/3.4-0.towo.4-siduction-amd64/build/.config | cut -d= -f1
CONFIG_X86_64
Title: RE: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: ralul on 2012/06/01, 16:12:32
In the original Makefile of debian package broadcom-sta-dkms:
Code: [Select]
KARCH := $(shell egrep 'CONFIG_X86_(32|64)=y' $(KDIR)/.config 2>/dev/null| cut -d= -f1)
Perhaps KDIR is not defined...

Towo, very thanx for your Help!
Title: RE: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: towo on 2012/06/01, 16:14:44
Ideed, it is:
Code: [Select]

ifeq ($(KVER),)
<------>KVER = $(shell uname -r)
endif
KDIR     = /lib/modules/$(KVER)/build
PWD      = $(shell pwd)
Title: RE: propr broadcom wl.ko module doesnt build - linux-3.4
Post by: ralul on 2012/06/23, 03:40:16
There is an open Bug about this:
http://bugs.debian.org/677193  
broadcom-sta-dkms : DKMS doesn't work with 3.4 kernel

Our fix for broadcom-sta-5.100.82.112 /src/wl/sys/wl_linux.c
Code: [Select]
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
#include <asm>
#else
#include <asm>
#endif
has no spaces - this is better functioning:
Code: [Select]
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)Obviously I am the only user who needs to use proprietary broadcom and stumbles upon.