Ayuda al compilar driver propietario Broadcom

Este tema esta algo sonado ya, pero necesito ayuda con esto.
Intento compilar el driver en Debian testing/sid con kernel 2.6.29 y esto es loq ue me sale:

$ make -C /lib/modules/2.6.29-1-amd64/build M=`pwd`                                                        
make: se ingresa al directorio `/usr/src/linux-headers-2.6.29-1-amd64'                                                                 
  LD      /home/rafael/Documentos/wl/built-in.o                                                                                        
  CC [M]  /home/rafael/Documentos/wl/src/wl/sys/wl_linux.o                                                                             
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_attach’:                                                             
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:409: error: implicit declaration of function ‘ieee80211_get_crypto_ops’               
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:409: warning: assignment makes pointer from integer without a cast                    
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:412: warning: assignment makes pointer from integer without a cast                    
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_free’:                                                               
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:680: error: ‘struct net_device’ has no member named ‘priv’                            
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:711: error: ‘struct net_device’ has no member named ‘priv’                            
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:727: error: dereferencing pointer to incomplete type                                  
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:731: error: dereferencing pointer to incomplete type                                  
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_open’:                                                               
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:756: error: ‘struct net_device’ has no member named ‘priv’                            
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_close’:                                                              
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:784: error: ‘struct net_device’ has no member named ‘priv’                            
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_start’:                                                              
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:807: error: ‘struct net_device’ has no member named ‘priv’                            
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_alloc_if’:                                                           
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:894: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_ioctl’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1148: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1149: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_get_stats’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1230: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_get_wireless_stats’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1275: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1276: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_set_mac_address’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1345: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1353: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘_wl_set_multicast_list’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1378: error: ‘struct net_device’ has no member named ‘priv’
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_tkip_miccheck’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1769: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1772: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_tkip_micadd’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1791: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_tkip_encrypt’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1811: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_tkip_decrypt’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1833: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1835: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_tkip_keyset’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1877: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1887: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1894: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1904: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1914: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1921: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c: In function ‘wl_tkip_printstats’:
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1940: error: dereferencing pointer to incomplete type
/home/rafael/Documentos/wl/src/wl/sys/wl_linux.c:1942: error: dereferencing pointer to incomplete type
make[3]: *** [/home/rafael/Documentos/wl/src/wl/sys/wl_linux.o] Error 1
make[2]: *** [_module_/home/rafael/Documentos/wl] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
make: se sale del directorio `/usr/src/linux-headers-2.6.29-1-amd64

¿Alguna ayuda?
¿Me faltará alguna librería? Son como errores de compilación.

Hola EagleScreem,

Yo tengo exáctamente el mismo problema salvo por el /home/rafael wink

Mi tarjeta wifi es la Broadcom bcm4322 que viene con el Macbook versión 5.1.
En mi caso utilizo Lenny y la versión del kernel es la misma pero está descargado de kernel.org compilado por mí.

He estado compilando más cosas que necesitaba probar y después de desinstalar los paquetes -dev que ya no necesitaba, puede que haya desinstalado alguno de más por error shamed

Lo digo porque señalas la posibilidad de que te falte alguna librería para compilar.

Saludos

Y calculo que lo parcheaste no?
Digo ese driver/modulo que bajaste por Internet de la pagina de broadcom para kernels de rama .29 no funciona sin el parche, hasta lo que yo sé.
Creo que en la misma págjna se encuentra el dichoso.
Abrazos!
Sebas

Lo parcheé y compila, pero luego no se puede cargar, le falta al kernel otro módulo del que depende, el ieee80211_crypt_tkip.

EagleScreen escribió:

Lo parcheé y compila, pero luego no se puede cargar, le falta al kernel otro módulo del que depende, el ieee80211_crypt_tkip.

Ok entonces lo de la compilaciòn se solucionó dices? lo que te està pasando es que ese modulo no carga debido a que depende de otro o te entendí mal?
Abrazos!
Sebas
EDITO:Hasta lo que yo sabìa (no se si tendrá algo que ver) ieee80211_crypt_tkip había cambiado de nombre..por lo menos en Arch, no se en Debian.

sebas escribió:

EDITO:Hasta lo que yo sabìa (no se si tendrá algo que ver) ieee80211_crypt_tkip había cambiado de nombre..por lo menos en Arch, no se en Debian.

Efectivamente sebas en el kernel 2.6.29.1, lo mismo en otro anterior también, ha pasado a llamarse:

lib80211_crypt_tkip

Yo no he conseguido que me compilara.

Descargué el parche

wget http://aur.archlinux.org/packages/broadcom-wl/broadcom-wl/broadcom-sta-5.10.79.10-linux-2.6.29.patch

y lo apliqué:

