Ubuntu 12.04 corrigiu o erro de compilação do driver b43

2

Eu tentei este Como eu instalo este driver b43 com patch? guia para instalar o driver b43 com patches no Ubuntu 12.04 com o kernel 3.2.0-31-genérico, mas não consigo passar na fase de compilação. Aqui está o que eu fiz:

wget link  cd compat-wireless-3.1.1-1 /

scripts / driver-select b43

faça

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 <command-line>: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

Para corrigir esse erro, adicionei #include <linux/kconfig.h> a /usr/src/linux-headers-3.2.0-31-generic/include/linux/netdevice.h, mas agora estou conseguindo outra coisa

faça

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

Alguma sugestão do que tentar em seguida?

    
por Zed 03.10.2012 / 21:21

1 resposta

0

Enfrentando o mesmo problema, tive que editar muitos arquivos para corrigir.

/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

adicionando principalmente

+#include <linux/module.h>
+#include <linux/export.h>

Quando o problema provoca as strings, comentei funções em /usr/src/linux-headers-3.2.0-31-generic/include/linux/netdevice.h e outros arquivos.

//#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

ou adding = false na declaração para uma variável em um arquivo.

Eu não sou um devedor de C, mas um desenvolvedor PHP, mas simplesmente segui o make debug e ele funcionou com:

sudo ./b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" ../broadcom-wl-5.100.138/linux/wl_apsta
    
por Interchouette 08.10.2012 / 03:36