Saturday, January 9, 2016

wireless - Ubuntu 12.04 patched b43 driver compilation error




I tried this How do I install this patched b43 driver? guide to install patched b43 driver on Ubuntu 12.04 with 3.2.0-31-generic kernel but I can't pass compilation phase.Here is what I did:



wget http://www.orbit-lab.org/kernel/compat-wireless-3-stable/v3.1/compat-wireless-3.1.1-1.tar.bz2
cd compat-wireless-3.1.1-1/



scripts/driver-select b43



make




make -C /lib/modules/3.2.0-31-generic/build M=/home/marco/compat-wireless-3.1.1-1 modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-31-generic'
CC [M] /home/marco/compat-wireless-3.1.1-1/compat/main.o
In file included from /home/marco/compat-wireless-3.1.1-1/include/linux/compat-2.6.29.h:5:0,
from /home/marco/compat-wireless-3.1.1-1/include/linux/compat-2.6.h:24,
from :0:
include/linux/netdevice.h:1153:5: warning: "IS_ENABLED" is not defined [-Wundef]
include/linux/netdevice.h:1153:15: error: missing binary operator before token "("
include/linux/netdevice.h: In function ‘netdev_uses_dsa_tags’:
include/linux/netdevice.h:1421:9: error: ‘struct net_device’ has no member named ‘dsa_ptr’

include/linux/netdevice.h:1422:31: error: ‘struct net_device’ has no member named ‘dsa_ptr’
include/linux/netdevice.h: In function ‘netdev_uses_trailer_tags’:
include/linux/netdevice.h:1431:9: error: ‘struct net_device’ has no member named ‘dsa_ptr’
include/linux/netdevice.h:1432:35: error: ‘struct net_device’ has no member named ‘dsa_ptr’
make[3]: *** [/home/marco/compat-wireless-3.1.1-1/compat/main.o] Error 1
make[2]: *** [/home/marco/compat-wireless-3.1.1-1/compat] Error 2
make[1]: *** [_module_/home/marco/compat-wireless-3.1.1-1] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-31-generic'
make: *** [modules] Error 2



To fix that error I added #include to /usr/src/linux-headers-3.2.0-31-generic/include/linux/netdevice.h but now I'm getting something else



make



make -C /lib/modules/3.2.0-31-generic/build M=/home/marco/compat-wireless-3.1.1-1 modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-31-generic'
CC [M] /home/marco/compat-wireless-3.1.1-1/compat/main.o
LD [M] /home/marco/compat-wireless-3.1.1-1/compat/compat.o
CC [M] /home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.o

In file included from /home/marco/compat-wireless-3.1.1-1/include/linux/bcma/bcma.h:9:0,
from /home/marco/compat-wireless-3.1.1-1/drivers/bcma/bcma_private.h:8,
from /home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:8:
/home/marco/compat-wireless-3.1.1-1/include/linux/ssb/ssb.h: In function ‘ssb_driver_register’:
/home/marco/compat-wireless-3.1.1-1/include/linux/ssb/ssb.h:236:36: error: ‘THIS_MODULE’ undeclared (first use in this function)
/home/marco/compat-wireless-3.1.1-1/include/linux/ssb/ssb.h:236:36: note: each undeclared identifier is reported only once for each function it appears in
In file included from /home/marco/compat-wireless-3.1.1-1/drivers/bcma/bcma_private.h:8:0,
from /home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:8:
/home/marco/compat-wireless-3.1.1-1/include/linux/bcma/bcma.h: In function ‘bcma_driver_register’:
/home/marco/compat-wireless-3.1.1-1/include/linux/bcma/bcma.h:170:37: error: ‘THIS_MODULE’ undeclared (first use in this function)

/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c: At top level:
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:12:20: error: expected declaration specifiers or ‘...’ before string constant
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:13:16: error: expected declaration specifiers or ‘...’ before string constant
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:182:1: warning: data definition has no type or storage class [enabled by default]
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:182:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:182:1: warning: parameter names (without types) in function declaration [enabled by default]
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:188:1: warning: data definition has no type or storage class [enabled by default]
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:188:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.c:188:1: warning: parameter names (without types) in function declaration [enabled by default]
make[3]: *** [/home/marco/compat-wireless-3.1.1-1/drivers/bcma/main.o] Error 1

make[2]: *** [/home/marco/compat-wireless-3.1.1-1/drivers/bcma] Error 2
make[1]: *** [_module_/home/marco/compat-wireless-3.1.1-1] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-31-generic'
make: *** [modules] Error 2


Any suggestion what to try next?



Facing same issue, I had to edit many files to fix.




/usr/src/linux-headers-3.2.0-31-generic/include/linux/netdevice.h
bcm4331/compat-wireless-2011-08-27/include/linux/compat-2.6.h
bcm4331/compat-wireless-2011-08-27/drivers/net/wireless/b43/main.c
bcm4331/compat-wireless-2011-08-27/drivers/net/wireless/b43legacy/main.c
bcm4331/compat-wireless-2011-08-27/drivers/net/wireless/b43/pio.c
bcm4331/compat-wireless-2011-08-27/net/mac80211/mlme.c
bcm4331/compat-wireless-2011-08-27/net/mac80211/rate.c
bcm4331/compat-wireless-2011-08-27/net/wireless/core.c
bcm4331/compat-wireless-2011-08-27/net/wireless/util.c
bcm4331/compat-wireless-2011-08-27/net/wireless/reg.c

bcm4331/compat-wireless-2011-08-27/net/wireless/nl80211.c


mainly adding



+#include 
+#include


When problem causes by strings, I commented out functions in /usr/src/linux-headers-3.2.0-31-generic/include/linux/netdevice.h and others files.




//#if IS_ENABLED(CONFIG_NET_DSA)
// struct dsa_switch_tree *dsa_ptr; /* dsa specific data */
//#endif

//#ifdef CONFIG_NET_DSA_TAG_DSA
// if (dev->dsa_ptr != NULL)
// return dsa_uses_dsa_tags(dev->dsa_ptr);
//#endif


//#ifdef CONFIG_NET_DSA_TAG_TRAILER
// if (dev->dsa_ptr != NULL)
// return dsa_uses_trailer_tags(dev->dsa_ptr);
//#endif


or adding = false in declaration statement for one variable in one file.



I am not a C dev but PHP dev but simply following the make debug and it worked then with:




sudo ./b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" ../broadcom-wl-5.100.138/linux/wl_apsta

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...