makalu:~/hybrid# patch -p1 -d src/wl/sys/ < broadcom-sta-5.10.79.10-linux-2.6.29.patch
patching file wl_iw.c
patching file wl_linux.c
Hunk #3 succeeded at 208 (offset 11 lines).
Hunk #4 succeeded at 374 (offset 13 lines).
Hunk #5 succeeded at 450 (offset 13 lines).
Hunk #6 succeeded at 767 (offset 19 lines).
Hunk #7 succeeded at 940 (offset 18 lines).
Hunk #8 succeeded at 956 (offset 18 lines).

Hasta donde yo entiendo sin problemas.

Ahora al compilar:

makalu:~/hybrid# make -C /lib/modules/2.6.29.1/build M=`pwd`
make: se ingresa al directorio `/usr/src/linux-2.6.29.1'
  LD      /root/hybrid/built-in.o
  CC [M]  /root/hybrid/src/wl/sys/wl_linux.o
  CC [M]  /root/hybrid/src/wl/sys/wl_iw.o
  CC [M]  /root/hybrid/src/shared/linux_osl.o
  LD [M]  /root/hybrid/wl.o
ld: Relocatable linking with relocations from format elf64-x86-64 (/root/hybrid/lib/wlc_hybrid.o_shipped) to format elf32-i386 (/root/hybrid/wl.o) is not supported
make[1]: *** [/root/hybrid/wl.o] Error 1
make: *** [_module_/root/hybrid] Error 2
make: se sale del directorio `/usr/src/linux-2.6.29.1'

Que me da la impresión que tiene que ver con la arquitectura, la mía x86-64.

Por otro lado aclara que el parche que esta en la página de Broadcom es:http://www.broadcom.com/docs/linux_sta/wl_iw_v2.patch

Que según el fabricante se utiliza para "Patch for WPA-Enterprise hang and 32-byte SSIDs", que me parece que no tiene nada que ver con mis errores.

También he probado a aplicar este parche, y simplemente no le puedo aplicar:

makalu:~/hybrid# patch -p1 -d src/wl/sys/ < wl_iw_v2.patch
missing header for context diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|*** wl_iw.c_1.63.2.22 Mon Feb  9 13:43:00 2009
|--- wl_iw.c_1.63.2.22.2.2 Thu Apr  2 10:25:41 2009
--------------------------
File to patch: wl_iw.c
patching file wl_iw.c
Hunk #1 FAILED at 22.
Hunk #2 succeeded at 1102 (offset 8 lines).
Hunk #3 succeeded at 2413 (offset 24 lines).
1 out of 3 hunks FAILED -- saving rejects to file wl_iw.c.rej

Gracias

JMiguel escribió:

Yo no he conseguido que me compilara.

Descargué el parche

wget http://aur.archlinux.org/packages/broadcom-wl/broadcom-wl/broadcom-sta-5.10.79.10-linux-2.6.29.patch

y lo apliqué:

makalu:~/hybrid# patch -p1 -d src/wl/sys/ < broadcom-sta-5.10.79.10-linux-2.6.29.patch
patching file wl_iw.c
patching file wl_linux.c
Hunk #3 succeeded at 208 (offset 11 lines).
Hunk #4 succeeded at 374 (offset 13 lines).
Hunk #5 succeeded at 450 (offset 13 lines).
Hunk #6 succeeded at 767 (offset 19 lines).
Hunk #7 succeeded at 940 (offset 18 lines).
Hunk #8 succeeded at 956 (offset 18 lines).

Hasta donde yo entiendo sin problemas.

Ahora al compilar:

makalu:~/hybrid# make -C /lib/modules/2.6.29.1/build M=`pwd`
make: se ingresa al directorio `/usr/src/linux-2.6.29.1'
  LD      /root/hybrid/built-in.o
  CC [M]  /root/hybrid/src/wl/sys/wl_linux.o
  CC [M]  /root/hybrid/src/wl/sys/wl_iw.o
  CC [M]  /root/hybrid/src/shared/linux_osl.o
  LD [M]  /root/hybrid/wl.o
ld: Relocatable linking with relocations from format elf64-x86-64 (/root/hybrid/lib/wlc_hybrid.o_shipped) to format elf32-i386 (/root/hybrid/wl.o) is not supported
make[1]: *** [/root/hybrid/wl.o] Error 1
make: *** [_module_/root/hybrid] Error 2
make: se sale del directorio `/usr/src/linux-2.6.29.1'

Que me da la impresión que tiene que ver con la arquitectura, la mía x86-64.

Por otro lado aclara que el parche que esta en la página de Broadcom es:http://www.broadcom.com/docs/linux_sta/wl_iw_v2.patch

Que según el fabricante se utiliza para "Patch for WPA-Enterprise hang and 32-byte SSIDs", que me parece que no tiene nada que ver con mis errores.

También he probado a aplicar este parche, y simplemente no le puedo aplicar:

makalu:~/hybrid# patch -p1 -d src/wl/sys/ < wl_iw_v2.patch
missing header for context diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|*** wl_iw.c_1.63.2.22 Mon Feb  9 13:43:00 2009
|--- wl_iw.c_1.63.2.22.2.2 Thu Apr  2 10:25:41 2009
--------------------------
File to patch: wl_iw.c
patching file wl_iw.c
Hunk #1 FAILED at 22.
Hunk #2 succeeded at 1102 (offset 8 lines).
Hunk #3 succeeded at 2413 (offset 24 lines).
1 out of 3 hunks FAILED -- saving rejects to file wl_iw.c.rej

Gracias

Por lo que veo mi error está más relacionado con la compilación del kernel, por lo que ha abierto otro hilo http://www.esdebian.org/foro/31622/problema-compilacion-26291-macbook-51

Además parece que EagleScreen ya lo ha solucionado

Como ya dije el problema estaba en el kernel

Realmente lo que tenía instalado era un sistema mixto, todo de 32bits menos el kernel de 64 bits.

He actualizado todo mi sistema a x86_64.

Ahora empezaré a darle caña a la wifi de Broadcom

Gracias

Menudo tropezón...pero bueno menos mal que diste con la solución. clap
Cuando creas conveniente no olvides marcar el hilo como solucionado.
Abrazos
Sebas

Gracias sebas,

Estaría encantado en marcar como solucionado, pero sigo con problemas :(

Ahora si que sí con kernel y sistema en consonancia :

makalu:~/hybrid_wl# uname -a
Linux makalu 2.6.26-2-amd64 #1 SMP Fri Mar 27 04:02:59 UTC 2009 x86_64 GNU/Linux

makalu:~/hybrid_wl# dpkg-architecture
DEB_BUILD_ARCH=amd64
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_ARCH_CPU=amd64
DEB_BUILD_GNU_CPU=x86_64
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=x86_64-linux-gnu
DEB_HOST_ARCH=amd64
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=amd64
DEB_HOST_GNU_CPU=x86_64
DEB_HOST_GNU_SYSTEM=linux-gnu
DEB_HOST_GNU_TYPE=x86_64-linux-gnu

Compilo el módulo sin problemas:

makalu:~/hybrid_wl# make -C /lib64/modules/2.6.26-2-amd64/build M=`pwd`
make: se ingresa al directorio `/usr/src/linux-headers-2.6.26-2-amd64'
  LD      /root/hybrid_wl/built-in.o
  CC [M]  /root/hybrid_wl/src/wl/sys/wl_linux.o
  CC [M]  /root/hybrid_wl/src/wl/sys/wl_iw.o
  CC [M]  /root/hybrid_wl/src/shared/linux_osl.o
  LD [M]  /root/hybrid_wl/wl.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /root/hybrid_wl/wl.mod.o
  LD [M]  /root/hybrid_wl/wl.ko
make: se sale del directorio `/usr/src/linux-headers-2.6.26-2-amd64'

Instalo los módulos necesarios:

makalu:~/hybrid_wl# modprobe ieee80211_crypt_tkip      
makalu:~/hybrid_wl# insmod wl.ko
makalu:~/hybrid_wl# lsmod|grep ieee
ieee80211_crypt_tkip    13184  0
ieee80211_crypt        10244  2 wl,ieee80211_crypt_tkip

En el dmesg no parecen errores:

[ 3305.679779] ieee80211_crypt: registered algorithm 'NULL'
[ 3305.680245] ieee80211_crypt: registered algorithm 'TKIP'
[ 3425.428399] wl: module license '' taints kernel.
[ 3425.432343] ACPI: PCI Interrupt 0000:03:00.0[A] -> Link [Z00F] -> GSI 23 (level, low) -> IRQ 23
[ 3425.432355] PCI: Setting latency timer of device 0000:03:00.0 to 64
[ 3425.449773] eth1: Broadcom BCM432b 802.11 Wireless Controller 5.10.79.10
[ 3438.272629] eth1: no IPv6 routers present

Y la tarjeta es detectada:

makalu:~/hybrid_wl# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11abgn  ESSID:""  Nickname:""
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated  
          Bit Rate:44 Mb/s   Tx-Power:32 dBm  
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Power Managementmode:All packets received
          Link Quality=5/5  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

El problema está en configurarla:

makalu:~/hybrid_wl# iwconfig eth1 essid MIESSID key s:MICLAVE
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device eth1 ; Invalid argument.

Obtengo el mismo error si en vez de poner s:MICLAVE calculo primero con wpa_passphrase MIESSID MICLAVE

Se me olvidaba decir que está protegida por WPA, y no WPA2

También he descargado el parche wl_iw_v2.patch, por si acaso, pero no me funciona:

makalu:~/hybrid_wl# patch -p1 -d src/wl/sys/ < wl_iw_v2.patch
missing header for context diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
File to patch:

Si indico el archivo:

patching file wl_iw.c
Hunk #1 FAILED at 22.
Hunk #2 FAILED at 1094.
Hunk #3 FAILED at 2389.

Sigo probando cosas

Gracias